/* 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
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));
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;
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);