net/ngbe: support MAC filters
[dpdk.git] / drivers / net / sfc / sfc_sriov.c
index d8db22b..385b172 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
- * Copyright(c) 2019-2020 Xilinx, Inc.
+ * Copyright(c) 2019-2021 Xilinx, Inc.
  * Copyright(c) 2019 Solarflare Communications Inc.
  *
  * This software was jointly developed between OKTET Labs (under contract
@@ -53,7 +53,7 @@ sfc_sriov_attach(struct sfc_adapter *sa)
        sfc_log_init(sa, "entry");
 
        sriov->num_vfs = pci_dev->max_vfs;
-       if (sriov->num_vfs == 0)
+       if (sa->switchdev || sriov->num_vfs == 0)
                goto done;
 
        vport_config = calloc(sriov->num_vfs + 1, sizeof(*vport_config));
@@ -110,6 +110,11 @@ sfc_sriov_vswitch_create(struct sfc_adapter *sa)
 
        sfc_log_init(sa, "entry");
 
+       if (sa->switchdev) {
+               sfc_log_init(sa, "don't create vswitch in switchdev mode");
+               goto done;
+       }
+
        if (sriov->num_vfs == 0) {
                sfc_log_init(sa, "no VFs enabled");
                goto done;
@@ -152,7 +157,7 @@ sfc_sriov_vswitch_destroy(struct sfc_adapter *sa)
 
        sfc_log_init(sa, "entry");
 
-       if (sriov->num_vfs == 0)
+       if (sa->switchdev || sriov->num_vfs == 0)
                goto done;
 
        rc = efx_evb_vswitch_destroy(sa->nic, sriov->vswitch);