sfc: offload foreign RHS rules without an encap match
authorEdward Cree <ecree.xilinx@gmail.com>
Mon, 2 Oct 2023 15:44:42 +0000 (16:44 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Oct 2023 10:05:44 +0000 (11:05 +0100)
Normally, if a TC filter on a tunnel netdev does not match on any
 encap fields, we decline to offload it, as it cannot meet our
 requirement for a <sip,dip,dport> tuple for the encap match.
However, if the rule has a nonzero chain_index, then for a packet to
 reach the rule, it must already have matched a LHS rule which will
 have included an encap match and determined the tunnel type, so in
 that case we can offload the right-hand-side rule.

Reviewed-by: Pieter Jansen van Vuuren <pieter.jansen-van-vuuren@amd.com>
Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/tc.c

index 257bec75e952c02eb8194905b7f2b07614a894ee..f4172fc6bd4f8669d8de63ce488b42139f676527 100644 (file)
@@ -1683,7 +1683,7 @@ static int efx_tc_flower_replace_foreign(struct efx_nic *efx,
                                                      extack);
                if (rc)
                        goto release;
-       } else {
+       } else if (!tc->common.chain_index) {
                /* This is not a tunnel decap rule, ignore it */
                netif_dbg(efx, drv, efx->net_dev,
                          "Ignoring foreign filter without encap match\n");