Skip to content

Commit f7536ff

Browse files
macris-xiaodavem330
authored andcommitted
nfp: flower: Allow ipv6gretap interface for offloading
The tunnel_type check only allows for "netif_is_gretap", but for OVS the port is actually "netif_is_ip6gretap" when setting up GRE for ipv6, which means offloading request was rejected before. Therefore, adding "netif_is_ip6gretap" allow ipv6gretap interface for offloading. Signed-off-by: Yu Xiao <[email protected]> Signed-off-by: Louis Peens <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c07c6e8 commit f7536ff

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ nfp_flower_tun_is_gre(struct flow_rule *rule, int start_idx)
272272
for (act_idx = start_idx + 1; act_idx < num_act; act_idx++)
273273
if (act[act_idx].id == FLOW_ACTION_REDIRECT ||
274274
act[act_idx].id == FLOW_ACTION_MIRRED)
275-
return netif_is_gretap(act[act_idx].dev);
275+
return netif_is_gretap(act[act_idx].dev) ||
276+
netif_is_ip6gretap(act[act_idx].dev);
276277

277278
return false;
278279
}

drivers/net/ethernet/netronome/nfp/flower/cmsg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ nfp_fl_netdev_is_tunnel_type(struct net_device *netdev,
703703
{
704704
if (netif_is_vxlan(netdev))
705705
return tun_type == NFP_FL_TUNNEL_VXLAN;
706-
if (netif_is_gretap(netdev))
706+
if (netif_is_gretap(netdev) || netif_is_ip6gretap(netdev))
707707
return tun_type == NFP_FL_TUNNEL_GRE;
708708
if (netif_is_geneve(netdev))
709709
return tun_type == NFP_FL_TUNNEL_GENEVE;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ nfp_flower_calculate_key_layers(struct nfp_app *app,
360360

361361
if (!flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ENC_PORTS)) {
362362
/* check if GRE, which has no enc_ports */
363-
if (!netif_is_gretap(netdev)) {
363+
if (!netif_is_gretap(netdev) && !netif_is_ip6gretap(netdev)) {
364364
NL_SET_ERR_MSG_MOD(extack, "unsupported offload: an exact match on L4 destination port is required for non-GRE tunnels");
365365
return -EOPNOTSUPP;
366366
}

0 commit comments

Comments
 (0)