netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: Steve Wise <swise@opengridcomputing.com>
Cc: Rick Jones <rick.jones2@hp.com>,
	hadi@cyberus.ca, Evgeniy Polyakov <johnpol@2ka.mipt.ru>,
	netdev@vger.kernel.org, Robert Olsson <Robert.Olsson@data.slu.se>
Subject: Re: pktgen question
Date: Mon, 08 Oct 2007 14:57:13 -0700	[thread overview]
Message-ID: <470AA7B9.4070703@candelatech.com> (raw)
In-Reply-To: <470AA48B.4050005@opengridcomputing.com>

Steve Wise wrote:
> 
> 
> Ben Greear wrote:
>> Rick Jones wrote:
>>>>> Perf-wise, you could clone the skbs up front, then deliver them to 
>>>>> the nic in a tight loop.  This would mitigate the added overhead 
>>>>> introduced by calling skb_clone() in the loop doing transmits...
>>>>
>>>> That only works if you are sending a small number of skbs.  You 
>>>> can't pre-clone several minutes worth of 10Gbe traffic
>>>> with any normal amount of RAM.
>>>
>>> Does pktgen really need to allocate anything more than some smallish 
>>> fraction more than the depth of the driver's transmit queue?
>>
>> If you want to send sustained high rates of traffic, for more than
>> just a trivial amount of time, then you either have to play the current
>> trick with the skb_get(), or you have to allocate a real packet each time
>> (maybe with skb_clone() or similar, but it's still more overhead than 
>> the skb_get
>> which only bumps a reference count.)
>>
>> I see no other way, but if you can think of one, please let me know.
>>
> 
> You can keep freed skb's that were cloned on a free list, then reuse 
> them once freed.  You can detect when the driver frees them by adding a 
> destroy function to the skb.  So what will happen is the set of cloned 
> skbs needed will eventually settled down to a constent amount and the 
> amount will be based on the latency involved in transmitting a single 
> skb.  And it should be bounded by the max txq depth.  Yes?  (or am I all 
> wet :)
> 
> So you would pay the overhead of cloning only until you hit this steady 
> state.
> 
> Whatchathink?

This skb recycling can certainly work and has been done several
times before.  It never gets into the kernel though.

Also, still a lot more overhead than incrementing the in-use counter
since you will have to re-initialize the pkt (you don't know what
all the underlying devices might have done to it.)

The number needed would be bound by all of the queues involved.  There
could be several queues if you are running pktgen on virtual devices
(with potential queues between virtual devs and hardware devs).

Still, I at least would be interested in seeing a patch if you put
one together.  You should get buy-in from Robert and/or DaveM if you
want it to have a chance to get into the kernel.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


  reply	other threads:[~2007-10-08 21:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-23 16:12 pktgen question Steve Wise
2007-09-23 17:28 ` Evgeniy Polyakov
2007-09-23 17:55   ` Steve Wise
2007-09-23 18:18     ` jamal
2007-09-24  6:30       ` Ben Greear
2007-09-24 13:54         ` Steve Wise
2007-09-24 14:39           ` Ben Greear
2007-09-24 15:00             ` Steve Wise
2007-09-24 15:37               ` Ben Greear
2007-09-24 18:02                 ` Rick Jones
2007-09-24 18:22                   ` Ben Greear
2007-10-08 21:43                     ` Steve Wise
2007-10-08 21:57                       ` Ben Greear [this message]
2007-10-08 22:22                         ` David Miller
2007-10-08 22:46                           ` Steve Wise
2007-10-08 22:54                             ` David Miller
2007-09-24 15:42           ` Robert Olsson
2007-09-24 17:40           ` 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=470AA7B9.4070703@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=Robert.Olsson@data.slu.se \
    --cc=hadi@cyberus.ca \
    --cc=johnpol@2ka.mipt.ru \
    --cc=netdev@vger.kernel.org \
    --cc=rick.jones2@hp.com \
    --cc=swise@opengridcomputing.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).