def setUp(self): # turn off limited info shown in assert failure for pmd object. self.maxDiff = None # a noop handler for debug info log. class NlogNoop(object): def debug(self, *args): None dataif.Context.nlog = NlogNoop() # create one pmd object. fx_pmd = dataif.Dataif_Pmd(self.core_id) # let it be in numa 0. fx_pmd.numa_id = 0 # add some cpu consumption for this pmd. for i in range(0, config.ncd_samples_max): fx_pmd.idle_cpu_cyc[i] = (1000 + (100 * i)) fx_pmd.proc_cpu_cyc[i] = (5000 + (500 * i)) fx_pmd.rx_cyc[i] = (10000 + (100 * i)) self.pmd_map[self.core_id] = fx_pmd return
def setUp(self): # create one pmd object self.pmd1 = dataif.Dataif_Pmd(1) # set pmd numa id self.pmd1.numa_id = 0 # create port1 object dataif.make_dataif_port("port1") # add port object to pmd object self.port1 = self.pmd1.add_port("port1") # set port numa id self.port1.numa_id = self.pmd1.numa_id # create port2 object dataif.make_dataif_port("port2") # add port object to pmd object self.port2 = self.pmd1.add_port("port2") # set port numa id self.port2.numa_id = self.pmd1.numa_id # add rxq1 to port1 object self.rxq1 = self.port1.add_rxq(1) # add rxq2 to port1 object self.rxq2 = self.port1.add_rxq(2) # add rxq1 to port2 object self.rxq1 = self.port2.add_rxq(1)
def setUp(self): # turn off limited info shown in assert failure for pmd object. self.maxDiff = None dataif.Context.nlog = NlogNoop() # create one pmd object. fx_pmd_1 = dataif.Dataif_Pmd(1) # let it be in numa 0. fx_pmd_1.numa_id = 0 # add it to pmd_map self.pmd_map[1] = fx_pmd_1 # create port class of name 'port1'. dataif.make_dataif_port("port1") # add port object into pmd. port1 = fx_pmd_1.add_port("port1") port1.numa_id = fx_pmd_1.numa_id # add rxq to port object rxq_1 = port1.add_rxq(0) # noqa: F841 # create another pmd object. fx_pmd_2 = dataif.Dataif_Pmd(13) # let it be in numa 0. fx_pmd_2.numa_id = 0 # add it to pmd_map self.pmd_map[13] = fx_pmd_2 # create port class of name 'port2'. dataif.make_dataif_port("port2") # add port object into pmd. port2 = fx_pmd_2.add_port("port2") port2.numa_id = fx_pmd_2.numa_id # add rxq to port object rxq_2 = port2.add_rxq(0) # noqa: F841 return
def setUp(self): # create one pmd object self.pmd1 = dataif.Dataif_Pmd(1) # set pmd numa id self.pmd1.numa_id = 0 dataif.make_dataif_port("port2") self.port2 = self.pmd1.add_port("port2") self.port2.numa_id = self.pmd1.numa_id
def setUp(self): # create one pmd object self.pmd1 = dataif.Dataif_Pmd(1) # set pmd numa id self.pmd1.numa_id = 0 # create port1 object dataif.make_dataif_port("port1") # add port object to pmd object self.port1 = self.pmd1.add_port("port1") # set port numa id self.port1.numa_id = self.pmd1.numa_id