netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jamal <hadi@cyberus.ca>
To: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Cc: Krishna Kumar2 <krkumar2@in.ibm.com>,
	Gagan Arneja <gaagaan@gmail.com>,
	netdev@vger.kernel.org, Rick Jones <rick.jones2@hp.com>,
	Sridhar Samudrala <sri@us.ibm.com>,
	David Miller <davem@davemloft.net>,
	Robert Olsson <Robert.Olsson@data.slu.se>
Subject: Re: [WIP][PATCHES] Network xmit batching
Date: Thu, 07 Jun 2007 18:23:16 -0400	[thread overview]
Message-ID: <1181254996.4071.27.camel@localhost> (raw)
In-Reply-To: <20070607161335.GA4987@2ka.mipt.ru>

On Thu, 2007-07-06 at 20:13 +0400, Evgeniy Polyakov wrote:

> Actually I wonder where the devil lives, but I do not see how that
> patchset can improve sending situation.
> Let me clarify: there are two possibilities to send data:
> 1. via batched sending, which runs via queue of packets and performs
> prepare call (which only setups some private flags, no work with 
> hardware) and then sending call.

I believe both are called with no lock. The idea is to avoid the lock
entirely when unneeded. That code may end up finding that the packet
is bogus and throw it out when it deems it useless.
If you followed the discussions on multi-ring, this call is where
i suggested to select the tx ring as well.

> 2. old xmit function (which seems to be unused by kernel now?)
> 

You can change that by turning off _BTX feature in the driver.
For WIP reasons it is on at the moment.

> Btw, prep_queue_frame seems to be always called under tx_lock, but it
> old e1000 xmit function calls it without lock. 

I think both call it without lock.

> Locked case is correct,
> since it accesses private registers via e1000_transfer_dhcp_info() for
> some adapters.

I am unsure about the value of that lock (refer to email to Auke). There
is only one CPU that can enter the tx path and the contention is
minimal.

> So, essentially batched sending is 
> lock
> while ((skb = dequue))
>   send
> unlock
> 
> where queue of skbs are prepared by stack using the same transmit lock.
> 
> Where is a gain?

The amortizing of the lock on tx is where the value is.
Did you see the numbers Evgeniy? ;->
Heres one i can vouch on a dual processor 2GHz that i tested with
pktgen;

----
    1) Original e1000 driver (no batching):
    a) We got a xmit throughput of 362Kpackets/second of 362K with
    the default setup (everything falls on cpu#0).
    b) With tying to CPU#1, i saw 401Kpps.

    2) Repeated the tests with batching patches (as in this commit)
    And got an outstanding 694Kpps throughput.

    5) Repeated #4 with binding to cpu #1.
    And throughput didnt improve that much - was hitting 697Kpps
    I think we are pretty much hitting upper limits here
    ...
----

I am actually testing as we speak on faster hardware - I will post
results shortly.

> Btw, this one forces a smile:
> 	if (unlikely(ret != NETDEV_TX_OK))
> 			return NETDEV_TX_OK;
> 

Dont wanna change the way e1000 behaves. It returns NETDEV_TX_OK even
when it netif_stops; this allows the top layer to exit. 

> P.S. I do not have e1000 hardware to test, the only testing machine has
> r8169 driver.

Send me your shipping address privately and i can send you some.


cheers,
jamal


  reply	other threads:[~2007-06-07 22:23 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-06 13:49 [WIP][PATCHES] Network xmit batching jamal
2007-06-07  6:16 ` Krishna Kumar2
2007-06-07 11:43   ` jamal
2007-06-07 16:13     ` Evgeniy Polyakov
2007-06-07 22:23       ` jamal [this message]
2007-06-08  8:38         ` Evgeniy Polyakov
2007-06-08 11:31           ` jamal
2007-06-08 12:09             ` Evgeniy Polyakov
2007-06-08 13:07               ` jamal
2007-06-08 21:02                 ` Evgeniy Polyakov
2007-06-08  5:05       ` Krishna Kumar2
2007-06-19 13:21     ` Evgeniy Polyakov
2007-06-19 13:33       ` Evgeniy Polyakov
2007-06-19 14:00         ` Evgeniy Polyakov
2007-06-19 14:09           ` Evgeniy Polyakov
2007-06-19 16:32             ` jamal
2007-06-19 16:44               ` Evgeniy Polyakov
2007-06-19 16:28           ` jamal
2007-06-19 16:35             ` Evgeniy Polyakov
2007-06-19 16:45             ` Evgeniy Polyakov
2007-06-19 17:35             ` Robert Olsson
2007-06-19 17:48               ` jamal
2007-06-19 17:55                 ` Evgeniy Polyakov
2007-06-28  0:05                 ` [WIP][PATCHES] Network xmit batching - tg3 support jamal
2007-07-02 21:20                   ` Matt Carlson
2007-07-03  0:21                     ` Michael Chan
2007-07-03 13:26                       ` jamal
2007-07-04  4:19                         ` Krishna Kumar2
2007-07-04 13:22                           ` jamal
2007-07-03 13:09                     ` jamal
2007-07-03 19:31                       ` Matt Carlson
2007-07-04  1:59                         ` jamal
2007-07-03 21:30                       ` David Miller
2007-06-19 22:28               ` [WIP][PATCHES] Network xmit batching David Miller
2007-06-21 15:54                 ` FSCKED clock sources WAS(Re: " jamal
2007-06-21 16:08                   ` jamal
2007-06-21 16:55                     ` Benjamin LaHaise
2007-06-25 16:59                       ` jamal
2007-06-25 17:08                         ` Benjamin LaHaise
2007-06-25 17:16                           ` jamal
2007-06-21 16:45                   ` Evgeniy Polyakov
2007-06-25 16:58                     ` jamal
2007-06-19 16:24       ` jamal
2007-06-21 21:00       ` Rick Jones
2007-06-22  9:59         ` Evgeniy Polyakov
2007-06-25 17:35           ` Rick Jones
2007-06-07  8:42 ` Krishna Kumar2
2007-06-07 12:16   ` jamal
2007-06-08  5:06     ` Krishna Kumar2
2007-06-08 11:14       ` jamal
2007-06-08 11:31         ` Krishna Kumar2
2007-06-08 11:43           ` jamal
2007-06-08 18:00           ` Rick Jones
2007-06-08 17:27     ` Rick Jones
2007-06-09  0:17       ` jamal
2007-06-09  0:40         ` Rick Jones
2007-06-07 22:42 ` jamal

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=1181254996.4071.27.camel@localhost \
    --to=hadi@cyberus.ca \
    --cc=Robert.Olsson@data.slu.se \
    --cc=davem@davemloft.net \
    --cc=gaagaan@gmail.com \
    --cc=johnpol@2ka.mipt.ru \
    --cc=krkumar2@in.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=rick.jones2@hp.com \
    --cc=sri@us.ibm.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).