netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>, netdev <netdev@vger.kernel.org>
Subject: Re: [RFC] network driver skb allocations
Date: Mon, 03 May 2010 20:49:26 +0100	[thread overview]
Message-ID: <1272916166.27948.62.camel@localhost> (raw)
In-Reply-To: <1272906384.2226.80.camel@edumazet-laptop>

On Mon, 2010-05-03 at 19:06 +0200, Eric Dumazet wrote:
[...]
> Current logic for drivers is to :
> 
> allocate skbs (sk_buff + data) and put them in a ring buffer.

Not all of them.

> When rx interrupt comes, get the skb and give it to stack.
> 
> Allocate a new skb (sk_buff + data) and put it in rx fat ring buffer (511 entries for tg3 )
> 
> This is suboptimal, because sk_buff will probably be cold 512 rx later...
> Also, NUMA info might be wrong : sk_buff should be allocated on current node,
> not on the device preferred node.

This also avoids allocating sk_buffs that are never needed due to GRO or
scattering of jumbo frames.

> Drivers should allocate only the data part for NIC, and at the time of interrupt,
> allocate the skb_buff and link it to buffer filled by NIC.

I think we found that this increases latency, so sfc switches between
page and skb allocations dynamically.

Ben.

> With a prefetch(first_cache_line_of_data) before doing sk_buff allocation and init,
> eth_type_trans() / get_rps_cpus() would be much faster.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


  reply	other threads:[~2010-05-03 19:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-03 17:06 [RFC] network driver skb allocations Eric Dumazet
2010-05-03 19:49 ` Ben Hutchings [this message]
2010-05-03 20:06   ` 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=1272916166.27948.62.camel@localhost \
    --to=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --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).