virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Jason Wang <jasowang@redhat.com>
Cc: mst@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, davem@davemloft.net
Subject: Re: [net-next RFC] pktgen: don't wait for the device who doesn't free skb immediately after sent
Date: Mon, 3 Dec 2012 08:01:11 -0800	[thread overview]
Message-ID: <20121203080111.74acf7d7@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <2663254.1vRFru9xhh@jason-thinkpad-t430s>

On Mon, 03 Dec 2012 14:45:46 +0800
Jason Wang <jasowang@redhat.com> wrote:

> On Tuesday, November 27, 2012 08:49:19 AM Stephen Hemminger wrote:
> > On Tue, 27 Nov 2012 14:45:13 +0800
> > 
> > Jason Wang <jasowang@redhat.com> wrote:
> > > On 11/27/2012 01:37 AM, Stephen Hemminger wrote:
> > > > On Mon, 26 Nov 2012 15:56:52 +0800
> > > > 
> > > > Jason Wang <jasowang@redhat.com> wrote:
> > > >> Some deivces do not free the old tx skbs immediately after it has been
> > > >> sent
> > > >> (usually in tx interrupt). One such example is virtio-net which
> > > >> optimizes for virt and only free the possible old tx skbs during the
> > > >> next packet sending. This would lead the pktgen to wait forever in the
> > > >> refcount of the skb if no other pakcet will be sent afterwards.
> > > >> 
> > > >> Solving this issue by introducing a new flag IFF_TX_SKB_FREE_DELAY
> > > >> which could notify the pktgen that the device does not free skb
> > > >> immediately after it has been sent and let it not to wait for the
> > > >> refcount to be one.
> > > >> 
> > > >> Signed-off-by: Jason Wang <jasowang@redhat.com>
> > > > 
> > > > Another alternative would be using skb_orphan() and skb->destructor.
> > > > There are other cases where skb's are not freed right away.
> > > > --
> > > > To unsubscribe from this list: send the line "unsubscribe netdev" in
> > > > the body of a message to majordomo@vger.kernel.org
> > > > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > > 
> > > Hi Stephen:
> > > 
> > > Do you mean registering a skb->destructor for pktgen then set and check
> > > bits in skb->tx_flag?
> > 
> > Yes. Register a destructor that does something like update a counter (number
> > of packets pending), then just spin while number of packets pending is over
> > threshold.
> 
> Have some experiments on this, looks like it does not work weel when clone_skb 
> is used. For driver that call skb_orphan() in ndo_start_xmit, the destructor 
> is only called when the first packet were sent, but what we need to know is 
> when the last were sent. Any thoughts on this or we can just introduce another 
> flag (anyway we have something like IFF_TX_SKB_SHARING) ?
> 

The SKB_SHARING flag looks like the best solution then.
Surprisingly, transmit buffer completion is a major bottleneck for 10G
devices, and I suspect more changes will come.

  parent reply	other threads:[~2012-12-03 16:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-26  7:56 [net-next RFC] pktgen: don't wait for the device who doesn't free skb immediately after sent Jason Wang
2012-11-26 17:37 ` Stephen Hemminger
2012-11-27  6:45   ` Jason Wang
2012-11-27 16:49     ` Stephen Hemminger
2012-11-28  6:48       ` Jason Wang
2012-11-28 16:53         ` Stephen Hemminger
2012-11-29 10:13           ` Jason Wang
2012-11-29 11:30             ` Michael S. Tsirkin
2012-11-29 17:21               ` Stephen Hemminger
2012-12-03  6:45       ` Jason Wang
     [not found]       ` <2663254.1vRFru9xhh@jason-thinkpad-t430s>
2012-12-03 16:01         ` Stephen Hemminger [this message]
2012-12-04 12:55           ` Jason Wang

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=20121203080111.74acf7d7@nehalam.linuxnetplumber.net \
    --to=shemminger@vyatta.com \
    --cc=davem@davemloft.net \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.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).