aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c
diff options
context:
space:
mode:
authorVijaya Mohan Guvva <vijaya.guvva@cavium.com>2017-10-31 16:04:57 -0700
committerDavid S. Miller <davem@davemloft.net>2017-11-01 11:39:52 +0900
commitd4be8ebefb449c43b7daa5c9d23b22cd20c17258 (patch)
treeb02c3df708107a9320d616eaa63013be12d8e3bf /drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c
parentliquidio: switchdev support for LiquidIO NIC (diff)
downloadlinux-dev-d4be8ebefb449c43b7daa5c9d23b22cd20c17258.tar.xz
linux-dev-d4be8ebefb449c43b7daa5c9d23b22cd20c17258.zip
liquidio: Configure switchdev with devlink
Enable and disable switchdev on SRIOV capable LiquidIO NIC with devlink. Create representor netdev for each SRIOV VF function on SRIOV enable and and do the cleanup on SRIOV disable. Signed-off-by: Vijaya Mohan Guvva <vijaya.guvva@cavium.com> Signed-off-by: Satanand Burla <satananda.burla@cavium.com> Signed-off-by: Raghu Vatsavayi <raghu.vatsavayi@cavium.com> Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c')
-rw-r--r--drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c
index 67ff7a143e9e..de0c80d150f3 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c
@@ -515,6 +515,9 @@ lio_vf_rep_create(struct octeon_device *oct)
struct net_device *ndev;
int i, num_vfs;
+ if (oct->eswitch_mode != DEVLINK_ESWITCH_MODE_SWITCHDEV)
+ return 0;
+
if (!oct->sriov_info.sriov_enabled)
return 0;
@@ -599,6 +602,9 @@ lio_vf_rep_destroy(struct octeon_device *oct)
struct net_device *ndev;
int i;
+ if (oct->eswitch_mode != DEVLINK_ESWITCH_MODE_SWITCHDEV)
+ return;
+
if (!oct->sriov_info.sriov_enabled)
return;