From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 82AEC58DD for ; Thu, 27 Mar 2014 21:10:53 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 27 Mar 2014 13:12:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,744,1389772800"; d="scan'208";a="508494123" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga002.fm.intel.com with ESMTP; 27 Mar 2014 13:12:25 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.78]) by IRSMSX103.ger.corp.intel.com ([163.33.3.157]) with mapi id 14.03.0123.003; Thu, 27 Mar 2014 20:12:24 +0000 From: "Carew, Alan" To: Fred Pedrisa , Masaru Oki Thread-Topic: [dpdk-dev] RES: RES: RES: hw.nic_uio.bdfs Thread-Index: Ac9J4abXesRfC0AEQD+2rvDaoxviDA== Date: Thu, 27 Mar 2014 20:12:24 +0000 Message-ID: <0E29434AEE0C3A4180987AB476A6F63045974B0F@IRSMSX105.ger.corp.intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: [dpdk-dev] RES: RES: RES: hw.nic_uio.bdfs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 20:10:54 -0000 Hi folks, Just to clarify, the purpose of hw.nic_uio.bdfs is to remove NICs from driv= ers not owned by nic_uio and add them to a pool of unbound devices. As with the Linux equivalent driver(igb_uio), nic_uio will then attempt to = bind any unbound NICs and make them available for DPDK. However, the Linux OS also has the ability to selectively bind/unbind devic= es via sysfs, this is something we lack on FreeBSD. I can see where it would be a problem when only a subset of unbound devices= is required for nic_uio and currently the only option would be to ensure t= he original driver is loaded first. The change below changes the purpose of hw.nic_uio.bdfs, i.e. blacklist dev= ices so that they are not used by nic_uio. A better approach would be to make the variable an exclusive list of device= s to be used, this would then require all users to specify the exact device= s to be used. Thanks, Alan -----Mensagem original----- De: dev [mailto:dev-bounces at dpdk.org] Em nome de Fred Pedrisa Enviada em: quarta-feira, 26 de mar=E7o de 2014 04:22 Para: 'Masaru Oki' Cc: dev at dpdk.org Assunto: [dpdk-dev] RES: RES: hw.nic_uio.bdfs Hello, Here is my fix for probe code : static int nic_uio_probe (device_t dev) { int i, len; char *remaining; long bus =3D 0, device =3D 0, function =3D 0; remaining =3D bdf_str; len =3D strlen(remaining); for (i =3D 0; remaining && len >=3D 5 && i < len;i+=3D6) { if ( remaining[i + 1] =3D=3D ':' && remaining[i + 3] =3D=3D= ':' ) { bus =3D strtol(&remaining[i + 0],NULL,0); device =3D strtol(&remaining[i + 2],NULL,0); function =3D strtol(&remaining[i + 4],NULL,0); if (dev !=3D NULL) { if (pci_get_bus(dev) =3D=3D bus && pci_get_slot(dev) =3D=3D device && pci_get_function(dev) =3D=3D function) { printf("nic_uio: success blocking probe of : %ld:%ld:%ld!\n", bus, device, function); return (ENXIO); } } } } for (i =3D 0; i < NUM_DEVICES; i++) if (pci_get_vendor(dev) =3D=3D devices[i].vend && pci_get_device(dev) =3D=3D devices[i].dev) { device_set_desc(dev, "Intel(R) DPDK PCI Device"); return (BUS_PROBE_SPECIFIC); } return (ENXIO); } Now it is working as intended ;) -----Mensagem original----- De: dev [mailto:dev-bounces at dpdk.org] Em nome de Fred Pedrisa Enviada em= : quarta-feira, 26 de mar=E7o de 2014 04:16 Para: 'Masaru Oki' Cc: dev at dpdk.org Assunto: [dpdk-dev] RES: hw.nic_uio.bdfs Hello, =20 Yes, I am writing a fix for this too ;) =20 De: Masaru Oki [mailto:m-oki at stratosphere.co.jp] Enviada em: quarta-feir= a, 26 de mar=E7o de 2014 04:08 Para: Fred Pedrisa Cc: dev at dpdk.org Assunto: Re: [dpdk-dev] hw.nic_uio.bdfs =20 > By default nic_uio takes all the NICs for itself Yes. I think nic_uio_probe should check hw.nic_uio.bdfs. =20 =20 2014-03-26 15:49 GMT+09:00 Fred Pedrisa : Hello, =20 By default nic_uio takes all the NICs for itself =20 So in theory, you needed an option to reserve some NIC ports to your system= , without DPDK taking it for itself =20 De: Masaru Oki [mailto:m-oki at stratosphere.co.jp] Enviada em: quarta-feir= a, 26 de mar=E7o de 2014 03:43 Para: Fred Pedrisa Cc: dev at dpdk.org Assunto: Re: [dpdk-dev] hw.nic_uio.bdfs =20 avoid??? want you hw.nic_uio.avoid_bdfs? nic_uio behavior I guessed 1. detach kernel driver specified by hw.nic_uio.bdfs 2. attach nic_uio driver for all NICs not attached. but 2. is not correct, I think. =20 =20 2014-03-26 15:20 GMT+09:00 Fred Pedrisa : Hello, =20 You did not understand the purpose of that parameter, it is made to 'avoid' nic_uio from pursuing the wanted NICs... so they are free to be used in the system :) =20 Right now the code to handle it is wrong and I am trying to fix it myself. =20 De: Masaru Oki [mailto:m-oki at stratosphere.co.jp] Enviada em: quarta-feir= a, 26 de mar=E7o de 2014 03:16 Para: Fred Pedrisa Cc: dev at dpdk.org Assunto: Re: [dpdk-dev] hw.nic_uio.bdfs =20 Hi, I tried with Intel version 1.6.0 and FreeBSD 9.2-RELEASE on VMware Player. kldload nic_uio by hand, works fine. But kldunload nic_uio only detach uio driver, don't re-attach kernel driver= . [oki@ ~]$ cat /boot/loader.conf ############################################################## ### User settings ########################################## ############################################################## hw.contigmem.num_buffers=3D64 hw.contigmem.buffer_size=3D2097152 hw.nic_uio.bdfs=3D"2:5:0,2:6:0" contigmem_load=3D"YES" #nic_uio_load=3D"YES" [oki@ ~]$ pciconf -l | egrep '(em|uio)' em0 at pci0:2:1:0: class=3D0x020000 card=3D0x075015ad chip=3D0x100f8086 rev= =3D0x01 hdr=3D0x00 em1 at pci0:2:5:0: class=3D0x020000 card=3D0x075015ad chip=3D0x100f8086 rev= =3D0x01 hdr=3D0x00 em2 at pci0:2:6:0: class=3D0x020000 card=3D0x075015ad chip=3D0x100f8086 rev= =3D0x01 hdr=3D0x00 [oki@ ~]$ kenv hw.nic_uio.bdfs 2:5:0,2:6:0 [oki@ ~]$ sudo kldload nic_uio Password: [oki@ ~]$ pciconf -l | egrep '(em|uio)' em0 at pci0:2:1:0: class=3D0x020000 card=3D0x075015ad chip=3D0x100f8086 rev= =3D0x01 hdr=3D0x00 nic_uio0 at pci0:2:5:0: class=3D0x020000 card=3D0x075015ad chip=3D0x100f= 8086 rev=3D0x01 hdr=3D0x00 nic_uio1 at pci0:2:6:0: class=3D0x020000 card=3D0x075015ad chip=3D0x100f= 8086 rev=3D0x01 hdr=3D0x00 [oki@ ~]$ sudo kldunload nic_uio [oki@ ~]$ pciconf -l | egrep '(em|uio)' em0 at pci0:2:1:0: class=3D0x020000 card=3D0x075015ad chip=3D0x100f8086 rev= =3D0x01 hdr=3D0x00 [oki@ ~]$ =20 2014-03-26 14:35 GMT+09:00 Fred Pedrisa : Hi, guys. This variable is not working as intended for FreeBSD :( It does not dettach nic_uio from the wanted ports :/ =20 =20