aboutsummaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-08-23 00:53:22 +0200
committerDave Barach <openvpp@barachs.net>2016-08-23 12:46:21 +0000
commitb1b1a14977f77d9805dd2cb11c7e8ddfc404818a (patch)
tree323fa241a8b70f18599ad5f7a5cc474beb6c41c7 /vnet
parent3cd9e730f9db0d998e5e8a27ddff1da5a123625b (diff)
Fix PCI vendor_id/device_id detection for SR-IOV devices
Change-Id: I06ae392c7c8c3b4be7fd46560add442f42927c22 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/devices/dpdk/init.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/vnet/vnet/devices/dpdk/init.c b/vnet/vnet/devices/dpdk/init.c
index afaaa85a221..2ecfa38481a 100644
--- a/vnet/vnet/devices/dpdk/init.c
+++ b/vnet/vnet/devices/dpdk/init.c
@@ -833,18 +833,16 @@ dpdk_bind_devices_to_uio (dpdk_config_main_t * conf)
vlib_pci_main_t *pm = &pci_main;
clib_error_t *error;
vlib_pci_device_t *d;
- pci_config_header_t *c;
u8 *pci_addr = 0;
int num_whitelisted = vec_len (conf->dev_confs);
/* *INDENT-OFF* */
pool_foreach (d, pm->pci_devs, ({
dpdk_device_config_t * devconf = 0;
- c = &d->config0.header;
vec_reset_length (pci_addr);
pci_addr = format (pci_addr, "%U%c", format_vlib_pci_addr, &d->bus_address, 0);
- if (c->device_class != PCI_CLASS_NETWORK_ETHERNET)
+ if (d->device_class != PCI_CLASS_NETWORK_ETHERNET)
continue;
if (num_whitelisted)
@@ -858,24 +856,24 @@ dpdk_bind_devices_to_uio (dpdk_config_main_t * conf)
}
/* virtio */
- if (c->vendor_id == 0x1af4 && c->device_id == 0x1000)
+ if (d->vendor_id == 0x1af4 && d->device_id == 0x1000)
;
/* vmxnet3 */
- else if (c->vendor_id == 0x15ad && c->device_id == 0x07b0)
+ else if (d->vendor_id == 0x15ad && d->device_id == 0x07b0)
;
/* all Intel devices */
- else if (c->vendor_id == 0x8086)
+ else if (d->vendor_id == 0x8086)
;
/* Cisco VIC */
- else if (c->vendor_id == 0x1137 && c->device_id == 0x0043)
+ else if (d->vendor_id == 0x1137 && d->device_id == 0x0043)
;
/* Chelsio T4/T5 */
- else if (c->vendor_id == 0x1425 && (c->device_id & 0xe000) == 0x4000)
+ else if (d->vendor_id == 0x1425 && (d->device_id & 0xe000) == 0x4000)
;
else
{
clib_warning ("Unsupported Ethernet PCI device 0x%04x:0x%04x found "
- "at PCI address %s\n", (u16) c->vendor_id, (u16) c->device_id,
+ "at PCI address %s\n", (u16) d->vendor_id, (u16) d->device_id,
pci_addr);
continue;
}