netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jerry Chu <hkchu@google.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Eric Dumazet <edumazet@google.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Or Gerlitz <ogerlitz@mellanox.com>,
	Ben Hutchings <bhutchings@solarflare.com>,
	David Miller <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH v2 net-next] net-gro: Prepare GRO stack for the upcoming tunneling support
Date: Thu, 12 Dec 2013 11:45:29 +0800	[thread overview]
Message-ID: <CAPshTCjrruFcoA3-0E4qjnaHYo6E42-Afh4irmzLQeu-AArMFg@mail.gmail.com> (raw)
In-Reply-To: <1386790638.30495.379.camel@edumazet-glaptop2.roam.corp.google.com>

On Thu, Dec 12, 2013 at 3:37 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Wed, 2013-12-11 at 11:04 -0800, H.K. Jerry Chu wrote:
>
>> -int tcp_gro_complete(struct sk_buff *skb)
>> +int __tcp_gro_complete(struct sk_buff *skb, struct tcphdr *th)
>>  {
>> -     struct tcphdr *th = tcp_hdr(skb);
>> -
>> -     skb->csum_start = skb_transport_header(skb) - skb->head;
>> +     skb->csum_start = (unsigned char *)th - skb->head;
>>       skb->csum_offset = offsetof(struct tcphdr, check);
>>       skb->ip_summed = CHECKSUM_PARTIAL;
>>
>> @@ -251,6 +250,12 @@ int tcp_gro_complete(struct sk_buff *skb)
>>
>>       return 0;
>>  }
>> +EXPORT_SYMBOL(__tcp_gro_complete);
>> +
>> +int tcp_gro_complete(struct sk_buff *skb)
>> +{
>> +     return __tcp_gro_complete(skb,  tcp_hdr(skb));
>> +}
>
>
> I have no idea why you kept this change.
>
> As we said, the transport offset is set, so it looks like a lot of your
> changes can be removed to ease the review

Yes I know but you were the one who suggested not setting the
transport header a while back, and seemed to prefer avoiding the use
of saved headers in skb.

Then you discovered the transport header must be set by the GRO
stack. That leaves the question should I still try to avoid using headers
saved in skb in case you may attempt to get rid of all the header setting
in GRO completely in the future. I decided last night to use the new
way (nhoff). But obviously the other way (to simply use
skb_transport_header to the extent possible) can be easily done and
will avoid much of the code change too. I'll send out v3 soon.

>
> tcp_gro_receive() sets the transport header, so the xxx_complete()
> handlers can rely on it.
>
> The only part that you could keep is the following optim :
>
> - skb->csum_start = skb_transport_header(skb) - skb->head;
> + skb->csum_start = (unsigned char *)th - skb->head;
>
>
>

      reply	other threads:[~2013-12-12  3:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11 19:04 [PATCH v2 net-next] net-gro: Prepare GRO stack for the upcoming tunneling support H.K. Jerry Chu
2013-12-11 19:37 ` Eric Dumazet
2013-12-12  3:45   ` Jerry Chu [this message]

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=CAPshTCjrruFcoA3-0E4qjnaHYo6E42-Afh4irmzLQeu-AArMFg@mail.gmail.com \
    --to=hkchu@google.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).