From: Cong Wang <amwang@redhat•com>
To: David Laight <David.Laight@ACULAB•COM>
Cc: netdev@vger•kernel.org, Jesse Gross <jesse@nicira•com>,
"David S. Miller" <davem@davemloft•net>
Subject: RE: [PATCH net-next v2] net: adjust skb_gso_segment() for calling in rx path
Date: Wed, 06 Feb 2013 17:30:32 +0800 [thread overview]
Message-ID: <1360143032.23727.8.camel@cr0> (raw)
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B7138@saturn3.aculab.com>
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))) {
>
> Perhaps the caller should be modifying the ip_summed field
> (etc) to match the values expected for a tx skb.
>
This is even uglier, you need to restore ip_summed after calling
skb_gso_segment().
next prev parent reply other threads:[~2013-02-06 9:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-06 2:36 [PATCH net-next v2] net: adjust skb_gso_segment() for calling in rx path Cong Wang
2013-02-06 9:23 ` David Laight
2013-02-06 9:30 ` Cong Wang [this message]
2013-02-06 9:48 ` David Laight
2013-02-06 20:58 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1360143032.23727.8.camel@cr0 \
--to=amwang@redhat$(echo .)com \
--cc=David.Laight@ACULAB$(echo .)COM \
--cc=davem@davemloft$(echo .)net \
--cc=jesse@nicira$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox