dpdk: don't automatically whitelist vmxnet3 PCI interfaces 52/15752/2
authorSteven <sluong@cisco.com>
Tue, 6 Nov 2018 20:32:58 +0000 (12:32 -0800)
committerDamjan Marion <dmarion@me.com>
Tue, 6 Nov 2018 22:21:31 +0000 (22:21 +0000)
If no PCI address is specified in dpdk config, the default to automatically
put all PCIs in the whitelist.
For vmxnet3 PCIs, we want to change its default to exclude the vmxnet3 PCIs.
That is to put them in the blacklist instead of whitelist.

Change-Id: I2b7061d6437910eb0e1b16df19a770cab968c602
Signed-off-by: Steven <sluong@cisco.com>
src/plugins/dpdk/device/init.c

index 9c54641..c130dbc 100644 (file)
@@ -888,7 +888,20 @@ dpdk_bind_devices_to_uio (dpdk_config_main_t * conf)
       ;
     /* vmxnet3 */
     else if (d->vendor_id == 0x15ad && d->device_id == 0x07b0)
-      ;
+      {
+       /*
+        * For vmxnet3 PCI, unless it is explicitly specified in the whitelist,
+        * the default is to put it in the blacklist.
+        */
+       if (devconf == 0)
+         {
+           pool_get (conf->dev_confs, devconf);
+           hash_set (conf->device_config_index_by_pci_addr, addr->as_u32,
+                     devconf - conf->dev_confs);
+           devconf->pci_addr.as_u32 = addr->as_u32;
+           devconf->is_blacklisted = 1;
+         }
+      }
     /* all Intel network devices */
     else if (d->vendor_id == 0x8086 && d->device_class == PCI_CLASS_NETWORK_ETHERNET)
       ;