[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6026B7139@saturn3.aculab.com>
Date: Wed, 6 Feb 2013 09:48:54 -0000
From: "David Laight" <David.Laight@...LAB.COM>
To: "Cong Wang" <amwang@...hat.com>
Cc: <netdev@...r.kernel.org>, "Jesse Gross" <jesse@...ira.com>,
"David S. Miller" <davem@...emloft.net>
Subject: RE: [PATCH net-next v2] net: adjust skb_gso_segment() for calling in rx path
> On Wed, 2013-02-06 at 09:23 +0000, David Laight wrote:
> > > +/* openvswitch calls this on rx path, so we need a different check.
> > > + */
> > > +static inline bool skb_needs_check(struct sk_buff *skb, bool tx_path)
> > > +{
> > > + if (tx_path)
> > > + return skb->ip_summed != CHECKSUM_PARTIAL;
> > > + else
> > > + return skb->ip_summed == CHECKSUM_NONE;
> > > +}
> > > +
> >
> > That code wants a lot of unlikely() added.
> >
> > It seems wrong to be adding code a very common path for one
> > obscure caller.
>
> Its caller does:
>
> + if (unlikely(skb_needs_check(skb, tx_path))) {
In my experience that isn't enough to get all the sub-tests
of complex conditionals compiled in the desired way.
David
Powered by blists - more mailing lists