hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.h
....@@ -23,6 +23,9 @@
2323 __be16 inner_vlan_tci;
2424 __be16 ether_type;
2525 u8 num_vlans;
26
+ u8 dir;
27
+#define BNXT_DIR_RX 1
28
+#define BNXT_DIR_TX 0
2629 };
2730
2831 struct bnxt_tc_l3_key {
....@@ -59,6 +62,12 @@
5962 __be32 id;
6063 };
6164
65
+#define bnxt_eth_addr_key_mask_invalid(eth_addr, eth_addr_mask) \
66
+ ((is_wildcard(&(eth_addr)[0], ETH_ALEN) && \
67
+ is_wildcard(&(eth_addr)[ETH_ALEN / 2], ETH_ALEN)) || \
68
+ (is_wildcard(&(eth_addr_mask)[0], ETH_ALEN) && \
69
+ is_wildcard(&(eth_addr_mask)[ETH_ALEN / 2], ETH_ALEN)))
70
+
6271 struct bnxt_tc_actions {
6372 u32 flags;
6473 #define BNXT_TC_ACTION_FLAG_FWD BIT(0)
....@@ -68,6 +77,8 @@
6877 #define BNXT_TC_ACTION_FLAG_DROP BIT(5)
6978 #define BNXT_TC_ACTION_FLAG_TUNNEL_ENCAP BIT(6)
7079 #define BNXT_TC_ACTION_FLAG_TUNNEL_DECAP BIT(7)
80
+#define BNXT_TC_ACTION_FLAG_L2_REWRITE BIT(8)
81
+#define BNXT_TC_ACTION_FLAG_NAT_XLATE BIT(9)
7182
7283 u16 dst_fid;
7384 struct net_device *dst_dev;
....@@ -76,6 +87,18 @@
7687
7788 /* tunnel encap */
7889 struct ip_tunnel_key tun_encap_key;
90
+#define PEDIT_OFFSET_SMAC_LAST_4_BYTES 0x8
91
+ __be16 l2_rewrite_dmac[3];
92
+ __be16 l2_rewrite_smac[3];
93
+ struct {
94
+ bool src_xlate; /* true => translate src,
95
+ * false => translate dst
96
+ * Mutually exclusive, i.e cannot set both
97
+ */
98
+ bool l3_is_ipv4; /* false means L3 is ipv6 */
99
+ struct bnxt_tc_l3_key l3;
100
+ struct bnxt_tc_l4_key l4;
101
+ } nat;
79102 };
80103
81104 struct bnxt_tc_flow {
....@@ -170,7 +193,9 @@
170193
171194 struct bnxt_tc_flow flow;
172195
196
+ __le64 ext_flow_handle;
173197 __le16 flow_handle;
198
+ __le32 flow_id;
174199
175200 /* L2 node in l2 hashtable that shares flow's l2 key */
176201 struct bnxt_tc_l2_node *l2_node;
....@@ -191,7 +216,7 @@
191216 };
192217
193218 int bnxt_tc_setup_flower(struct bnxt *bp, u16 src_fid,
194
- struct tc_cls_flower_offload *cls_flower);
219
+ struct flow_cls_offload *cls_flower);
195220 int bnxt_init_tc(struct bnxt *bp);
196221 void bnxt_shutdown_tc(struct bnxt *bp);
197222 void bnxt_tc_flow_stats_work(struct bnxt *bp);
....@@ -204,7 +229,7 @@
204229 #else /* CONFIG_BNXT_FLOWER_OFFLOAD */
205230
206231 static inline int bnxt_tc_setup_flower(struct bnxt *bp, u16 src_fid,
207
- struct tc_cls_flower_offload *cls_flower)
232
+ struct flow_cls_offload *cls_flower)
208233 {
209234 return -EOPNOTSUPP;
210235 }