[dpdk-dev] RES: RES: RES: RES: hw.nic_uio.bdfs

Fred Pedrisa fredhps10 at hotmail.com
Thu Mar 27 23:06:55 CET 2014


Hi !

I've attached my contribution (the fixed source) by changing the behavior
the way Alan wanted :)

It is working and if you like to use it, this would be cool.

Sincerely,

Fred Pedrisa

-----Mensagem original-----
De: Fred Pedrisa [mailto:fredhps10 at hotmail.com] 
Enviada em: quinta-feira, 27 de março de 2014 17:28
Para: 'Carew, Alan'; 'Masaru Oki'
Cc: 'dev at dpdk.org'
Assunto: RES: [dpdk-dev] RES: RES: RES: hw.nic_uio.bdfs

Hello,

It just requires a small code change :), and it can work in the expected
way.

So you mean bdfs is to 'select' the only wanted devices yes ? May I change
my code proposition for you ?

Sincerely,

Fred Pedrisa

-----Mensagem original-----
De: Carew, Alan [mailto:alan.carew at intel.com] Enviada em: quinta-feira, 27
de março de 2014 17:12
Para: Fred Pedrisa; Masaru Oki
Cc: dev at dpdk.org
Assunto: [dpdk-dev] RES: RES: RES: hw.nic_uio.bdfs

Hi folks,

Just to clarify, the purpose of hw.nic_uio.bdfs is to remove NICs from
drivers 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
devices 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 the
original driver is loaded first.

The change below changes the purpose of hw.nic_uio.bdfs, i.e. blacklist
devices so that they are not used by nic_uio.
A better approach would be to make the variable an exclusive list of devices
to be used, this would then require all users to specify the exact devices
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ço 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 = 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 at dpdk.org] Em nome de Fred Pedrisa Enviada em:
quarta-feira, 26 de março de 2014 04:16
Para: 'Masaru Oki'
Cc: dev at 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 at stratosphere.co.jp] Enviada em:
quarta-feira,
26 de março de 2014 04:08
Para: Fred Pedrisa
Cc: dev at 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 at 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 at stratosphere.co.jp] Enviada em:
quarta-feira,
26 de março de 2014 03:43


Para: Fred Pedrisa
Cc: dev at 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 at 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 at stratosphere.co.jp] Enviada em:
quarta-feira,
26 de março de 2014 03:16
Para: Fred Pedrisa
Cc: dev at 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 at pci0:2:1:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
em1 at pci0:2:5:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
em2 at 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 at pci0:2:1:0: class=0x020000 card=0x075015ad chip=0x100f8086 rev=0x01
hdr=0x00
nic_uio0 at pci0:2:5:0:    class=0x020000 card=0x075015ad chip=0x100f8086
rev=0x01 hdr=0x00
nic_uio1 at 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 at 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 at hotmail.com>:

Hi, guys.





This variable is not working as intended for FreeBSD :(



It does not dettach nic_uio from the wanted ports :/

 

 

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: nic_uio.c
URL: <http://dpdk.org/ml/archives/dev/attachments/20140327/f6c5c64a/attachment.c>


More information about the dev mailing list