netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Flavio Leitner <fleitner@redhat.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, herbert@gondor.hengli.com.au
Subject: Re: [PATCH] net: reset gso header when the copied skb is linearized
Date: Tue, 26 Oct 2010 17:25:11 -0200	[thread overview]
Message-ID: <20101026192511.GA3494@redhat.com> (raw)
In-Reply-To: <20101026.113157.233700961.davem@davemloft.net>

On Tue, Oct 26, 2010 at 11:31:57AM -0700, David Miller wrote:
> From: Flavio Leitner <fleitner@redhat.com>
> Date: Mon, 25 Oct 2010 20:23:18 -0200
> 
> > The gso header is incorrect when the copied skb is
> > linearized. This patch creates another helper function
> > to copy the gso header when it is appropriated
> > 
> > Signed-off-by: Flavio Leitner <fleitner@redhat.com>
> 
> I don't understand why the GSO information should be
> omitted just because we are creating a linearlized
> version of the SKB?

If I understand that correctly, the gso_segs is the number
of GSO segments which are divided in non-linear way. When the
copy is made using that function, the skb turns into a big
one segment inlined. So, the idea of segments is lost and
I'm not seeing how it is going to be divided again. 
Later the NIC drives does, for example:

drivers/net/e1000/e1000_main.c
...
                if (cleaned) {
                        struct sk_buff *skb = buffer_info->skb;
                        unsigned int segs, bytecount;
                        segs = skb_shinfo(skb)->gso_segs ?: 1;
                        /* multiply data chunks by size of * headers */
                        bytecount = ((segs - 1) * skb_headlen(skb)) +
                                    skb->len;
                        total_tx_packets += segs;
                        total_tx_bytes += bytecount;
                }
...

The bytecount there will be wrong because it will multiply 
the old gso_segs X skb_headlen(skb) which will be the entire
skb as the payload is inlined.

I see that there are some places checking for skb_is_gso()
before do something or calculating using that math above.

> The packet still could have a larger than MSS size,
> and thus be composed of multiple actual segments for
> the network.

hopefully I answered this too in my previous comment

thanks,
-- 
Flavio

  reply	other threads:[~2010-10-26 19:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-25 22:23 [PATCH] net: reset gso header when the copied skb is linearized Flavio Leitner
2010-10-26 18:31 ` David Miller
2010-10-26 19:25   ` Flavio Leitner [this message]
2010-10-26 19:28     ` David Miller
2010-10-26 19:38       ` Herbert Xu
2010-11-04 20:35       ` Flavio Leitner

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=20101026192511.GA3494@redhat.com \
    --to=fleitner@redhat.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.hengli.com.au \
    --cc=netdev@vger.kernel.org \
    /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).