* [dpdk-dev] [PATCH 0/6] fix build warnings and errors in SUSE11 SP3 @ 2015-03-19 3:16 Yong Liu 2015-03-19 3:16 ` [dpdk-dev] [PATCH] app/test-pmd: fix incorrect port number check Yong Liu ` (8 more replies) 0 siblings, 9 replies; 12+ messages in thread From: Yong Liu @ 2015-03-19 3:16 UTC (permalink / raw) To: dev From: Marvin Liu <yong.liu@intel.com> SUSE11 SP3 default gcc version is 4.3.4. Some options not supported in this version. This patch set add gcc version check for those options and fix other build warning in Suse11 SP3. Marvin Liu (6): fix sse3 functions not found with gcc 4.3.4 fix fm10k driver build error when gcc version elder than 4.4 fix build error when initialized structure in enic driver fix build error in app/test with gcc4.3 fix build error in app/test with gcc4.3 fix build error for implicit declaration of function pread app/test/Makefile | 2 ++ app/test/test.h | 2 +- lib/librte_eal/common/include/rte_common_vect.h | 4 ++++ lib/librte_eal/linuxapp/eal/Makefile | 2 ++ lib/librte_pmd_enic/enic_main.c | 10 ++++++---- lib/librte_pmd_fm10k/Makefile | 10 ++++++---- lib/librte_pmd_ixgbe/Makefile | 5 +++-- 7 files changed, 24 insertions(+), 11 deletions(-) -- 1.9.3 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH] app/test-pmd: fix incorrect port number check 2015-03-19 3:16 [dpdk-dev] [PATCH 0/6] fix build warnings and errors in SUSE11 SP3 Yong Liu @ 2015-03-19 3:16 ` Yong Liu 2015-03-19 8:40 ` Thomas Monjalon 2015-03-19 3:16 ` [dpdk-dev] [PATCH 1/6] fix sse3 functions not found with gcc 4.3.4 Yong Liu ` (7 subsequent siblings) 8 siblings, 1 reply; 12+ messages in thread From: Yong Liu @ 2015-03-19 3:16 UTC (permalink / raw) To: dev testpmd parameter "nb-port" mean the number of forwarding port. It's incorrect to use function port_id_is_invalid to check number of ports. Signed-off-by: Marvin Liu <yong.liu@intel.com> diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 11d9af0..f1daa6e 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -628,8 +628,7 @@ launch_args_parse(int argc, char** argv) #endif if (!strcmp(lgopts[opt_idx].name, "nb-ports")) { n = atoi(optarg); - if (n > 0 && - !port_id_is_invalid(n, DISABLED_WARN)) + if (n > 0 && n <= nb_ports) nb_fwd_ports = (uint8_t) n; else rte_exit(EXIT_FAILURE, -- 1.9.3 ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH] app/test-pmd: fix incorrect port number check 2015-03-19 3:16 ` [dpdk-dev] [PATCH] app/test-pmd: fix incorrect port number check Yong Liu @ 2015-03-19 8:40 ` Thomas Monjalon 0 siblings, 0 replies; 12+ messages in thread From: Thomas Monjalon @ 2015-03-19 8:40 UTC (permalink / raw) To: Yong Liu; +Cc: dev This patch was already applied: http://dpdk.org/browse/dpdk/commit/?id=0a530f0d58b030 2015-03-19 11:16, Yong Liu: > testpmd parameter "nb-port" mean the number of forwarding port. > It's incorrect to use function port_id_is_invalid to check number of ports. > > Signed-off-by: Marvin Liu <yong.liu@intel.com> > > diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c > index 11d9af0..f1daa6e 100644 > --- a/app/test-pmd/parameters.c > +++ b/app/test-pmd/parameters.c > @@ -628,8 +628,7 @@ launch_args_parse(int argc, char** argv) > #endif > if (!strcmp(lgopts[opt_idx].name, "nb-ports")) { > n = atoi(optarg); > - if (n > 0 && > - !port_id_is_invalid(n, DISABLED_WARN)) > + if (n > 0 && n <= nb_ports) > nb_fwd_ports = (uint8_t) n; > else > rte_exit(EXIT_FAILURE, > ^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH 1/6] fix sse3 functions not found with gcc 4.3.4 2015-03-19 3:16 [dpdk-dev] [PATCH 0/6] fix build warnings and errors in SUSE11 SP3 Yong Liu 2015-03-19 3:16 ` [dpdk-dev] [PATCH] app/test-pmd: fix incorrect port number check Yong Liu @ 2015-03-19 3:16 ` Yong Liu 2015-03-19 3:16 ` [dpdk-dev] [PATCH] fix the net device bugs and add some funcs to generate vfs in net_device Yong Liu ` (6 subsequent siblings) 8 siblings, 0 replies; 12+ messages in thread From: Yong Liu @ 2015-03-19 3:16 UTC (permalink / raw) To: dev From: Marvin Liu <yong.liu@intel.com> Build dpdk2.0 in Suse11 SP3, there'll be errors for not found sse3 functions. rte_memcpy.h: In function ‘rte_memcpy’: rte_memcpy.h:625: error: implicit declaration of function ‘_mm_alignr_epi8’ rte_memcpy.h:625: error: nested extern declaration of ‘_mm_alignr_epi8’ rte_memcpy.h:625: error: incompatible type for argument 2 of ‘_mm_storeu_si128’ These functions defined in tmmintrin.h and should be included in. Signed-off-by: Marvin Liu <yong.liu@intel.com> diff --git a/lib/librte_eal/common/include/rte_common_vect.h b/lib/librte_eal/common/include/rte_common_vect.h index 54ec70f..df3dce4 100644 --- a/lib/librte_eal/common/include/rte_common_vect.h +++ b/lib/librte_eal/common/include/rte_common_vect.h @@ -50,6 +50,10 @@ #include <emmintrin.h> #endif +#ifdef __SSE3__ +#include <tmmintrin.h> +#endif + #if defined(__SSE4_2__) || defined(__SSE4_1__) #include <smmintrin.h> #endif -- 1.9.3 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH] fix the net device bugs and add some funcs to generate vfs in net_device 2015-03-19 3:16 [dpdk-dev] [PATCH 0/6] fix build warnings and errors in SUSE11 SP3 Yong Liu 2015-03-19 3:16 ` [dpdk-dev] [PATCH] app/test-pmd: fix incorrect port number check Yong Liu 2015-03-19 3:16 ` [dpdk-dev] [PATCH 1/6] fix sse3 functions not found with gcc 4.3.4 Yong Liu @ 2015-03-19 3:16 ` Yong Liu 2015-03-19 3:21 ` Liu, Yong 2015-03-19 3:16 ` [dpdk-dev] [PATCH 2/6] fix fm10k driver build error when gcc version elder than 4.4 Yong Liu ` (5 subsequent siblings) 8 siblings, 1 reply; 12+ messages in thread From: Yong Liu @ 2015-03-19 3:16 UTC (permalink / raw) To: dev From: sjiajiax <sunx.jiajia@intel.com> add some codes to test the vf actions diff --git a/tools/DTF/framework/dut.py b/tools/DTF/framework/dut.py index 02c7639..2b85f23 100644 --- a/tools/DTF/framework/dut.py +++ b/tools/DTF/framework/dut.py @@ -10,7 +10,7 @@ from ssh_connection import SSHConnection from crb import Crb from net_device import NetDevice from logger import getLogger - +import pdb class Dut(Crb): @@ -390,7 +390,8 @@ class Dut(Crb): for (pci_bus, pci_id) in self.pci_devices_info: - if not dts.accepted_nic(pci_id): + #if not dts.accepted_nic(pci_id): + if pci_id == '1106:3119': self.logger.info("DUT: [000:%s %s] %s" % (pci_bus, pci_id, skipped)) continue @@ -488,25 +489,31 @@ class Dut(Crb): """ Generate SRIOV VFs with default driver it is bound now or specifid driver. """ - pci_bus = self.port_info[port_id]['pci'] - port = self.port_info[port_id]['port'] - - bus_id = pci_bus.split(':')[0] - devfun_id = pci_bus.split(':')[1] - port_driver = self.get_dev_driver(bus_id, devfun_id) + port = self.ports_info[port_id]['port'] + port_driver = port.get_nic_driver() if driver == 'default': - if not port_dirver: + if not port_driver: self.logger.info("No driver on specified port, can not generate SRIOV VF.") return None else: if port_driver != driver: - self.bind_interfaces_linux(driver, pci_bus) + port.bind_driver(driver) port.generate_sriov_vfs(vf_num) - sriov_vfs_pci = port.get_sriov_vfs_pci(bus_id, devfun_id) + sriov_vfs_pci = port.get_sriov_vfs_pci() self.ports_info[port_id]['sriov_vfs_pci'] = sriov_vfs_pci + def destroy_sriov_vfs_by_port(self, port_id): + port = self.ports_info[port_id]['port'] + port_driver = port.get_nic_driver() + + if not port_driver: + self.logger.info("No driver on specified port, skip destroy SRIOV VF.") + else: + sriov_vfs_pci = port.destroy_sriov_vfs() + self.ports_info[port_id]['sriov_vfs_pci'] = '' + def get_vm_core_list(self): return VMCORELIST[self.crb['VM CoreList']] diff --git a/tools/DTF/framework/net_device.py b/tools/DTF/framework/net_device.py index 9186ad6..1a99f68 100644 --- a/tools/DTF/framework/net_device.py +++ b/tools/DTF/framework/net_device.py @@ -1,3 +1,5 @@ +import os +import re from functools import wraps import pdb @@ -12,19 +14,21 @@ class NetDevice(object): self.crb = crb self.bus_id = bus_id self.devfun_id = devfun_id + self.default_driver = self.get_nic_driver() self.intf_name = self.get_interface_name() def __send_expect(self, cmds, expected, timeout=TIMEOUT, alt_session=False): return self.crb.send_expect(cmds, expected, timeout=TIMEOUT, alt_session=False) def __get_os_type(self): - return self.crb.__get_os_type() + return self.crb.get_os_type() def nic_has_driver(func): @wraps(func) - def wrapper(self, *args, **kwargs): - self.current_driver = self.get_nic_driver() - if not self.current_driver: + def wrapper(*args, **kwargs): + nic_instance = args[0] + nic_instance.current_driver = nic_instance.get_nic_driver() + if not nic_instance.current_driver: return '' return func(*args, **kwargs) return wrapper @@ -201,17 +205,17 @@ class NetDevice(object): generic_driver = 'generic' get_sriov_vfs_pci_linux = getattr(self, 'get_sriov_vfs_pci_linux_%s' % generic_driver) - return get_sriov_vfs_pci_linux(intf, bus_id, devfun_id) + return get_sriov_vfs_pci_linux(bus_id, devfun_id) def get_sriov_vfs_pci_linux_generic(self, bus_id, devfun_id): sriov_numvfs = self.__send_expect("cat /sys/bus/pci/devices/0000\:%s\:%s/sriov_numvfs" % (bus_id, devfun_id), "# ") sriov_vfs_pci = [] - if sriov_numvfs == 0: + if int(sriov_numvfs) == 0: pass else: try: - virtfns = self.send_exepct("ls -d /sys/bus/pci/devices/0000\:%s\:%s/virtfn*" % + virtfns = self.__send_expect("ls -d /sys/bus/pci/devices/0000\:%s\:%s/virtfn*" % (bus_id, devfun_id), "# ") for virtfn in virtfns.split(): vf_uevent = self.__send_expect("cat %s" % os.path.join(virtfn, "uevent"), "# ") @@ -243,53 +247,59 @@ class NetDevice(object): return generate_sriov_vfs_linux(bus_id, devfun_id, vf_num) def generate_sriov_vfs_linux_generic(self, bus_id, devfun_id, vf_num): - pci_dev_driver = self.crb.get_pci_dev_driver(bus_id, devfun_id) + pdb.set_trace() + nic_driver = self.get_nic_driver() - if pci_dev_driver: + if not nic_driver: return None vf_reg_file = "sriov_numvfs" - vf_reg_path = os.path.join("/sys/bus/pci/device/0000:%s\:%s" % + vf_reg_path = os.path.join("/sys/bus/pci/devices/0000:%s:%s" % (bus_id, devfun_id), vf_reg_file) self.__send_expect("echo %d > %s" % (int(vf_num), vf_reg_path), "# ") def generate_sriov_vfs_linux_igb_uio(self, bus_id, devfun_id, vf_num): - pci_dev_driver = self.crb.get_pci_dev_driver(bus_id, devfun_id) + nic_driver = self.get_nic_driver() - if pci_dev_driver: + if not nic_driver: return None vf_reg_file = "max_vfs" - vf_reg_path = os.path.join("/sys/bus/pci/device/0000:%s\:%s" % + vf_reg_path = os.path.join("/sys/bus/pci/devices/0000:%s:%s" % (bus_id, devfun_id), vf_reg_file) self.__send_expect("echo %d > %s" % (int(vf_num), vf_reg_path), "# ") def destroy_sriov_vfs(self): - self.generate_sriov_vfs_linux(self.bus_id, self.devfun_id, 0) - - def bind_vf(self, driver='pci-stub'): - bind_vf = getattr(self, 'bind_vf_%s' % self.__get_os_type()) - return bind_vf(driver) - - def bind_vf_linux(self, driver): + self.generate_sriov_vfs(0) + + def bind_driver(self, driver=''): + bind_driver = getattr(self, 'bind_driver_%s' % self.__get_os_type()) + if not driver: + if not self.default_driver: + print "Must specify a driver because default driver is NULL!" + return + driver = self.default_driver + return bind_driver(driver) + + def bind_driver_linux(self, driver): driver_alias = driver.replace('-', '_') try: - bind_vf_linux = getattr(self, 'bind_vf_linux_%s' % driver_alias) - return bind_vf_linux(self.bus_id, self.devfun_id) + bind_driver_linux = getattr(self, 'bind_driver_linux_%s' % driver_alias) + return bind_driver_linux(self.bus_id, self.devfun_id) except Exception,e: driver_alias = 'generic' - bind_vf_linux = getattr(self, 'bind_vf_linux_%s' % driver_alias) - return bind_vf_linux(self.bus_id, self.devfun_id, driver) + bind_driver_linux = getattr(self, 'bind_driver_linux_%s' % driver_alias) + return bind_driver_linux(self.bus_id, self.devfun_id, driver) - def bind_vf_linux_generic(self, bus_id, devfun_id, driver): + def bind_driver_linux_generic(self, bus_id, devfun_id, driver): nic_pci_num = ':'.join(['0000', bus_id, devfun_id]) self.__send_expect("echo %s > /sys/bus/pci/devices/0000\:%s\:%s/driver/unbind" % (nic_pci_num, bus_id, devfun_id), "# ") - self.__send_expect("echo %s > /sys/bus/pci/drivers/pci-stub/bind" % nic_pci_num, "# ") + self.__send_expect("echo %s > /sys/bus/pci/drivers/%s/bind" % (nic_pci_num, driver), "# ") - def bind_vf_linux_pci_stub(self, bus_id, devfun_id): + def bind_driver_linux_pci_stub(self, bus_id, devfun_id): nic_pci_num = ':'.join(['0000', bus_id, devfun_id]) pci_id = self.get_card_type() self.__send_expect("echo %s > /sys/bus/pci/drivers/pci-stub/new_id" % nic_pci_num, "# ") @@ -297,11 +307,21 @@ class NetDevice(object): (nic_pci_num, bus_id, devfun_id), "# ") self.__send_expect("echo %s > /sys/bus/pci/drivers/pci-stub/bind" % nic_pci_num, "# ") - def unbind_vf(self): - unbind_vf = getattr(self, 'unbind_vf_%s' % self.__get_os_type()) - return unbind_vf(self.bus_id, self.devfun_id) + @nic_has_driver + def unbind_driver(self, driver=''): + unbind_driver = getattr(self, 'unbind_driver_%s' % self.__get_os_type()) + if not driver: + driver = 'generic' + return unbind_driver(self.bus_id, self.devfun_id, driver) - def unbind_vf_linux(self, bus_id, devfun_id): + def unbind_driver_linux(self, bus_id, devfun_id, driver): + driver_alias = driver.replace('-', '_') + + unbind_driver_linux = getattr(self, 'unbind_driver_linux_%s' % driver_alias) + return unbind_driver_linux(bus_id, devfun_id) + + def unbind_driver_linux_generic(self, bus_id, devfun_id): nic_pci_num = ':'.join(['0000', bus_id, devfun_id]) - self.__send_expect("echo %s > /sys/bus/pci/driver/unbind" % nic_pci_num, "# ") + self.__send_expect("echo %s > /sys/bus/pci/devices/0000\:%s\:%s/driver/unbind" % + (nic_pci_num, bus_id, devfun_id), "# ") diff --git a/tools/DTF/framework/qemu_kvm.py b/tools/DTF/framework/qemu_kvm.py index 687851f..f405c49 100644 --- a/tools/DTF/framework/qemu_kvm.py +++ b/tools/DTF/framework/qemu_kvm.py @@ -299,21 +299,39 @@ if __name__ == "__main__": dut.set_speedup_options(read_cache, skip_setup) tester.set_speedup_options(read_cache, skip_setup) + dut.dut_prerequisites() + port0 = dut.ports_info[0]['port'] + dut.generate_sriov_vfs_by_port(0, 4) + print "port 0 sriov vfs: ", dut.ports_info[0] + + dut.destroy_sriov_vfs_by_port(0) + + time.sleep(2) + + pdb.set_trace() + port0.unbind_driver() + port0_pci = dut.ports_info[0]['pci'] + # Start VM by the command options virt_proxy = VirtProxy('qemu_kvm', dut) cmd = [('enable-kvm',''), ('cpu','host'), ('drive','file=/home/image/fedora21-try-02.qcow2'), ('net','nic,macaddr=00:00:00:55:00:06'), - ('net', 'tap,script=/etc/qemu-ifup')] + ('net', 'tap,script=/etc/qemu-ifup'), + ('device', 'pci-assign,host=%s' % port0_pci)] vm_name = virt_proxy.virt.start_vm(*cmd) try: print virt_proxy.virt.session.send_expect("ifconfig", '# ') - print virt_proxy.virt.vm_info + print "VM info:", virt_proxy.virt.vm_info vm_dut = virt_proxy.virt.get_vm_dut(vm_name) print vm_dut.session.send_expect('ifconfig', '# ') + print vm_dut.session.send_expect('lspci -nn | grep -i eth', '# ') + + pdb.set_trace() + port0.bind_driver() dut.logger.logger_exit() tester.logger.logger_exit() -- 1.9.3 ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH] fix the net device bugs and add some funcs to generate vfs in net_device 2015-03-19 3:16 ` [dpdk-dev] [PATCH] fix the net device bugs and add some funcs to generate vfs in net_device Yong Liu @ 2015-03-19 3:21 ` Liu, Yong 0 siblings, 0 replies; 12+ messages in thread From: Liu, Yong @ 2015-03-19 3:21 UTC (permalink / raw) To: dev On 3/19/2015 11:17 AM, Yong Liu wrote: Mistook sending, please ignore this patch. > From: sjiajiax <sunx.jiajia@intel.com> > > add some codes to test the vf actions > > diff --git a/tools/DTF/framework/dut.py b/tools/DTF/framework/dut.py > index 02c7639..2b85f23 100644 > --- a/tools/DTF/framework/dut.py > +++ b/tools/DTF/framework/dut.py > @@ -10,7 +10,7 @@ from ssh_connection import SSHConnection > from crb import Crb > from net_device import NetDevice > from logger import getLogger > - > +import pdb > > class Dut(Crb): > > @@ -390,7 +390,8 @@ class Dut(Crb): > > for (pci_bus, pci_id) in self.pci_devices_info: > > - if not dts.accepted_nic(pci_id): > + #if not dts.accepted_nic(pci_id): > + if pci_id == '1106:3119': > self.logger.info("DUT: [000:%s %s] %s" % (pci_bus, pci_id, > skipped)) > continue > @@ -488,25 +489,31 @@ class Dut(Crb): > """ > Generate SRIOV VFs with default driver it is bound now or specifid driver. > """ > - pci_bus = self.port_info[port_id]['pci'] > - port = self.port_info[port_id]['port'] > - > - bus_id = pci_bus.split(':')[0] > - devfun_id = pci_bus.split(':')[1] > - port_driver = self.get_dev_driver(bus_id, devfun_id) > + port = self.ports_info[port_id]['port'] > + port_driver = port.get_nic_driver() > > if driver == 'default': > - if not port_dirver: > + if not port_driver: > self.logger.info("No driver on specified port, can not generate SRIOV VF.") > return None > else: > if port_driver != driver: > - self.bind_interfaces_linux(driver, pci_bus) > + port.bind_driver(driver) > port.generate_sriov_vfs(vf_num) > > - sriov_vfs_pci = port.get_sriov_vfs_pci(bus_id, devfun_id) > + sriov_vfs_pci = port.get_sriov_vfs_pci() > self.ports_info[port_id]['sriov_vfs_pci'] = sriov_vfs_pci > > + def destroy_sriov_vfs_by_port(self, port_id): > + port = self.ports_info[port_id]['port'] > + port_driver = port.get_nic_driver() > + > + if not port_driver: > + self.logger.info("No driver on specified port, skip destroy SRIOV VF.") > + else: > + sriov_vfs_pci = port.destroy_sriov_vfs() > + self.ports_info[port_id]['sriov_vfs_pci'] = '' > + > def get_vm_core_list(self): > return VMCORELIST[self.crb['VM CoreList']] > > diff --git a/tools/DTF/framework/net_device.py b/tools/DTF/framework/net_device.py > index 9186ad6..1a99f68 100644 > --- a/tools/DTF/framework/net_device.py > +++ b/tools/DTF/framework/net_device.py > @@ -1,3 +1,5 @@ > +import os > +import re > from functools import wraps > import pdb > > @@ -12,19 +14,21 @@ class NetDevice(object): > self.crb = crb > self.bus_id = bus_id > self.devfun_id = devfun_id > + self.default_driver = self.get_nic_driver() > self.intf_name = self.get_interface_name() > > def __send_expect(self, cmds, expected, timeout=TIMEOUT, alt_session=False): > return self.crb.send_expect(cmds, expected, timeout=TIMEOUT, alt_session=False) > > def __get_os_type(self): > - return self.crb.__get_os_type() > + return self.crb.get_os_type() > > def nic_has_driver(func): > @wraps(func) > - def wrapper(self, *args, **kwargs): > - self.current_driver = self.get_nic_driver() > - if not self.current_driver: > + def wrapper(*args, **kwargs): > + nic_instance = args[0] > + nic_instance.current_driver = nic_instance.get_nic_driver() > + if not nic_instance.current_driver: > return '' > return func(*args, **kwargs) > return wrapper > @@ -201,17 +205,17 @@ class NetDevice(object): > generic_driver = 'generic' > get_sriov_vfs_pci_linux = getattr(self, 'get_sriov_vfs_pci_linux_%s' % generic_driver) > > - return get_sriov_vfs_pci_linux(intf, bus_id, devfun_id) > + return get_sriov_vfs_pci_linux(bus_id, devfun_id) > > def get_sriov_vfs_pci_linux_generic(self, bus_id, devfun_id): > sriov_numvfs = self.__send_expect("cat /sys/bus/pci/devices/0000\:%s\:%s/sriov_numvfs" % > (bus_id, devfun_id), "# ") > sriov_vfs_pci = [] > - if sriov_numvfs == 0: > + if int(sriov_numvfs) == 0: > pass > else: > try: > - virtfns = self.send_exepct("ls -d /sys/bus/pci/devices/0000\:%s\:%s/virtfn*" % > + virtfns = self.__send_expect("ls -d /sys/bus/pci/devices/0000\:%s\:%s/virtfn*" % > (bus_id, devfun_id), "# ") > for virtfn in virtfns.split(): > vf_uevent = self.__send_expect("cat %s" % os.path.join(virtfn, "uevent"), "# ") > @@ -243,53 +247,59 @@ class NetDevice(object): > return generate_sriov_vfs_linux(bus_id, devfun_id, vf_num) > > def generate_sriov_vfs_linux_generic(self, bus_id, devfun_id, vf_num): > - pci_dev_driver = self.crb.get_pci_dev_driver(bus_id, devfun_id) > + pdb.set_trace() > + nic_driver = self.get_nic_driver() > > - if pci_dev_driver: > + if not nic_driver: > return None > > vf_reg_file = "sriov_numvfs" > - vf_reg_path = os.path.join("/sys/bus/pci/device/0000:%s\:%s" % > + vf_reg_path = os.path.join("/sys/bus/pci/devices/0000:%s:%s" % > (bus_id, devfun_id), vf_reg_file) > self.__send_expect("echo %d > %s" % > (int(vf_num), vf_reg_path), "# ") > > def generate_sriov_vfs_linux_igb_uio(self, bus_id, devfun_id, vf_num): > - pci_dev_driver = self.crb.get_pci_dev_driver(bus_id, devfun_id) > + nic_driver = self.get_nic_driver() > > - if pci_dev_driver: > + if not nic_driver: > return None > > vf_reg_file = "max_vfs" > - vf_reg_path = os.path.join("/sys/bus/pci/device/0000:%s\:%s" % > + vf_reg_path = os.path.join("/sys/bus/pci/devices/0000:%s:%s" % > (bus_id, devfun_id), vf_reg_file) > self.__send_expect("echo %d > %s" % > (int(vf_num), vf_reg_path), "# ") > > def destroy_sriov_vfs(self): > - self.generate_sriov_vfs_linux(self.bus_id, self.devfun_id, 0) > - > - def bind_vf(self, driver='pci-stub'): > - bind_vf = getattr(self, 'bind_vf_%s' % self.__get_os_type()) > - return bind_vf(driver) > - > - def bind_vf_linux(self, driver): > + self.generate_sriov_vfs(0) > + > + def bind_driver(self, driver=''): > + bind_driver = getattr(self, 'bind_driver_%s' % self.__get_os_type()) > + if not driver: > + if not self.default_driver: > + print "Must specify a driver because default driver is NULL!" > + return > + driver = self.default_driver > + return bind_driver(driver) > + > + def bind_driver_linux(self, driver): > driver_alias = driver.replace('-', '_') > try: > - bind_vf_linux = getattr(self, 'bind_vf_linux_%s' % driver_alias) > - return bind_vf_linux(self.bus_id, self.devfun_id) > + bind_driver_linux = getattr(self, 'bind_driver_linux_%s' % driver_alias) > + return bind_driver_linux(self.bus_id, self.devfun_id) > except Exception,e: > driver_alias = 'generic' > - bind_vf_linux = getattr(self, 'bind_vf_linux_%s' % driver_alias) > - return bind_vf_linux(self.bus_id, self.devfun_id, driver) > + bind_driver_linux = getattr(self, 'bind_driver_linux_%s' % driver_alias) > + return bind_driver_linux(self.bus_id, self.devfun_id, driver) > > - def bind_vf_linux_generic(self, bus_id, devfun_id, driver): > + def bind_driver_linux_generic(self, bus_id, devfun_id, driver): > nic_pci_num = ':'.join(['0000', bus_id, devfun_id]) > self.__send_expect("echo %s > /sys/bus/pci/devices/0000\:%s\:%s/driver/unbind" % > (nic_pci_num, bus_id, devfun_id), "# ") > - self.__send_expect("echo %s > /sys/bus/pci/drivers/pci-stub/bind" % nic_pci_num, "# ") > + self.__send_expect("echo %s > /sys/bus/pci/drivers/%s/bind" % (nic_pci_num, driver), "# ") > > - def bind_vf_linux_pci_stub(self, bus_id, devfun_id): > + def bind_driver_linux_pci_stub(self, bus_id, devfun_id): > nic_pci_num = ':'.join(['0000', bus_id, devfun_id]) > pci_id = self.get_card_type() > self.__send_expect("echo %s > /sys/bus/pci/drivers/pci-stub/new_id" % nic_pci_num, "# ") > @@ -297,11 +307,21 @@ class NetDevice(object): > (nic_pci_num, bus_id, devfun_id), "# ") > self.__send_expect("echo %s > /sys/bus/pci/drivers/pci-stub/bind" % nic_pci_num, "# ") > > - def unbind_vf(self): > - unbind_vf = getattr(self, 'unbind_vf_%s' % self.__get_os_type()) > - return unbind_vf(self.bus_id, self.devfun_id) > + @nic_has_driver > + def unbind_driver(self, driver=''): > + unbind_driver = getattr(self, 'unbind_driver_%s' % self.__get_os_type()) > + if not driver: > + driver = 'generic' > + return unbind_driver(self.bus_id, self.devfun_id, driver) > > - def unbind_vf_linux(self, bus_id, devfun_id): > + def unbind_driver_linux(self, bus_id, devfun_id, driver): > + driver_alias = driver.replace('-', '_') > + > + unbind_driver_linux = getattr(self, 'unbind_driver_linux_%s' % driver_alias) > + return unbind_driver_linux(bus_id, devfun_id) > + > + def unbind_driver_linux_generic(self, bus_id, devfun_id): > nic_pci_num = ':'.join(['0000', bus_id, devfun_id]) > - self.__send_expect("echo %s > /sys/bus/pci/driver/unbind" % nic_pci_num, "# ") > + self.__send_expect("echo %s > /sys/bus/pci/devices/0000\:%s\:%s/driver/unbind" % > + (nic_pci_num, bus_id, devfun_id), "# ") > > diff --git a/tools/DTF/framework/qemu_kvm.py b/tools/DTF/framework/qemu_kvm.py > index 687851f..f405c49 100644 > --- a/tools/DTF/framework/qemu_kvm.py > +++ b/tools/DTF/framework/qemu_kvm.py > @@ -299,21 +299,39 @@ if __name__ == "__main__": > dut.set_speedup_options(read_cache, skip_setup) > tester.set_speedup_options(read_cache, skip_setup) > > + dut.dut_prerequisites() > + port0 = dut.ports_info[0]['port'] > + dut.generate_sriov_vfs_by_port(0, 4) > + print "port 0 sriov vfs: ", dut.ports_info[0] > + > + dut.destroy_sriov_vfs_by_port(0) > + > + time.sleep(2) > + > + pdb.set_trace() > + port0.unbind_driver() > + port0_pci = dut.ports_info[0]['pci'] > + > # Start VM by the command options > virt_proxy = VirtProxy('qemu_kvm', dut) > cmd = [('enable-kvm',''), > ('cpu','host'), > ('drive','file=/home/image/fedora21-try-02.qcow2'), > ('net','nic,macaddr=00:00:00:55:00:06'), > - ('net', 'tap,script=/etc/qemu-ifup')] > + ('net', 'tap,script=/etc/qemu-ifup'), > + ('device', 'pci-assign,host=%s' % port0_pci)] > vm_name = virt_proxy.virt.start_vm(*cmd) > > try: > print virt_proxy.virt.session.send_expect("ifconfig", '# ') > - print virt_proxy.virt.vm_info > + print "VM info:", virt_proxy.virt.vm_info > > vm_dut = virt_proxy.virt.get_vm_dut(vm_name) > print vm_dut.session.send_expect('ifconfig', '# ') > + print vm_dut.session.send_expect('lspci -nn | grep -i eth', '# ') > + > + pdb.set_trace() > + port0.bind_driver() > > dut.logger.logger_exit() > tester.logger.logger_exit() ^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH 2/6] fix fm10k driver build error when gcc version elder than 4.4 2015-03-19 3:16 [dpdk-dev] [PATCH 0/6] fix build warnings and errors in SUSE11 SP3 Yong Liu ` (2 preceding siblings ...) 2015-03-19 3:16 ` [dpdk-dev] [PATCH] fix the net device bugs and add some funcs to generate vfs in net_device Yong Liu @ 2015-03-19 3:16 ` Yong Liu 2015-03-19 3:16 ` [dpdk-dev] [PATCH 3/6] fix build error when initialized structure in enic driver Yong Liu ` (4 subsequent siblings) 8 siblings, 0 replies; 12+ messages in thread From: Yong Liu @ 2015-03-19 3:16 UTC (permalink / raw) To: dev From: Marvin Liu <yong.liu@intel.com> Build fm10k driver in Suse11 SP3 will be failed for unrecognized flag. cc1: error: unrecognized command line option "-Wno-unused-but-set-variable" This flag is supported from gcc 4.4, so add gcc version check in fm10k. In the same time, make option check more clear in ixgbe driver. Signed-off-by: Marvin Liu <yong.liu@intel.com> diff --git a/lib/librte_pmd_fm10k/Makefile b/lib/librte_pmd_fm10k/Makefile index 998bf23..7516d37 100644 --- a/lib/librte_pmd_fm10k/Makefile +++ b/lib/librte_pmd_fm10k/Makefile @@ -62,13 +62,15 @@ else # # CFLAGS for gcc # -ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1) -CFLAGS += -Wno-deprecated -endif CFLAGS_BASE_DRIVER = -Wno-unused-parameter -Wno-unused-value CFLAGS_BASE_DRIVER += -Wno-strict-aliasing -Wno-format-extra-args -CFLAGS_BASE_DRIVER += -Wno-unused-variable -Wno-unused-but-set-variable +CFLAGS_BASE_DRIVER += -Wno-unused-variable CFLAGS_BASE_DRIVER += -Wno-missing-field-initializers + +ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1) +CFLAGS += -Wno-deprecated +CFLAGS_BASE_DRIVER += -Wno-unused-but-set-variable +endif endif # diff --git a/lib/librte_pmd_ixgbe/Makefile b/lib/librte_pmd_ixgbe/Makefile index 9a5cd33..ae36202 100644 --- a/lib/librte_pmd_ixgbe/Makefile +++ b/lib/librte_pmd_ixgbe/Makefile @@ -62,13 +62,14 @@ else # ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1) CFLAGS += -Wno-deprecated +CFLAGS_ixgbe_common.o += -Wno-unused-but-set-variable +CFLAGS_ixgbe_x550.o += -Wno-unused-but-set-variable endif CFLAGS_BASE_DRIVER = -Wno-unused-parameter -Wno-unused-value CFLAGS_BASE_DRIVER += -Wno-strict-aliasing -Wno-format-extra-args ifeq ($(shell test $(GCC_VERSION) -ge 46 && echo 1), 1) -CFLAGS_ixgbe_common.o += -Wno-unused-but-set-variable -CFLAGS_ixgbe_x550.o += -Wno-unused-but-set-variable -Wno-maybe-uninitialized +CFLAGS_ixgbe_x550.o += -Wno-maybe-uninitialized endif ifeq ($(shell test $(GCC_VERSION) -ge 50 && echo 1), 1) -- 1.9.3 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH 3/6] fix build error when initialized structure in enic driver 2015-03-19 3:16 [dpdk-dev] [PATCH 0/6] fix build warnings and errors in SUSE11 SP3 Yong Liu ` (3 preceding siblings ...) 2015-03-19 3:16 ` [dpdk-dev] [PATCH 2/6] fix fm10k driver build error when gcc version elder than 4.4 Yong Liu @ 2015-03-19 3:16 ` Yong Liu 2015-03-19 3:16 ` [dpdk-dev] [PATCH 4/6] fix build error in app/test with gcc4.3 Yong Liu ` (3 subsequent siblings) 8 siblings, 0 replies; 12+ messages in thread From: Yong Liu @ 2015-03-19 3:16 UTC (permalink / raw) To: dev From: Marvin Liu <yong.liu@intel.com> gcc4.3 will raise warnings in blow code for initialized field overwritten. enic_main.c: In function ‘enic_set_rsskey’: enic_main.c:845: error: initialized field overwritten enic_main.c:845: error: (near initialization for ‘rss_key.key’) enic_main.c:846: error: initialized field overwritten enic_main.c:846: error: (near initialization for ‘rss_key.key’) enic_main.c:847: error: initialized field overwritten enic_main.c:847: error: (near initialization for ‘rss_key.key’) static union vnic_rss_key rss_key = { .key[0] = ..., .key[1] = ..., .key[2] = ..., .key[3] = ..., }; Change struct initialized code reference to ISO 9899 section 6.7.8. gcc4.3 will happy for that. static union vnic_rss_key rss_key = { .key = { [0] = ..., [1] = ..., [2] = ..., [3] = ..., } Signed-off-by: Marvin Liu <yong.liu@intel.com> diff --git a/lib/librte_pmd_enic/enic_main.c b/lib/librte_pmd_enic/enic_main.c index c66f139..0892b3e 100644 --- a/lib/librte_pmd_enic/enic_main.c +++ b/lib/librte_pmd_enic/enic_main.c @@ -840,10 +840,12 @@ static int enic_set_rsskey(struct enic *enic) dma_addr_t rss_key_buf_pa; union vnic_rss_key *rss_key_buf_va = NULL; static union vnic_rss_key rss_key = { - .key[0] = {.b = {85, 67, 83, 97, 119, 101, 115, 111, 109, 101}}, - .key[1] = {.b = {80, 65, 76, 79, 117, 110, 105, 113, 117, 101}}, - .key[2] = {.b = {76, 73, 78, 85, 88, 114, 111, 99, 107, 115}}, - .key[3] = {.b = {69, 78, 73, 67, 105, 115, 99, 111, 111, 108}}, + .key = { + [0] = {.b = {85, 67, 83, 97, 119, 101, 115, 111, 109, 101}}, + [1] = {.b = {80, 65, 76, 79, 117, 110, 105, 113, 117, 101}}, + [2] = {.b = {76, 73, 78, 85, 88, 114, 111, 99, 107, 115}}, + [3] = {.b = {69, 78, 73, 67, 105, 115, 99, 111, 111, 108}}, + } }; int err; u8 name[NAME_MAX]; -- 1.9.3 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH 4/6] fix build error in app/test with gcc4.3 2015-03-19 3:16 [dpdk-dev] [PATCH 0/6] fix build warnings and errors in SUSE11 SP3 Yong Liu ` (4 preceding siblings ...) 2015-03-19 3:16 ` [dpdk-dev] [PATCH 3/6] fix build error when initialized structure in enic driver Yong Liu @ 2015-03-19 3:16 ` Yong Liu 2015-03-19 3:16 ` [dpdk-dev] [PATCH 5/6] " Yong Liu ` (2 subsequent siblings) 8 siblings, 0 replies; 12+ messages in thread From: Yong Liu @ 2015-03-19 3:16 UTC (permalink / raw) To: dev From: Marvin Liu <yong.liu@intel.com> Build app/test will be failed for function only defined but not used. test_prefetch.c:65: error: ‘testfn_prefetch_cmd’ defined but not used Add attribute used in test function declaration can fix this. static void __attribute__((used)) testfn_##t(void); Signed-off-by: Marvin Liu <yong.liu@intel.com> diff --git a/app/test/test.h b/app/test/test.h index 5450986..62eb51d 100644 --- a/app/test/test.h +++ b/app/test/test.h @@ -169,7 +169,7 @@ struct test_command { void add_test_command(struct test_command *t); #define REGISTER_TEST_COMMAND(t) \ -static void testfn_##t(void);\ +static void __attribute__((used)) testfn_##t(void);\ void __attribute__((constructor, used)) testfn_##t(void)\ {\ add_test_command(&t);\ -- 1.9.3 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH 5/6] fix build error in app/test with gcc4.3 2015-03-19 3:16 [dpdk-dev] [PATCH 0/6] fix build warnings and errors in SUSE11 SP3 Yong Liu ` (5 preceding siblings ...) 2015-03-19 3:16 ` [dpdk-dev] [PATCH 4/6] fix build error in app/test with gcc4.3 Yong Liu @ 2015-03-19 3:16 ` Yong Liu 2015-03-19 3:16 ` [dpdk-dev] [PATCH 6/6] fix build error for implicit declaration of function pread Yong Liu 2015-03-22 23:02 ` [dpdk-dev] [PATCH 0/6] fix build warnings and errors in SUSE11 SP3 Thomas Monjalon 8 siblings, 0 replies; 12+ messages in thread From: Yong Liu @ 2015-03-19 3:16 UTC (permalink / raw) To: dev From: Marvin Liu <yong.liu@intel.com> Option var-tracking-assignments supported in gcc from 4.4. Add gcc version check wil fix this issue. error: unrecognized command line option "-fno-var-tracking-assignments" Signed-off-by: Marvin Liu <yong.liu@intel.com> diff --git a/app/test/Makefile b/app/test/Makefile index 9f0262c..4aca77c 100644 --- a/app/test/Makefile +++ b/app/test/Makefile @@ -152,9 +152,11 @@ CFLAGS += -D_GNU_SOURCE # Disable VTA for memcpy test ifeq ($(CC), gcc) +ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1) CFLAGS_test_memcpy.o += -fno-var-tracking-assignments CFLAGS_test_memcpy_perf.o += -fno-var-tracking-assignments endif +endif # this application needs libraries first DEPDIRS-y += lib -- 1.9.3 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH 6/6] fix build error for implicit declaration of function pread 2015-03-19 3:16 [dpdk-dev] [PATCH 0/6] fix build warnings and errors in SUSE11 SP3 Yong Liu ` (6 preceding siblings ...) 2015-03-19 3:16 ` [dpdk-dev] [PATCH 5/6] " Yong Liu @ 2015-03-19 3:16 ` Yong Liu 2015-03-22 23:02 ` [dpdk-dev] [PATCH 0/6] fix build warnings and errors in SUSE11 SP3 Thomas Monjalon 8 siblings, 0 replies; 12+ messages in thread From: Yong Liu @ 2015-03-19 3:16 UTC (permalink / raw) To: dev From: Marvin Liu <yong.liu@intel.com> Function pread need marco _XOPEN_SOURCE be defined. Add _GNU_SOURCE will fix this issue. error: implicit declaration of function ‘pread’ Signed-off-by: Marvin Liu <yong.liu@intel.com> diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile index 23c2d48..21875b8 100644 --- a/lib/librte_eal/linuxapp/eal/Makefile +++ b/lib/librte_eal/linuxapp/eal/Makefile @@ -102,6 +102,8 @@ CFLAGS_eal_pci_vfio.o := -D_GNU_SOURCE CFLAGS_eal_common_whitelist.o := -D_GNU_SOURCE CFLAGS_eal_common_options.o := -D_GNU_SOURCE CFLAGS_eal_common_thread.o := -D_GNU_SOURCE +CFLAGS_eal_pci_uio.o := -D_GNU_SOURCE +CFLAGS_eal_interrupts.o := -D_GNU_SOURCE # workaround for a gcc bug with noreturn attribute # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 -- 1.9.3 ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH 0/6] fix build warnings and errors in SUSE11 SP3 2015-03-19 3:16 [dpdk-dev] [PATCH 0/6] fix build warnings and errors in SUSE11 SP3 Yong Liu ` (7 preceding siblings ...) 2015-03-19 3:16 ` [dpdk-dev] [PATCH 6/6] fix build error for implicit declaration of function pread Yong Liu @ 2015-03-22 23:02 ` Thomas Monjalon 8 siblings, 0 replies; 12+ messages in thread From: Thomas Monjalon @ 2015-03-22 23:02 UTC (permalink / raw) To: Yong Liu; +Cc: dev > From: Marvin Liu <yong.liu@intel.com> > > SUSE11 SP3 default gcc version is 4.3.4. Some options not supported in this > version. This patch set add gcc version check for those options and fix other > build warning in Suse11 SP3. > > Marvin Liu (6): > fix sse3 functions not found with gcc 4.3.4 > fix fm10k driver build error when gcc version elder than 4.4 > fix build error when initialized structure in enic driver > fix build error in app/test with gcc4.3 > fix build error in app/test with gcc4.3 > fix build error for implicit declaration of function pread Applied, thanks ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2015-03-22 23:03 UTC | newest] Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2015-03-19 3:16 [dpdk-dev] [PATCH 0/6] fix build warnings and errors in SUSE11 SP3 Yong Liu 2015-03-19 3:16 ` [dpdk-dev] [PATCH] app/test-pmd: fix incorrect port number check Yong Liu 2015-03-19 8:40 ` Thomas Monjalon 2015-03-19 3:16 ` [dpdk-dev] [PATCH 1/6] fix sse3 functions not found with gcc 4.3.4 Yong Liu 2015-03-19 3:16 ` [dpdk-dev] [PATCH] fix the net device bugs and add some funcs to generate vfs in net_device Yong Liu 2015-03-19 3:21 ` Liu, Yong 2015-03-19 3:16 ` [dpdk-dev] [PATCH 2/6] fix fm10k driver build error when gcc version elder than 4.4 Yong Liu 2015-03-19 3:16 ` [dpdk-dev] [PATCH 3/6] fix build error when initialized structure in enic driver Yong Liu 2015-03-19 3:16 ` [dpdk-dev] [PATCH 4/6] fix build error in app/test with gcc4.3 Yong Liu 2015-03-19 3:16 ` [dpdk-dev] [PATCH 5/6] " Yong Liu 2015-03-19 3:16 ` [dpdk-dev] [PATCH 6/6] fix build error for implicit declaration of function pread Yong Liu 2015-03-22 23:02 ` [dpdk-dev] [PATCH 0/6] fix build warnings and errors in SUSE11 SP3 Thomas Monjalon
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).