[dpdk-dev] RES: RES: hw.nic_uio.bdfs
Thomas Monjalon
thomas.monjalon at 6wind.com
Thu Apr 17 16:05:46 CEST 2014
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
More information about the dev
mailing list