From: Krishna Kumar <krkumar2@in.ibm.com>
To: johnpol@2ka.mipt.ru, kaber@trash.net,
shemminger@linux-foundation.org, davem@davemloft.net,
sri@us.ibm.com
Cc: jagana@us.ibm.com, Robert.Olsson@data.slu.se,
peter.p.waskiewicz.jr@intel.com, herbert@gondor.apana.org.au,
gaagaan@gmail.com, kumarkr@linux.ibm.com, rdreier@cisco.com,
rick.jones2@hp.com, mcarlson@broadcom.com, jeff@garzik.org,
general@lists.openfabrics.org, mchan@broadcom.com, tgraf@suug.ch,
hadi@cyberus.ca, netdev@vger.kernel.org,
Krishna Kumar <krkumar2@in.ibm.com>,
xma@us.ibm.com
Subject: [PATCH 1/9 Rev3] [Doc] HOWTO Documentation for batching
Date: Wed, 08 Aug 2007 15:01:24 +0530 [thread overview]
Message-ID: <20070808093124.15396.69224.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20070808093114.15396.22797.sendpatchset@localhost.localdomain>
Add Documentation describing batching API.
Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
---
Batching_skb_API.txt | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 82 insertions(+)
diff -ruNp ORG/Documentation/networking/Batching_skb_API.txt NEW/Documentation/networking/Batching_skb_API.txt
--- ORG/Documentation/networking/Batching_skb_API.txt 1970-01-01 05:30:00.000000000 +0530
+++ NEW/Documentation/networking/Batching_skb_API.txt 2007-08-07 22:41:55.000000000 +0530
@@ -0,0 +1,82 @@
+ HOWTO for batching skb API support
+ -----------------------------------
+
+Section 1: What is batching skb API ?
+Section 2: How batching API works vs the original API ?
+Section 3: How drivers can support this API ?
+Section 4: How users can work with this API ?
+
+
+Introduction: Kernel support for batching skb
+----------------------------------------------
+
+A new xmit API - hard_start_xmit_batch() is provided in the netdevice layer
+similar to the existing hard_start_xmit() API. Drivers which export this
+API can implement it similar to the hard_start_xmit handler. The new API
+should process multiple skbs (or even one) in a single call while the
+existing hard_start_xmit processes one skb. It is possible for the driver
+writer to re-use most of the code from the existing API in the new API
+without having code duplication.
+
+
+Section 1: What is batching skb API ?
+-------------------------------------
+
+ This API is optionally exported by a driver. The pre-requisite for a
+ driver to use this API is that it should have a reasonably sized
+ hardware queue that can process multiple skbs.
+
+
+Section 2: How batching API works vs the original API ?
+-------------------------------------------------------
+
+ The networking stack gets called from upper layer protocols with a
+ single skb to transmit. This skb is first enqueue'd and an attempt is
+ made to transmit it immediately (via qdisc_run). However, events like
+ tx lock contention, tx queue stopped, etc, can result in the skb not
+ getting sent out and it remains in the queue. When the next xmit is
+ called or when the queue is re-enabled, qdisc_run could potentially
+ find multiple packets in the queue, and iteratively send them all out
+ one-by-one.
+
+ The batching skb API was added to exploit this situation where all
+ skbs can be passed in one shot to the device. This reduces driver
+ processing, locking at the driver (or in stack for ~LLTX drivers)
+ gets amortized over multiple skbs, and in case of specific drivers
+ where every xmit results in a completion processing (like IPoIB),
+ optimizations can be made in the driver to request a completion for
+ only the last skb that was sent which results in saving interrupts
+ for every (but the last) skb that was sent in the same batch.
+
+ Batching can result in significant performance gains for systems that
+ have multiple data stream paths over the same network interface card.
+
+
+Section 3: How drivers can support this API ?
+---------------------------------------------
+
+ The new API - dev->hard_start_xmit_batch(struct net_device *dev),
+ simplistically, can be written almost identically to the regular
+ xmit API except that multiple skbs should be processed by the driver
+ instead of one skb. The new API doesn't get a skb as an argument,
+ instead it picks up all the skbs from dev->skb_blist, where it was
+ added by the core stack, and tries to send them out.
+
+ Batching requires the driver to set dev->hard_start_xmit_batch to the
+ new API implemented for that driver.
+
+
+Section 4: How users can work with this API ?
+---------------------------------------------
+
+ Batching could be disabled for a particular device, e.g. on desktop
+ systems if only one stream of network activity for that device is
+ taking place, since performance could be slightly affected due to
+ extra processing that batching adds (unless packets are getting
+ sent fast resulting in stopped queue's). Batching can be enabled if
+ more than one stream of network activity per device is being done,
+ e.g. on servers; or even desktop usage with multiple browser, chat,
+ file transfer sessions, etc.
+
+ Per device batching can be enabled/disabled using ethtool, where
+ passing 1 enables batching and passing 0 disables batching.
next prev parent reply other threads:[~2007-08-08 9:30 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-08 9:31 [ofa-general] [PATCH 0/9 Rev3] Implement batching skb API and support in IPoIB Krishna Kumar
2007-08-08 9:31 ` Krishna Kumar [this message]
2007-08-08 9:31 ` [PATCH 2/9 Rev3] [core] Add skb_blist & hard_start_xmit_batch Krishna Kumar
2007-08-08 10:59 ` [ofa-general] " Stephen Hemminger
2007-08-08 11:24 ` Krishna Kumar2
2007-08-08 12:01 ` Evgeniy Polyakov
2007-08-09 3:09 ` Krishna Kumar2
2007-08-08 9:31 ` [PATCH 3/9 Rev3] [sched] Modify qdisc_run to support batching Krishna Kumar
2007-08-08 12:14 ` [ofa-general] " Evgeniy Polyakov
2007-08-09 3:13 ` Krishna Kumar2
2007-08-08 14:05 ` Patrick McHardy
2007-08-08 15:26 ` [ofa-general] " jamal
2007-08-09 4:06 ` Krishna Kumar2
2007-08-08 9:31 ` [PATCH 4/9 Rev3] [ethtool] Add ethtool support Krishna Kumar
2007-08-08 9:32 ` [ofa-general] [PATCH 5/9 Rev3] [IPoIB] Header file changes Krishna Kumar
2007-08-08 9:32 ` [ofa-general] [PATCH 6/9 Rev3] [IPoIB] CM & Multicast changes Krishna Kumar
2007-08-08 9:32 ` [ofa-general] [PATCH 7/9 Rev3] [IPoIB] Verb changes Krishna Kumar
2007-08-08 9:32 ` [PATCH 8/9 Rev3] [IPoIB] Post and work completion handler changes Krishna Kumar
2007-08-08 9:32 ` [PATCH 9/9 Rev3] [IPoIB] Implement the new batching API Krishna Kumar
2007-08-08 10:49 ` [ofa-general] Re: [PATCH 0/9 Rev3] Implement batching skb API and support in IPoIB David Miller
2007-08-08 11:09 ` Krishna Kumar2
2007-08-08 22:01 ` [ofa-general] " David Miller
2007-08-09 4:19 ` Krishna Kumar2
2007-08-09 4:27 ` David Miller
2007-08-09 6:26 ` Krishna Kumar2
2007-08-08 13:42 ` [ofa-general] " Herbert Xu
2007-08-08 15:14 ` jamal
2007-08-08 20:55 ` Stephen Hemminger
2007-08-08 22:40 ` jamal
2007-08-08 22:22 ` David Miller
2007-08-08 22:53 ` jamal
2007-08-09 0:06 ` Shirley Ma
2007-08-09 3:19 ` [ofa-general] " Krishna Kumar2
2007-08-14 9:02 ` Krishna Kumar2
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=20070808093124.15396.69224.sendpatchset@localhost.localdomain \
--to=krkumar2@in.ibm.com \
--cc=Robert.Olsson@data.slu.se \
--cc=davem@davemloft.net \
--cc=gaagaan@gmail.com \
--cc=general@lists.openfabrics.org \
--cc=hadi@cyberus.ca \
--cc=herbert@gondor.apana.org.au \
--cc=jagana@us.ibm.com \
--cc=jeff@garzik.org \
--cc=johnpol@2ka.mipt.ru \
--cc=kaber@trash.net \
--cc=kumarkr@linux.ibm.com \
--cc=mcarlson@broadcom.com \
--cc=mchan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=peter.p.waskiewicz.jr@intel.com \
--cc=rdreier@cisco.com \
--cc=rick.jones2@hp.com \
--cc=shemminger@linux-foundation.org \
--cc=sri@us.ibm.com \
--cc=tgraf@suug.ch \
--cc=xma@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