Skip to content

Commit

Permalink
ip6_gre: Make IP6GRE and IP6GRETAP devices always NETIF_F_LLTX
Browse files Browse the repository at this point in the history
Recently we made o_seqno atomic_t.  Stop special-casing TUNNEL_SEQ, and
always mark IP6GRE[TAP] devices as NETIF_F_LLTX, since we no longer need
the TX lock (&txq->_xmit_lock).

Signed-off-by: Peilin Ye <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>
  • Loading branch information
peilin-ye authored and Paolo Abeni committed May 2, 2022
1 parent 020e8f6 commit b11ebf2
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions net/ipv6/ip6_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,6 @@ static struct ip6_tnl *ip6gre_tunnel_locate(struct net *net,
goto failed_free;

ip6gre_tnl_link_config(nt, 1);

/* Can use a lockless transmit, unless we generate output sequences */
if (!(nt->parms.o_flags & TUNNEL_SEQ))
dev->features |= NETIF_F_LLTX;

ip6gre_tunnel_link(ign, nt);
return nt;

Expand Down Expand Up @@ -1445,26 +1440,23 @@ static void ip6gre_tunnel_setup(struct net_device *dev)
static void ip6gre_tnl_init_features(struct net_device *dev)
{
struct ip6_tnl *nt = netdev_priv(dev);
__be16 flags;

dev->features |= GRE6_FEATURES;
dev->features |= GRE6_FEATURES | NETIF_F_LLTX;
dev->hw_features |= GRE6_FEATURES;

if (!(nt->parms.o_flags & TUNNEL_SEQ)) {
/* TCP offload with GRE SEQ is not supported, nor
* can we support 2 levels of outer headers requiring
* an update.
*/
if (!(nt->parms.o_flags & TUNNEL_CSUM) ||
nt->encap.type == TUNNEL_ENCAP_NONE) {
dev->features |= NETIF_F_GSO_SOFTWARE;
dev->hw_features |= NETIF_F_GSO_SOFTWARE;
}
flags = nt->parms.o_flags;

/* Can use a lockless transmit, unless we generate
* output sequences
*/
dev->features |= NETIF_F_LLTX;
}
/* TCP offload with GRE SEQ is not supported, nor can we support 2
* levels of outer headers requiring an update.
*/
if (flags & TUNNEL_SEQ)
return;
if (flags & TUNNEL_CSUM && nt->encap.type != TUNNEL_ENCAP_NONE)
return;

dev->features |= NETIF_F_GSO_SOFTWARE;
dev->hw_features |= NETIF_F_GSO_SOFTWARE;
}

static int ip6gre_tunnel_init_common(struct net_device *dev)
Expand Down

0 comments on commit b11ebf2

Please sign in to comment.