From: Vijay Kumar Srivastava <vsriv...@xilinx.com> Driver would be probed only for the net device class.
Signed-off-by: Vijay Kumar Srivastava <vsriv...@xilinx.com> Signed-off-by: Andrew Rybchenko <andrew.rybche...@oktetlabs.ru> --- doc/guides/nics/sfc_efx.rst | 8 ++++++++ drivers/net/sfc/sfc.h | 1 + drivers/net/sfc/sfc_ethdev.c | 7 +++++++ drivers/net/sfc/sfc_kvargs.c | 1 + 4 files changed, 17 insertions(+) diff --git a/doc/guides/nics/sfc_efx.rst b/doc/guides/nics/sfc_efx.rst index f5e9f9495e..61ceae9714 100644 --- a/doc/guides/nics/sfc_efx.rst +++ b/doc/guides/nics/sfc_efx.rst @@ -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. diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h index fdee800482..85b28ca3be 100644 --- a/drivers/net/sfc/sfc.h +++ b/drivers/net/sfc/sfc.h @@ -22,6 +22,7 @@ #include "efx.h" #include "sfc_efx_mcdi.h" +#include "sfc_efx.h" #include "sfc_debug.h" #include "sfc_log.h" diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 479b4f4df6..e68cf673cb 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -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, diff --git a/drivers/net/sfc/sfc_kvargs.c b/drivers/net/sfc/sfc_kvargs.c index 13e9665bb4..730ce4c7ee 100644 --- a/drivers/net/sfc/sfc_kvargs.c +++ b/drivers/net/sfc/sfc_kvargs.c @@ -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, }; -- 2.30.1