DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] hw.nic_uio.bdfs
@ 2014-03-26  5:35 Fred Pedrisa
  2014-03-26  6:15 ` Masaru Oki
       [not found] ` <013601cf48bb$0e1ed6a0$2a5c83e0$@stratosphere.co.jp>
  0 siblings, 2 replies; 11+ messages in thread
From: Fred Pedrisa @ 2014-03-26  5:35 UTC (permalink / raw)
  To: dev

Hi, guys.

 

This variable is not working as intended for FreeBSD :(

 

It does not dettach nic_uio from the wanted ports :/

 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] hw.nic_uio.bdfs
  2014-03-26  5:35 [dpdk-dev] hw.nic_uio.bdfs Fred Pedrisa
@ 2014-03-26  6:15 ` Masaru Oki
       [not found] ` <013601cf48bb$0e1ed6a0$2a5c83e0$@stratosphere.co.jp>
  1 sibling, 0 replies; 11+ messages in thread
From: Masaru Oki @ 2014-03-26  6:15 UTC (permalink / raw)
  To: Fred Pedrisa; +Cc: dev

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=64
hw.contigmem.buffer_size=2097152
hw.nic_uio.bdfs="2:5:0,2:6:0"
contigmem_load="YES"
#nic_uio_load="YES"
[oki@ ~]$ pciconf -l | egrep '(em|uio)'
em0@pci0:2:1:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
em1@pci0:2:5:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
em2@pci0:2:6:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
[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=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
nic_uio0@pci0:2:5:0:    class=0x020000 card=0x075015ad chip=0x100f8086
rev=0x01 hdr=0x00
nic_uio1@pci0:2:6:0:    class=0x020000 card=0x075015ad chip=0x100f8086
rev=0x01 hdr=0x00
[oki@ ~]$ sudo kldunload nic_uio
[oki@ ~]$ pciconf -l | egrep '(em|uio)'
em0@pci0:2:1:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
[oki@ ~]$



2014-03-26 14:35 GMT+09:00 Fred Pedrisa <fredhps10@hotmail.com>:

> Hi, guys.
>
>
>
> This variable is not working as intended for FreeBSD :(
>
>
>
> It does not dettach nic_uio from the wanted ports :/
>
>
>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [dpdk-dev] RES:  hw.nic_uio.bdfs
       [not found] ` <013601cf48bb$0e1ed6a0$2a5c83e0$@stratosphere.co.jp>
@ 2014-03-26  6:20   ` Fred Pedrisa
  2014-03-26  6:42     ` [dpdk-dev] hw.nic_uio.bdfs Masaru Oki
       [not found]     ` <014d01cf48be$f02c3990$d084acb0$@stratosphere.co.jp>
  0 siblings, 2 replies; 11+ messages in thread
From: Fred Pedrisa @ 2014-03-26  6:20 UTC (permalink / raw)
  To: 'Masaru Oki'; +Cc: dev

Hello,

 

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 :)

 

Right now the code to handle it is wrong and I am trying to fix it myself.

 

De: Masaru Oki [mailto:m-oki@stratosphere.co.jp] 
Enviada em: quarta-feira, 26 de março de 2014 03:16
Para: Fred Pedrisa
Cc: dev@dpdk.org
Assunto: Re: [dpdk-dev] hw.nic_uio.bdfs

 

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=64
hw.contigmem.buffer_size=2097152
hw.nic_uio.bdfs="2:5:0,2:6:0"
contigmem_load="YES"
#nic_uio_load="YES"
[oki@ ~]$ pciconf -l | egrep '(em|uio)'
em0@pci0:2:1:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
em1@pci0:2:5:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
em2@pci0:2:6:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
[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=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
nic_uio0@pci0:2:5:0:    class=0x020000 card=0x075015ad chip=0x100f8086
rev=0x01 hdr=0x00
nic_uio1@pci0:2:6:0:    class=0x020000 card=0x075015ad chip=0x100f8086
rev=0x01 hdr=0x00
[oki@ ~]$ sudo kldunload nic_uio
[oki@ ~]$ pciconf -l | egrep '(em|uio)'
em0@pci0:2:1:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
[oki@ ~]$

 

2014-03-26 14:35 GMT+09:00 Fred Pedrisa <fredhps10@hotmail.com>:

Hi, guys.



This variable is not working as intended for FreeBSD :(



It does not dettach nic_uio from the wanted ports :/




 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] hw.nic_uio.bdfs
  2014-03-26  6:20   ` [dpdk-dev] RES: hw.nic_uio.bdfs Fred Pedrisa
@ 2014-03-26  6:42     ` Masaru Oki
       [not found]     ` <014d01cf48be$f02c3990$d084acb0$@stratosphere.co.jp>
  1 sibling, 0 replies; 11+ messages in thread
From: Masaru Oki @ 2014-03-26  6:42 UTC (permalink / raw)
  To: Fred Pedrisa; +Cc: dev

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.



2014-03-26 15:20 GMT+09:00 Fred Pedrisa <fredhps10@hotmail.com>:

> Hello,
>
>
>
> 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 :)
>
>
>
> Right now the code to handle it is wrong and I am trying to fix it myself.
>
>
>
> *De:* Masaru Oki [mailto:m-oki@stratosphere.co.jp]
> *Enviada em:* quarta-feira, 26 de março de 2014 03:16
> *Para:* Fred Pedrisa
> *Cc:* dev@dpdk.org
> *Assunto:* Re: [dpdk-dev] hw.nic_uio.bdfs
>
>
>
> 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=64
> hw.contigmem.buffer_size=2097152
> hw.nic_uio.bdfs="2:5:0,2:6:0"
> contigmem_load="YES"
> #nic_uio_load="YES"
> [oki@ ~]$ pciconf -l | egrep '(em|uio)'
> em0@pci0:2:1:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
> hdr=0x00
> em1@pci0:2:5:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
> hdr=0x00
> em2@pci0:2:6:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
> hdr=0x00
> [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=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
> hdr=0x00
> nic_uio0@pci0:2:5:0:    class=0x020000 card=0x075015ad chip=0x100f8086
> rev=0x01 hdr=0x00
> nic_uio1@pci0:2:6:0:    class=0x020000 card=0x075015ad chip=0x100f8086
> rev=0x01 hdr=0x00
> [oki@ ~]$ sudo kldunload nic_uio
> [oki@ ~]$ pciconf -l | egrep '(em|uio)'
> em0@pci0:2:1:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
> hdr=0x00
> [oki@ ~]$
>
>
>
> 2014-03-26 14:35 GMT+09:00 Fred Pedrisa <fredhps10@hotmail.com>:
>
> Hi, guys.
>
>
>
>
> This variable is not working as intended for FreeBSD :(
>
>
>
> It does not dettach nic_uio from the wanted ports :/
>
>
>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [dpdk-dev] RES:  hw.nic_uio.bdfs
       [not found]     ` <014d01cf48be$f02c3990$d084acb0$@stratosphere.co.jp>
@ 2014-03-26  6:49       ` Fred Pedrisa
  2014-03-26  6:52         ` [dpdk-dev] RES: " Fred Pedrisa
                           ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Fred Pedrisa @ 2014-03-26  6:49 UTC (permalink / raw)
  To: 'Masaru Oki'; +Cc: dev

Hello,

 

By default nic_uio takes all the NICs for itself…

 

So in theory, you needed an option to reserve some NIC ports to your system,
without DPDK taking it for itself…

 

De: Masaru Oki [mailto:m-oki@stratosphere.co.jp] 
Enviada em: quarta-feira, 26 de março de 2014 03:43
Para: Fred Pedrisa
Cc: dev@dpdk.org
Assunto: Re: [dpdk-dev] hw.nic_uio.bdfs

 

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.

 

 

2014-03-26 15:20 GMT+09:00 Fred Pedrisa <fredhps10@hotmail.com>:

Hello,

 

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 :)

 

Right now the code to handle it is wrong and I am trying to fix it myself.

 

De: Masaru Oki [mailto:m-oki@stratosphere.co.jp] 
Enviada em: quarta-feira, 26 de março de 2014 03:16
Para: Fred Pedrisa
Cc: dev@dpdk.org
Assunto: Re: [dpdk-dev] hw.nic_uio.bdfs

 

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=64
hw.contigmem.buffer_size=2097152
hw.nic_uio.bdfs="2:5:0,2:6:0"
contigmem_load="YES"
#nic_uio_load="YES"
[oki@ ~]$ pciconf -l | egrep '(em|uio)'
em0@pci0:2:1:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
em1@pci0:2:5:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
em2@pci0:2:6:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
[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=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
nic_uio0@pci0:2:5:0:    class=0x020000 card=0x075015ad chip=0x100f8086
rev=0x01 hdr=0x00
nic_uio1@pci0:2:6:0:    class=0x020000 card=0x075015ad chip=0x100f8086
rev=0x01 hdr=0x00
[oki@ ~]$ sudo kldunload nic_uio
[oki@ ~]$ pciconf -l | egrep '(em|uio)'
em0@pci0:2:1:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
[oki@ ~]$

 

2014-03-26 14:35 GMT+09:00 Fred Pedrisa <fredhps10@hotmail.com>:

Hi, guys.





This variable is not working as intended for FreeBSD :(



It does not dettach nic_uio from the wanted ports :/



 

 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [dpdk-dev] RES:  RES:  hw.nic_uio.bdfs
  2014-03-26  6:49       ` [dpdk-dev] RES: hw.nic_uio.bdfs Fred Pedrisa
@ 2014-03-26  6:52         ` Fred Pedrisa
  2014-03-26  7:07         ` [dpdk-dev] hw.nic_uio.bdfs Masaru Oki
       [not found]         ` <016201cf48c2$59f0ead0$0dd2c070$@stratosphere.co.jp>
  2 siblings, 0 replies; 11+ messages in thread
From: Fred Pedrisa @ 2014-03-26  6:52 UTC (permalink / raw)
  To: 'Masaru Oki'; +Cc: dev

Hello,

Anyways, here is my proposition for this code :

static void
nic_uio_load(void)
{
        char *remaining;
        long bus = 0, device = 0, function = 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 = bdf_str;
        len = strlen(remaining);

        for (i = 0; remaining && len >= 5 && i < len;i+=6) {
                if ( remaining[i + 1] == ':' && remaining[i + 3] == ':' ) {
                        bus = strtol(&remaining[i + 0],NULL,0);
                        device = strtol(&remaining[i + 2],NULL,0);
                        function = strtol(&remaining[i + 4],NULL,0);

                        dev = pci_find_bsf(bus, device, function);
                        if (dev != NULL) {
                                for (j = 0; j < NUM_DEVICES; j++) {
                                        if (pci_get_vendor(dev) ==
devices[j].vend && pci_get_device(dev) == 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ço de 2014 03:50
Para: 'Masaru Oki'
Cc: dev@dpdk.org
Assunto: [dpdk-dev] RES: hw.nic_uio.bdfs

Hello,

 

By default nic_uio takes all the NICs for itself…

 

So in theory, you needed an option to reserve some NIC ports to your system,
without DPDK taking it for itself…

 

De: Masaru Oki [mailto:m-oki@stratosphere.co.jp] Enviada em: quarta-feira,
26 de março de 2014 03:43
Para: Fred Pedrisa
Cc: dev@dpdk.org
Assunto: Re: [dpdk-dev] hw.nic_uio.bdfs

 

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.

 

 

2014-03-26 15:20 GMT+09:00 Fred Pedrisa <fredhps10@hotmail.com>:

Hello,

 

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 :)

 

Right now the code to handle it is wrong and I am trying to fix it myself.

 

De: Masaru Oki [mailto:m-oki@stratosphere.co.jp] Enviada em: quarta-feira,
26 de março de 2014 03:16
Para: Fred Pedrisa
Cc: dev@dpdk.org
Assunto: Re: [dpdk-dev] hw.nic_uio.bdfs

 

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=64
hw.contigmem.buffer_size=2097152
hw.nic_uio.bdfs="2:5:0,2:6:0"
contigmem_load="YES"
#nic_uio_load="YES"
[oki@ ~]$ pciconf -l | egrep '(em|uio)'
em0@pci0:2:1:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
em1@pci0:2:5:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
em2@pci0:2:6:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
[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=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
nic_uio0@pci0:2:5:0:    class=0x020000 card=0x075015ad chip=0x100f8086
rev=0x01 hdr=0x00
nic_uio1@pci0:2:6:0:    class=0x020000 card=0x075015ad chip=0x100f8086
rev=0x01 hdr=0x00
[oki@ ~]$ sudo kldunload nic_uio
[oki@ ~]$ pciconf -l | egrep '(em|uio)'
em0@pci0:2:1:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
[oki@ ~]$

 

2014-03-26 14:35 GMT+09:00 Fred Pedrisa <fredhps10@hotmail.com>:

Hi, guys.





This variable is not working as intended for FreeBSD :(



It does not dettach nic_uio from the wanted ports :/



 

 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] hw.nic_uio.bdfs
  2014-03-26  6:49       ` [dpdk-dev] RES: hw.nic_uio.bdfs Fred Pedrisa
  2014-03-26  6:52         ` [dpdk-dev] RES: " Fred Pedrisa
@ 2014-03-26  7:07         ` Masaru Oki
       [not found]         ` <016201cf48c2$59f0ead0$0dd2c070$@stratosphere.co.jp>
  2 siblings, 0 replies; 11+ messages in thread
From: Masaru Oki @ 2014-03-26  7:07 UTC (permalink / raw)
  To: Fred Pedrisa; +Cc: dev

> By default nic_uio takes all the NICs for itself...

Yes.
I think nic_uio_probe should check hw.nic_uio.bdfs.



2014-03-26 15:49 GMT+09:00 Fred Pedrisa <fredhps10@hotmail.com>:

> Hello,
>
>
>
> By default nic_uio takes all the NICs for itself...
>
>
>
> So in theory, you needed an option to reserve some NIC ports to your
> system, without DPDK taking it for itself...
>
>
>
> *De:* Masaru Oki [mailto:m-oki@stratosphere.co.jp]
> *Enviada em:* quarta-feira, 26 de março de 2014 03:43
>
> *Para:* Fred Pedrisa
> *Cc:* dev@dpdk.org
> *Assunto:* Re: [dpdk-dev] hw.nic_uio.bdfs
>
>
>
> 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.
>
>
>
>
>
> 2014-03-26 15:20 GMT+09:00 Fred Pedrisa <fredhps10@hotmail.com>:
>
> Hello,
>
>
>
> 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 :)
>
>
>
> Right now the code to handle it is wrong and I am trying to fix it myself.
>
>
>
> *De:* Masaru Oki [mailto:m-oki@stratosphere.co.jp]
> *Enviada em:* quarta-feira, 26 de março de 2014 03:16
> *Para:* Fred Pedrisa
> *Cc:* dev@dpdk.org
> *Assunto:* Re: [dpdk-dev] hw.nic_uio.bdfs
>
>
>
> 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=64
> hw.contigmem.buffer_size=2097152
> hw.nic_uio.bdfs="2:5:0,2:6:0"
> contigmem_load="YES"
> #nic_uio_load="YES"
> [oki@ ~]$ pciconf -l | egrep '(em|uio)'
> em0@pci0:2:1:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
> hdr=0x00
> em1@pci0:2:5:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
> hdr=0x00
> em2@pci0:2:6:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
> hdr=0x00
> [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=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
> hdr=0x00
> nic_uio0@pci0:2:5:0:    class=0x020000 card=0x075015ad chip=0x100f8086
> rev=0x01 hdr=0x00
> nic_uio1@pci0:2:6:0:    class=0x020000 card=0x075015ad chip=0x100f8086
> rev=0x01 hdr=0x00
> [oki@ ~]$ sudo kldunload nic_uio
> [oki@ ~]$ pciconf -l | egrep '(em|uio)'
> em0@pci0:2:1:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
> hdr=0x00
> [oki@ ~]$
>
>
>
> 2014-03-26 14:35 GMT+09:00 Fred Pedrisa <fredhps10@hotmail.com>:
>
> Hi, guys.
>
>
>
>
>
> This variable is not working as intended for FreeBSD :(
>
>
>
> It does not dettach nic_uio from the wanted ports :/
>
>
>
>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [dpdk-dev] RES:  hw.nic_uio.bdfs
       [not found]         ` <016201cf48c2$59f0ead0$0dd2c070$@stratosphere.co.jp>
@ 2014-03-26  7:16           ` Fred Pedrisa
       [not found]           ` <016f01cf48c3$99aedc30$cd0c9490$@hotmail.com>
  1 sibling, 0 replies; 11+ messages in thread
From: Fred Pedrisa @ 2014-03-26  7:16 UTC (permalink / raw)
  To: 'Masaru Oki'; +Cc: dev

Hello,

 

Yes, I am writing a fix for this too ;)

 

De: Masaru Oki [mailto:m-oki@stratosphere.co.jp] 
Enviada em: quarta-feira, 26 de março de 2014 04:08
Para: Fred Pedrisa
Cc: dev@dpdk.org
Assunto: Re: [dpdk-dev] hw.nic_uio.bdfs

 

> By default nic_uio takes all the NICs for itself…

Yes.

I think nic_uio_probe should check hw.nic_uio.bdfs.

 

 

2014-03-26 15:49 GMT+09:00 Fred Pedrisa <fredhps10@hotmail.com>:

Hello,

 

By default nic_uio takes all the NICs for itself…

 

So in theory, you needed an option to reserve some NIC ports to your system,
without DPDK taking it for itself…

 

De: Masaru Oki [mailto:m-oki@stratosphere.co.jp] 
Enviada em: quarta-feira, 26 de março de 2014 03:43


Para: Fred Pedrisa
Cc: dev@dpdk.org
Assunto: Re: [dpdk-dev] hw.nic_uio.bdfs

 

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.

 

 

2014-03-26 15:20 GMT+09:00 Fred Pedrisa <fredhps10@hotmail.com>:

Hello,

 

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 :)

 

Right now the code to handle it is wrong and I am trying to fix it myself.

 

De: Masaru Oki [mailto:m-oki@stratosphere.co.jp] 
Enviada em: quarta-feira, 26 de março de 2014 03:16
Para: Fred Pedrisa
Cc: dev@dpdk.org
Assunto: Re: [dpdk-dev] hw.nic_uio.bdfs

 

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=64
hw.contigmem.buffer_size=2097152
hw.nic_uio.bdfs="2:5:0,2:6:0"
contigmem_load="YES"
#nic_uio_load="YES"
[oki@ ~]$ pciconf -l | egrep '(em|uio)'
em0@pci0:2:1:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
em1@pci0:2:5:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
em2@pci0:2:6:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
[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=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
nic_uio0@pci0:2:5:0:    class=0x020000 card=0x075015ad chip=0x100f8086
rev=0x01 hdr=0x00
nic_uio1@pci0:2:6:0:    class=0x020000 card=0x075015ad chip=0x100f8086
rev=0x01 hdr=0x00
[oki@ ~]$ sudo kldunload nic_uio
[oki@ ~]$ pciconf -l | egrep '(em|uio)'
em0@pci0:2:1:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
[oki@ ~]$

 

2014-03-26 14:35 GMT+09:00 Fred Pedrisa <fredhps10@hotmail.com>:

Hi, guys.





This variable is not working as intended for FreeBSD :(



It does not dettach nic_uio from the wanted ports :/

 

 

 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [dpdk-dev] RES:  RES:  hw.nic_uio.bdfs
       [not found]           ` <016f01cf48c3$99aedc30$cd0c9490$@hotmail.com>
@ 2014-03-26  7:22             ` Fred Pedrisa
  2014-04-17 14:05               ` Thomas Monjalon
       [not found]             ` <017001cf48c4$4439eaf0$ccadc0d0$@hotmail.com>
  1 sibling, 1 reply; 11+ messages in thread
From: Fred Pedrisa @ 2014-03-26  7:22 UTC (permalink / raw)
  To: 'Masaru Oki'; +Cc: dev

Hello,

Here is my fix for probe code :

static int
nic_uio_probe (device_t dev)
{
        int i, len;
        char *remaining;
        long bus = 0, device = 0, function = 0;
        remaining = bdf_str;
        len = strlen(remaining);

        for (i = 0; remaining && len >= 5 && i < len;i+=6) {
                if ( remaining[i + 1] == ':' && remaining[i + 3] == ':' ) {
                        bus = strtol(&remaining[i + 0],NULL,0);
                        device = strtol(&remaining[i + 2],NULL,0);
                        function = strtol(&remaining[i + 4],NULL,0);
                        if (dev != NULL) {
                                if (pci_get_bus(dev) == bus &&
pci_get_slot(dev) == device && pci_get_function(dev) == function) {
                                        printf("nic_uio: success blocking
probe of : %ld:%ld:%ld!\n", bus, device, function);
                                        return (ENXIO);
                                }
                        }
                }
        }

        for (i = 0; i < NUM_DEVICES; i++)
                if (pci_get_vendor(dev) == devices[i].vend &&
                        pci_get_device(dev) == 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@dpdk.org] Em nome de Fred Pedrisa
Enviada em: quarta-feira, 26 de março de 2014 04:16
Para: 'Masaru Oki'
Cc: dev@dpdk.org
Assunto: [dpdk-dev] RES: hw.nic_uio.bdfs

Hello,

 

Yes, I am writing a fix for this too ;)

 

De: Masaru Oki [mailto:m-oki@stratosphere.co.jp] Enviada em: quarta-feira,
26 de março de 2014 04:08
Para: Fred Pedrisa
Cc: dev@dpdk.org
Assunto: Re: [dpdk-dev] hw.nic_uio.bdfs

 

> By default nic_uio takes all the NICs for itself…

Yes.

I think nic_uio_probe should check hw.nic_uio.bdfs.

 

 

2014-03-26 15:49 GMT+09:00 Fred Pedrisa <fredhps10@hotmail.com>:

Hello,

 

By default nic_uio takes all the NICs for itself…

 

So in theory, you needed an option to reserve some NIC ports to your system,
without DPDK taking it for itself…

 

De: Masaru Oki [mailto:m-oki@stratosphere.co.jp] Enviada em: quarta-feira,
26 de março de 2014 03:43


Para: Fred Pedrisa
Cc: dev@dpdk.org
Assunto: Re: [dpdk-dev] hw.nic_uio.bdfs

 

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.

 

 

2014-03-26 15:20 GMT+09:00 Fred Pedrisa <fredhps10@hotmail.com>:

Hello,

 

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 :)

 

Right now the code to handle it is wrong and I am trying to fix it myself.

 

De: Masaru Oki [mailto:m-oki@stratosphere.co.jp] 
Enviada em: quarta-feira, 26 de março de 2014 03:16
Para: Fred Pedrisa
Cc: dev@dpdk.org
Assunto: Re: [dpdk-dev] hw.nic_uio.bdfs

 

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=64
hw.contigmem.buffer_size=2097152
hw.nic_uio.bdfs="2:5:0,2:6:0"
contigmem_load="YES"
#nic_uio_load="YES"
[oki@ ~]$ pciconf -l | egrep '(em|uio)'
em0@pci0:2:1:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
em1@pci0:2:5:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
em2@pci0:2:6:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
[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=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
nic_uio0@pci0:2:5:0:    class=0x020000 card=0x075015ad chip=0x100f8086
rev=0x01 hdr=0x00
nic_uio1@pci0:2:6:0:    class=0x020000 card=0x075015ad chip=0x100f8086
rev=0x01 hdr=0x00
[oki@ ~]$ sudo kldunload nic_uio
[oki@ ~]$ pciconf -l | egrep '(em|uio)'
em0@pci0:2:1:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
[oki@ ~]$

 

2014-03-26 14:35 GMT+09:00 Fred Pedrisa <fredhps10@hotmail.com>:

Hi, guys.





This variable is not working as intended for FreeBSD :(



It does not dettach nic_uio from the wanted ports :/

 

 

 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [dpdk-dev] RES:  RES:  RES:  hw.nic_uio.bdfs
       [not found]             ` <017001cf48c4$4439eaf0$ccadc0d0$@hotmail.com>
@ 2014-03-26  7:51               ` Fred Pedrisa
  0 siblings, 0 replies; 11+ messages in thread
From: Fred Pedrisa @ 2014-03-26  7:51 UTC (permalink / raw)
  To: 'Masaru Oki'; +Cc: dev

Oh, don't forget to make : 

static char bdf_str[1024]; 

Anywhere in the nic_uio.c file, so this way the other methods can check the
content :-)

And remove the local declaration from nic_uio_load.

-----Mensagem original-----
De: dev [mailto:dev-bounces@dpdk.org] Em nome de Fred Pedrisa
Enviada em: quarta-feira, 26 de março de 2014 04:22
Para: 'Masaru Oki'
Cc: dev@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 = 0, device = 0, function = 0;
        remaining = bdf_str;
        len = strlen(remaining);

        for (i = 0; remaining && len >= 5 && i < len;i+=6) {
                if ( remaining[i + 1] == ':' && remaining[i + 3] == ':' ) {
                        bus = strtol(&remaining[i + 0],NULL,0);
                        device = strtol(&remaining[i + 2],NULL,0);
                        function = strtol(&remaining[i + 4],NULL,0);
                        if (dev != NULL) {
                                if (pci_get_bus(dev) == bus &&
pci_get_slot(dev) == device && pci_get_function(dev) == function) {
                                        printf("nic_uio: success blocking
probe of : %ld:%ld:%ld!\n", bus, device, function);
                                        return (ENXIO);
                                }
                        }
                }
        }

        for (i = 0; i < NUM_DEVICES; i++)
                if (pci_get_vendor(dev) == devices[i].vend &&
                        pci_get_device(dev) == 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@dpdk.org] Em nome de Fred Pedrisa Enviada em:
quarta-feira, 26 de março de 2014 04:16
Para: 'Masaru Oki'
Cc: dev@dpdk.org
Assunto: [dpdk-dev] RES: hw.nic_uio.bdfs

Hello,

 

Yes, I am writing a fix for this too ;)

 

De: Masaru Oki [mailto:m-oki@stratosphere.co.jp] Enviada em: quarta-feira,
26 de março de 2014 04:08
Para: Fred Pedrisa
Cc: dev@dpdk.org
Assunto: Re: [dpdk-dev] hw.nic_uio.bdfs

 

> By default nic_uio takes all the NICs for itself…

Yes.

I think nic_uio_probe should check hw.nic_uio.bdfs.

 

 

2014-03-26 15:49 GMT+09:00 Fred Pedrisa <fredhps10@hotmail.com>:

Hello,

 

By default nic_uio takes all the NICs for itself…

 

So in theory, you needed an option to reserve some NIC ports to your system,
without DPDK taking it for itself…

 

De: Masaru Oki [mailto:m-oki@stratosphere.co.jp] Enviada em: quarta-feira,
26 de março de 2014 03:43


Para: Fred Pedrisa
Cc: dev@dpdk.org
Assunto: Re: [dpdk-dev] hw.nic_uio.bdfs

 

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.

 

 

2014-03-26 15:20 GMT+09:00 Fred Pedrisa <fredhps10@hotmail.com>:

Hello,

 

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 :)

 

Right now the code to handle it is wrong and I am trying to fix it myself.

 

De: Masaru Oki [mailto:m-oki@stratosphere.co.jp] Enviada em: quarta-feira,
26 de março de 2014 03:16
Para: Fred Pedrisa
Cc: dev@dpdk.org
Assunto: Re: [dpdk-dev] hw.nic_uio.bdfs

 

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=64
hw.contigmem.buffer_size=2097152
hw.nic_uio.bdfs="2:5:0,2:6:0"
contigmem_load="YES"
#nic_uio_load="YES"
[oki@ ~]$ pciconf -l | egrep '(em|uio)'
em0@pci0:2:1:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
em1@pci0:2:5:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
em2@pci0:2:6:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
[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=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
nic_uio0@pci0:2:5:0:    class=0x020000 card=0x075015ad chip=0x100f8086
rev=0x01 hdr=0x00
nic_uio1@pci0:2:6:0:    class=0x020000 card=0x075015ad chip=0x100f8086
rev=0x01 hdr=0x00
[oki@ ~]$ sudo kldunload nic_uio
[oki@ ~]$ pciconf -l | egrep '(em|uio)'
em0@pci0:2:1:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
[oki@ ~]$

 

2014-03-26 14:35 GMT+09:00 Fred Pedrisa <fredhps10@hotmail.com>:

Hi, guys.





This variable is not working as intended for FreeBSD :(



It does not dettach nic_uio from the wanted ports :/

 

 

 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] RES:  RES:  hw.nic_uio.bdfs
  2014-03-26  7:22             ` [dpdk-dev] RES: " Fred Pedrisa
@ 2014-04-17 14:05               ` Thomas Monjalon
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Monjalon @ 2014-04-17 14:05 UTC (permalink / raw)
  To: Fred Pedrisa; +Cc: dev

Hi Fred,

2014-03-26 04:22, Fred Pedrisa:
> Here is my fix for probe code :
> 
> static int
> nic_uio_probe (device_t dev)
> {
>         int i, len;
>         char *remaining;
>         long bus = 0, device = 0, function = 0;
>         remaining = bdf_str;
>         len = strlen(remaining);
> 
>         for (i = 0; remaining && len >= 5 && i < len;i+=6) {
>                 if ( remaining[i + 1] == ':' && remaining[i + 3] == ':' ) {
>                         bus = strtol(&remaining[i + 0],NULL,0);
>                         device = strtol(&remaining[i + 2],NULL,0);
>                         function = strtol(&remaining[i + 4],NULL,0);
>                         if (dev != NULL) {
>                                 if (pci_get_bus(dev) == bus &&
> pci_get_slot(dev) == device && pci_get_function(dev) == function) {
>                                         printf("nic_uio: success blocking
> probe of : %ld:%ld:%ld!\n", bus, device, function);
>                                         return (ENXIO);
>                                 }
>                         }
>                 }
>         }
> 
>         for (i = 0; i < NUM_DEVICES; i++)
>                 if (pci_get_vendor(dev) == devices[i].vend &&
>                         pci_get_device(dev) == devices[i].dev) {
> 
>                         device_set_desc(dev, "Intel(R) DPDK PCI Device");
>                         return (BUS_PROBE_SPECIFIC);
>                 }
> 
>         return (ENXIO);
> }
> 
> Now it is working as intended ;)

If you think a patch should be applied, please send it with git-send-email as 
described in http://dpdk.org/dev#send

Thank you
-- 
Thomas

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-04-17 14:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-26  5:35 [dpdk-dev] hw.nic_uio.bdfs Fred Pedrisa
2014-03-26  6:15 ` Masaru Oki
     [not found] ` <013601cf48bb$0e1ed6a0$2a5c83e0$@stratosphere.co.jp>
2014-03-26  6:20   ` [dpdk-dev] RES: hw.nic_uio.bdfs Fred Pedrisa
2014-03-26  6:42     ` [dpdk-dev] hw.nic_uio.bdfs Masaru Oki
     [not found]     ` <014d01cf48be$f02c3990$d084acb0$@stratosphere.co.jp>
2014-03-26  6:49       ` [dpdk-dev] RES: hw.nic_uio.bdfs Fred Pedrisa
2014-03-26  6:52         ` [dpdk-dev] RES: " Fred Pedrisa
2014-03-26  7:07         ` [dpdk-dev] hw.nic_uio.bdfs Masaru Oki
     [not found]         ` <016201cf48c2$59f0ead0$0dd2c070$@stratosphere.co.jp>
2014-03-26  7:16           ` [dpdk-dev] RES: hw.nic_uio.bdfs Fred Pedrisa
     [not found]           ` <016f01cf48c3$99aedc30$cd0c9490$@hotmail.com>
2014-03-26  7:22             ` [dpdk-dev] RES: " Fred Pedrisa
2014-04-17 14:05               ` Thomas Monjalon
     [not found]             ` <017001cf48c4$4439eaf0$ccadc0d0$@hotmail.com>
2014-03-26  7:51               ` [dpdk-dev] RES: " Fred Pedrisa

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).