]> git.droids-corp.org - dpdk.git/commitdiff
net/sfc: skip driver probe for incompatible device class
authorVijay Kumar Srivastava <vsrivast@xilinx.com>
Tue, 16 Mar 2021 08:58:31 +0000 (11:58 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 16 Mar 2021 11:39:42 +0000 (12:39 +0100)
Driver would be probed only for the net device class.

Signed-off-by: Vijay Kumar Srivastava <vsrivast@xilinx.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
doc/guides/nics/sfc_efx.rst
drivers/net/sfc/sfc.h
drivers/net/sfc/sfc_ethdev.c
drivers/net/sfc/sfc_kvargs.c

index b6047cf5c79ebfdecac0fb57b397b41978f98223..cf1269cc031a8a2eacb1406a48876444bc7afc8b 100644 (file)
@@ -357,6 +357,14 @@ allow option like "-a 02:00.0,arg1=value1,...".
 Case-insensitive 1/y/yes/on or 0/n/no/off may be used to specify
 boolean parameters value.
 
+- ``class`` [net|vdpa] (default **net**)
+
+  Choose the mode of operation of ef100 device.
+  **net** device will work as network device and will be probed by net/sfc driver.
+  **vdpa** device will work as vdpa device and will be probed by vdpa/sfc driver.
+  If this parameter is not specified then ef100 device will operate as
+  network device.
+
 - ``rx_datapath`` [auto|efx|ef10|ef10_essb] (default **auto**)
 
   Choose receive datapath implementation.
index c2945b6ba20d8036aaac2558541123d95a448d61..b48a818adb71e2e085874659967deb4c2fbb7722 100644 (file)
@@ -22,6 +22,7 @@
 #include "efx.h"
 
 #include "sfc_efx_mcdi.h"
+#include "sfc_efx.h"
 
 #include "sfc_debug.h"
 #include "sfc_log.h"
index 00a0fd3d02b2f946f6952a1d63e5e8438ed09066..23828c24ffd043cd9973493e0dce1cfbba81c5b0 100644 (file)
@@ -2161,6 +2161,13 @@ sfc_eth_dev_init(struct rte_eth_dev *dev)
        const struct rte_ether_addr *from;
        int ret;
 
+       if (sfc_efx_dev_class_get(pci_dev->device.devargs) !=
+                       SFC_EFX_DEV_CLASS_NET) {
+               SFC_GENERIC_LOG(DEBUG,
+                       "Incompatible device class: skip probing, should be probed by other sfc driver.");
+               return 1;
+       }
+
        sfc_register_dp();
 
        logtype_main = sfc_register_logtype(&pci_dev->addr,
index c42b326ab036520519d99153bcc5efe641e8410a..0efa92ed28aafad0f4c5d6e5d0060a69d99fd8a0 100644 (file)
@@ -28,6 +28,7 @@ sfc_kvargs_parse(struct sfc_adapter *sa)
                SFC_KVARG_TX_DATAPATH,
                SFC_KVARG_FW_VARIANT,
                SFC_KVARG_RXD_WAIT_TIMEOUT_NS,
+               SFC_EFX_KVARG_DEV_CLASS,
                NULL,
        };