Skip to content

Commit 224de54

Browse files
louis-peensdavem330
authored andcommitted
nfp: flower: reject tunnel encap with ipv6 outer headers for offloading
This fixes a bug where ipv6 tunnels would report that it is getting offloaded to hardware but would actually be rejected by hardware. Fixes: b27d6a9 ("nfp: compile flower vxlan tunnel set actions") Signed-off-by: Louis Peens <[email protected]> Reviewed-by: John Hurley <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Jakub Kicinski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent db191db commit 224de54

File tree

1 file changed

+6
-0
lines changed
  • drivers/net/ethernet/netronome/nfp/flower

1 file changed

+6
-0
lines changed

drivers/net/ethernet/netronome/nfp/flower/action.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#define NFP_FL_TUNNEL_CSUM cpu_to_be16(0x01)
5353
#define NFP_FL_TUNNEL_KEY cpu_to_be16(0x04)
5454
#define NFP_FL_TUNNEL_GENEVE_OPT cpu_to_be16(0x0800)
55+
#define NFP_FL_SUPPORTED_TUNNEL_INFO_FLAGS IP_TUNNEL_INFO_TX
5556
#define NFP_FL_SUPPORTED_IPV4_UDP_TUN_FLAGS (NFP_FL_TUNNEL_CSUM | \
5657
NFP_FL_TUNNEL_KEY | \
5758
NFP_FL_TUNNEL_GENEVE_OPT)
@@ -741,11 +742,16 @@ nfp_flower_loop_action(struct nfp_app *app, const struct tc_action *a,
741742
nfp_fl_push_vlan(psh_v, a);
742743
*a_len += sizeof(struct nfp_fl_push_vlan);
743744
} else if (is_tcf_tunnel_set(a)) {
745+
struct ip_tunnel_info *ip_tun = tcf_tunnel_info(a);
744746
struct nfp_repr *repr = netdev_priv(netdev);
747+
745748
*tun_type = nfp_fl_get_tun_from_act_l4_port(repr->app, a);
746749
if (*tun_type == NFP_FL_TUNNEL_NONE)
747750
return -EOPNOTSUPP;
748751

752+
if (ip_tun->mode & ~NFP_FL_SUPPORTED_TUNNEL_INFO_FLAGS)
753+
return -EOPNOTSUPP;
754+
749755
/* Pre-tunnel action is required for tunnel encap.
750756
* This checks for next hop entries on NFP.
751757
* If none, the packet falls back before applying other actions.

0 commit comments

Comments
 (0)