From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from col0-omc4-s10.col0.hotmail.com (col0-omc4-s10.col0.hotmail.com [65.55.34.212]) by dpdk.org (Postfix) with ESMTP id A00C3159 for ; Wed, 26 Mar 2014 07:50:45 +0100 (CET) Received: from COL131-DS4 ([65.55.34.200]) by col0-omc4-s10.col0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 25 Mar 2014 23:52:18 -0700 X-TMN: [CUbVb5Ip/a1u8C1WJ9aNIYxksQYhbOTsUbPaUXQV/W4=] X-Originating-Email: [fredhps10@hotmail.com] Message-ID: From: Fred Pedrisa To: "'Masaru Oki'" References: <013601cf48bb$0e1ed6a0$2a5c83e0$@stratosphere.co.jp> <014d01cf48be$f02c3990$d084acb0$@stratosphere.co.jp> In-Reply-To: Date: Wed, 26 Mar 2014 03:52:20 -0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQG/TVETtHc+UFVuHufnbeKlbk8MRgK66QhPAPMbOfYCIb+sDQGizwQNmtdQVlA= Content-Language: pt-br X-OriginalArrivalTime: 26 Mar 2014 06:52:18.0152 (UTC) FILETIME=[EDBC2E80:01CF48BF] Cc: dev@dpdk.org Subject: [dpdk-dev] 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: Wed, 26 Mar 2014 06:50:46 -0000 Hello, Anyways, here is my proposition for this code : static void nic_uio_load(void) { char *remaining; long bus =3D 0, device =3D 0, function =3D 0; char bdf_str[1024]; int i, j, len; device_t dev; memset(bdf_str, 0, sizeof(bdf_str)); TUNABLE_STR_FETCH("hw.nic_uio.bdfs", bdf_str, sizeof(bdf_str)); 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); dev =3D pci_find_bsf(bus, device, function); if (dev !=3D NULL) { for (j =3D 0; j < NUM_DEVICES; j++) { if (pci_get_vendor(dev) =3D=3D devices[j].vend && pci_get_device(dev) =3D=3D devices[j].dev) { = device_detach(dev); } } } } } } I think it looks better this way. -----Mensagem original----- De: dev [mailto:dev-bounces@dpdk.org] Em nome de Fred Pedrisa Enviada em: quarta-feira, 26 de mar=E7o de 2014 03:50 Para: 'Masaru Oki' Cc: dev@dpdk.org Assunto: [dpdk-dev] RES: hw.nic_uio.bdfs Hello, =20 By default nic_uio takes all the NICs for itself=85 =20 So in theory, you needed an option to reserve some NIC ports to your = system, without DPDK taking it for itself=85 =20 De: Masaru Oki [mailto:m-oki@stratosphere.co.jp] Enviada em: = quarta-feira, 26 de mar=E7o de 2014 03:43 Para: Fred Pedrisa Cc: dev@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 = =91avoid=92 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@stratosphere.co.jp] Enviada em: = quarta-feira, 26 de mar=E7o de 2014 03:16 Para: Fred Pedrisa Cc: dev@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@pci0:2:1:0: class=3D0x020000 card=3D0x075015ad chip=3D0x100f8086 = rev=3D0x01 hdr=3D0x00 em1@pci0:2:5:0: class=3D0x020000 card=3D0x075015ad chip=3D0x100f8086 = rev=3D0x01 hdr=3D0x00 em2@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@pci0:2:1:0: class=3D0x020000 card=3D0x075015ad chip=3D0x100f8086 = rev=3D0x01 hdr=3D0x00 nic_uio0@pci0:2:5:0: class=3D0x020000 card=3D0x075015ad = chip=3D0x100f8086 rev=3D0x01 hdr=3D0x00 nic_uio1@pci0:2:6:0: class=3D0x020000 card=3D0x075015ad = chip=3D0x100f8086 rev=3D0x01 hdr=3D0x00 [oki@ ~]$ sudo kldunload nic_uio [oki@ ~]$ pciconf -l | egrep '(em|uio)' em0@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