aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
diff options
context:
space:
mode:
authorRahul Lakkireddy <rahul.lakkireddy@chelsio.com>2020-06-30 18:41:28 +0530
committerDavid S. Miller <davem@davemloft.net>2020-06-30 18:34:34 -0700
commitfd2261d8ed6f1375f18341e959d4bbcd94d748a3 (patch)
tree35e1845ff9bb91335fe7236ae194f7978ec7f7b6 /drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
parentpcnet32: Mark PM functions as __maybe_unused (diff)
downloadlinux-dev-fd2261d8ed6f1375f18341e959d4bbcd94d748a3.tar.xz
linux-dev-fd2261d8ed6f1375f18341e959d4bbcd94d748a3.zip
cxgb4: add mirror action to TC-MATCHALL offload
Add mirror Virtual Interface (VI) support to receive all ingress mirror traffic from the underlying device. The mirror VI is created dynamically, if the TC-MATCHALL rule has a corresponding mirror action. Also request MSI-X vectors needed for the mirror VI Rxqs. If no vectors are available, then disable mirror VI support. v3: - Replace mirror VI refcount_t with normal u32 variable. v2: - Add mutex to protect all mirror VI data, instead of just mirror Rxqs. Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio/cxgb4/t4_hw.c')
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/t4_hw.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index 70fe189202be..7876aa392aae 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -9711,6 +9711,22 @@ int t4_port_init(struct adapter *adap, int mbox, int pf, int vf)
return 0;
}
+int t4_init_port_mirror(struct port_info *pi, u8 mbox, u8 port, u8 pf, u8 vf,
+ u16 *mirror_viid)
+{
+ int ret;
+
+ ret = t4_alloc_vi(pi->adapter, mbox, port, pf, vf, 1, NULL, NULL,
+ NULL, NULL);
+ if (ret < 0)
+ return ret;
+
+ if (mirror_viid)
+ *mirror_viid = ret;
+
+ return 0;
+}
+
/**
* t4_read_cimq_cfg - read CIM queue configuration
* @adap: the adapter