sfc: support TC decap rules matching on enc_ip_tos
authorEdward Cree <ecree.xilinx@gmail.com>
Thu, 11 May 2023 19:47:30 +0000 (20:47 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 May 2023 09:37:02 +0000 (10:37 +0100)
commit3c9561c0a5b988be3dfd24ea1de2301b95efc640
treef28c265db517b5f8081019531b2b01d44f4e0528
parent56beb35d85e290b71372d7ee1093621f6abb6e96
sfc: support TC decap rules matching on enc_ip_tos

Allow efx_tc_encap_match entries to include an ip_tos and ip_tos_mask.
To avoid partially-overlapping Outer Rules (which can lead to undefined
 behaviour in the hardware), store extra "pseudo" entries in our
 encap_match hashtable, which are used to enforce that all Outer Rule
 entries within a given <src_ip,dst_ip,udp_dport> tuple (or IPv6
 equivalent) have the same ip_tos_mask.
The "direct" encap_match entry takes a reference on the "pseudo",
 allowing it to be destroyed when all "direct" entries using it are
 removed.
efx_tc_em_pseudo_type is an enum rather than just a bool because in
 future an additional pseudo-type will be added to support Conntrack
 offload.

Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/tc.c
drivers/net/ethernet/sfc/tc.h