summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.h
diff options
context:
space:
mode:
authorKumar Sanghvi <kumaras@chelsio.com>2017-10-18 18:19:10 +0300
committerDavid S. Miller <davem@davemloft.net>2017-10-20 15:06:52 +0300
commit27ece1f357b71c63e6e35c645b9c344835d4a129 (patch)
tree9e1e380c9b818a856bcd632cb2fd0639d8f80118 /drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.h
parentc39bff47d735e39fdbf59ad56df5581b0cf88c7c (diff)
downloadlinux-27ece1f357b71c63e6e35c645b9c344835d4a129.tar.xz
cxgb4: add tc flower support for ETH-DMAC rewrite
Add support for ETH-DMAC Rewrite via TC-PEDIT action. Also, add check to assert that vlan/eth-dmac rewrite actions are valid only in combination with action egress redirect. Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.h')
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.h
index 604feffc752e..7bf6cfa892aa 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.h
@@ -54,6 +54,25 @@ struct ch_tc_flower_entry {
u32 filter_id;
};
+enum {
+ ETH_DMAC_31_0, /* dmac bits 0.. 31 */
+ ETH_DMAC_47_32, /* dmac bits 32..47 */
+};
+
+struct ch_tc_pedit_fields {
+ u8 field;
+ u8 size;
+ u32 offset;
+};
+
+#define PEDIT_FIELDS(type, field, size, fs_field, offset) \
+ { type## field, size, \
+ offsetof(struct ch_filter_specification, fs_field) + (offset) }
+
+#define PEDIT_ETH_DMAC_MASK 0xffff
+#define PEDIT_ETH_DMAC_31_0 0x0
+#define PEDIT_ETH_DMAC_47_32_SMAC_15_0 0x4
+
int cxgb4_tc_flower_replace(struct net_device *dev,
struct tc_cls_flower_offload *cls);
int cxgb4_tc_flower_destroy(struct net_device *dev,