| .. | .. |
|---|
| 23 | 23 | __be16 inner_vlan_tci; |
|---|
| 24 | 24 | __be16 ether_type; |
|---|
| 25 | 25 | u8 num_vlans; |
|---|
| 26 | + u8 dir; |
|---|
| 27 | +#define BNXT_DIR_RX 1 |
|---|
| 28 | +#define BNXT_DIR_TX 0 |
|---|
| 26 | 29 | }; |
|---|
| 27 | 30 | |
|---|
| 28 | 31 | struct bnxt_tc_l3_key { |
|---|
| .. | .. |
|---|
| 59 | 62 | __be32 id; |
|---|
| 60 | 63 | }; |
|---|
| 61 | 64 | |
|---|
| 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 | + |
|---|
| 62 | 71 | struct bnxt_tc_actions { |
|---|
| 63 | 72 | u32 flags; |
|---|
| 64 | 73 | #define BNXT_TC_ACTION_FLAG_FWD BIT(0) |
|---|
| .. | .. |
|---|
| 68 | 77 | #define BNXT_TC_ACTION_FLAG_DROP BIT(5) |
|---|
| 69 | 78 | #define BNXT_TC_ACTION_FLAG_TUNNEL_ENCAP BIT(6) |
|---|
| 70 | 79 | #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) |
|---|
| 71 | 82 | |
|---|
| 72 | 83 | u16 dst_fid; |
|---|
| 73 | 84 | struct net_device *dst_dev; |
|---|
| .. | .. |
|---|
| 76 | 87 | |
|---|
| 77 | 88 | /* tunnel encap */ |
|---|
| 78 | 89 | 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; |
|---|
| 79 | 102 | }; |
|---|
| 80 | 103 | |
|---|
| 81 | 104 | struct bnxt_tc_flow { |
|---|
| .. | .. |
|---|
| 170 | 193 | |
|---|
| 171 | 194 | struct bnxt_tc_flow flow; |
|---|
| 172 | 195 | |
|---|
| 196 | + __le64 ext_flow_handle; |
|---|
| 173 | 197 | __le16 flow_handle; |
|---|
| 198 | + __le32 flow_id; |
|---|
| 174 | 199 | |
|---|
| 175 | 200 | /* L2 node in l2 hashtable that shares flow's l2 key */ |
|---|
| 176 | 201 | struct bnxt_tc_l2_node *l2_node; |
|---|
| .. | .. |
|---|
| 191 | 216 | }; |
|---|
| 192 | 217 | |
|---|
| 193 | 218 | 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); |
|---|
| 195 | 220 | int bnxt_init_tc(struct bnxt *bp); |
|---|
| 196 | 221 | void bnxt_shutdown_tc(struct bnxt *bp); |
|---|
| 197 | 222 | void bnxt_tc_flow_stats_work(struct bnxt *bp); |
|---|
| .. | .. |
|---|
| 204 | 229 | #else /* CONFIG_BNXT_FLOWER_OFFLOAD */ |
|---|
| 205 | 230 | |
|---|
| 206 | 231 | 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) |
|---|
| 208 | 233 | { |
|---|
| 209 | 234 | return -EOPNOTSUPP; |
|---|
| 210 | 235 | } |
|---|