[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140126092228.GF24041@breakpoint.cc>
Date: Sun, 26 Jan 2014 10:22:28 +0100
From: Florian Westphal <fw@...len.de>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: Florian Westphal <fw@...len.de>, netdev@...r.kernel.org
Subject: Re: [PATCH 2/2] net: ip, ipv6: handle gso skbs in forwarding path
Eric Dumazet <eric.dumazet@...il.com> wrote:
> > +static bool ip_exceeds_mtu(const struct sk_buff *skb, unsigned int mtu)
> > +{
> > + unsigned len;
> > +
> > + if (skb->local_df)
> > + return false;
> > + len = skb_is_gso(skb) ? skb_gso_network_seglen(skb) : skb->len;
> > +
> > + return len > mtu;
>
> The function should avoid extra computation/tests for small packets.
>
> if (skb->len <= mtu || skb->local_df)
> return false;
Good idea! Will change it as per your suggestion.
> if (skb_is_gso(skb) && skb_gso_network_seglen(skb) <= mtu)
> return false;
>
> return true;
>
> > +}
> > +
> > +/* called if GSO skb needs to be fragmented on forward. */
> > +static int ip_forward_finish_gso(struct sk_buff *skb)
> > +{
> > + struct sk_buff *segs = skb_gso_segment(skb, 0);
>
> 0 is very pessimistic.
>
> Have you tried :
>
> netdev_features_t features = netif_skb_features(skb);
> struct sk_buff *segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK);
No. I'll see if this works for me, then include it in V2.
Thanks Eric.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists