netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Ben Greear <greearb@candelatech.com>,
	davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] pktgen: Add NOINIT option to leave packet data uninitialized
Date: Fri, 16 May 2014 16:20:35 +0100	[thread overview]
Message-ID: <20140516152035.GE8346@casper.infradead.org> (raw)
In-Reply-To: <1400252935.7973.176.camel@edumazet-glaptop2.roam.corp.google.com>

On 05/16/14 at 08:08am, Eric Dumazet wrote:
> On Fri, 2014-05-16 at 15:50 +0100, Thomas Graf wrote:
> > On 05/16/14 at 07:23am, Eric Dumazet wrote:
> > > pktgen has already a way to send fragments which are not memset for
> > > every packet. We share a 'zero' page for that.
> > > 
> > > So only headers need to be really built for each packet.
> > 
> > Right, F_NOINIT is exclusively for cases where a linear buffer is
> > desired. I don't fully understand the argument of exposing kernel
> > memory as root considering the presence of /dev/mem though.
> > 
> > That said, I understand that this is a special case and that the
> > objective is reachable with non linear skbs already so I'm fine
> > with ignoring this patch and have it linger outside of the tree for
> > whoever has use for it.
> 
> Note that if you really want to save cpu cycles, you might simply avoid
> kfree_skb()/alloc_skb() pair, and reuse the previous skb.
> 
> Yes, pktgen can vary the skb->len, but this doesn't mean we can
> allocate/reserve a big skb->head. Then the cost of initial memset() for
> this skb is peanuts.
> 
> Synch with Jesper because he is trying to save the atomic on skb->users.

I'm aware of the work and I agree. That is perfectly fine if the
produced skbs do not get enqueued and modified. Otherwise the clone
and COW will undo the gain again. I need pktgen to produce large,
linear skbs with a unique flow for each individual packet. Hence this
optimization ;-)

  reply	other threads:[~2014-05-16 15:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16 10:34 [PATCH net-next] pktgen: Add NOINIT option to leave packet data uninitialized Thomas Graf
2014-05-16 13:16 ` Eric Dumazet
2014-05-16 13:28   ` Ben Greear
2014-05-16 14:23     ` Eric Dumazet
2014-05-16 14:50       ` Thomas Graf
2014-05-16 15:08         ` Eric Dumazet
2014-05-16 15:20           ` Thomas Graf [this message]
2014-05-16 15:26             ` Eric Dumazet
2014-05-16 15:39               ` Thomas Graf
2014-05-16 16:15                 ` Eric Dumazet

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=20140516152035.GE8346@casper.infradead.org \
    --to=tgraf@suug.ch \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=greearb@candelatech.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).