public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Bjørn Mork" <bjorn@mork.no>
To: David Laight <David.Laight@ACULAB.COM>
Cc: "'Eric Dumazet'" <eric.dumazet@gmail.com>,
	Jim Baxter <jim_baxter@mentor.com>,
	"linux-usb\@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev\@vger.kernel.org" <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	"kamal\@canonical.com" <kamal@canonical.com>,
	"edumazet\@google.com" <edumazet@google.com>,
	"mszeredi\@suse.cz" <mszeredi@suse.cz>,
	"fw\@strlen.de" <fw@strlen.de>
Subject: Re: skbuff truesize incorrect.
Date: Fri, 23 May 2014 11:48:29 +0200	[thread overview]
Message-ID: <87r43k4yhe.fsf@nemi.mork.no> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1724C490@AcuExch.aculab.com> (David Laight's message of "Fri, 23 May 2014 08:52:13 +0000")

David Laight <David.Laight@ACULAB.COM> writes:

> Since USB bulk data are terminated by a short fragment there is actually
> no need for the URB be long enough for the full message. Provided the
> URB are multiples of the USB message size (1k for USB 3) the message
> can be received into multiple URB - the driver just has to be willing
> to merge URB buffers (as well as split them) when generating the ethernet
> frames.
>
> What the driver needs to do us allocate URB with 2k (or 4k) buffers and
> only allocate the skb when processing the receive data.
> Unfortunately this is a major rework of usb_net.c

Yes, I believe this is the way to go as well.

I have been thinking about it in the context of the cdc_ncm driver.  One
problem with the NCM protocol is that it will have to merge all the
buffers of a "NCM Transfer Block" (NTB) before it can process any part
of it.  The protocol puts no restrictions on the internal pointers in a
NTB, so there is no guarantee that we can start at the beginning and
work our way towards the end of it. The contained packets can be
interleaved with index(es) or the index can be at the end etc.

But this should still be possible to parse using a list of shorter
buffers to hold each NTB.

> Note that some of the usb ethernet drivers allocate large skb then
> lie about the truesize.

Hmm, which drivers are these?


Bjørn

  reply	other threads:[~2014-05-23  9:48 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22 19:07 skbuff truesize incorrect Jim Baxter
2014-05-22 19:21 ` David Miller
2014-05-22 20:21   ` Jim Baxter
2014-05-22 20:30     ` Eric Dumazet
2014-05-22 20:58     ` David Miller
2014-05-23  9:21       ` Jim Baxter
2014-05-23  9:27         ` David Laight
2014-05-23 16:46         ` David Miller
2014-05-22 19:25 ` Vlad Yasevich
2014-05-22 19:39   ` Jim Baxter
2014-05-22 19:59     ` Eric Dumazet
2014-05-22 20:21       ` Jim Baxter
2014-05-22 20:58 ` Eric Dumazet
2014-05-22 21:03   ` Eric Dumazet
2014-05-22 21:10     ` David Miller
2014-05-23  7:07       ` Bjørn Mork
2014-05-23  8:58         ` Jim Baxter
2014-05-23  9:33           ` Bjørn Mork
2014-05-23 14:00             ` Eric Dumazet
2014-05-23 15:44             ` Rick Jones
2014-05-23 16:00               ` Eric Dumazet
2014-05-23  8:52   ` David Laight
2014-05-23  9:48     ` Bjørn Mork [this message]
2014-05-23 10:45       ` David Laight
2014-05-23 11:13         ` Jim Baxter
2014-05-23 13:47           ` Eric Dumazet
2014-05-23 15:00             ` Jim Baxter
2014-05-23 15:30             ` David Laight
2014-05-23 15:41               ` Eric Dumazet
2014-05-23 20:18     ` David Miller
2014-05-27 15:23       ` David Laight
2014-05-27 15:52         ` 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=87r43k4yhe.fsf@nemi.mork.no \
    --to=bjorn@mork.no \
    --cc=David.Laight@ACULAB.COM \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=fw@strlen.de \
    --cc=jim_baxter@mentor.com \
    --cc=kamal@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mszeredi@suse.cz \
    --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