From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: Krishna Kumar <krkumar2@in.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,
mcarlson@broadcom.com, kaber@trash.net, jeff@garzik.org,
general@lists.openfabrics.org, netdev@vger.kernel.org,
tgraf@suug.ch, hadi@cyberus.ca, davem@davemloft.net,
mchan@broadcom.com, sri@us.ibm.com
Subject: [ofa-general] Re: [PATCH 03/12 -Rev2] dev.c changes.
Date: Mon, 23 Jul 2007 14:44:28 +0400 [thread overview]
Message-ID: <20070723104428.GC22877@2ka.mipt.ru> (raw)
In-Reply-To: <20070722090525.7787.10432.sendpatchset@K50wks273871wss.in.ibm.com>
Hi Krishna.
On Sun, Jul 22, 2007 at 02:35:25PM +0530, Krishna Kumar (krkumar2@in.ibm.com) wrote:
> diff -ruNp org/net/core/dev.c rev2/net/core/dev.c
> --- org/net/core/dev.c 2007-07-20 07:49:28.000000000 +0530
> +++ rev2/net/core/dev.c 2007-07-21 23:08:33.000000000 +0530
> @@ -875,6 +875,48 @@ void netdev_state_change(struct net_devi
> }
> }
>
> +/*
> + * dev_change_tx_batching - Enable or disable batching for a driver that
> + * supports batching.
> + */
> +int dev_change_tx_batching(struct net_device *dev, unsigned long new_batch_skb)
> +{
> + int ret;
> +
> + if (!dev->hard_start_xmit_batch) {
> + /* Driver doesn't support skb batching */
> + ret = -ENOTSUPP;
> + goto out;
> + }
> +
> + /* Handle invalid argument */
> + if (new_batch_skb < 0) {
> + ret = -EINVAL;
> + goto out;
> + }
> +
> + ret = 0;
> +
> + /* Check if new value is same as the current */
> + if (!!(dev->features & NETIF_F_BATCH_ON) == !!new_batch_skb)
> + goto out;
o_O
Scratched head for too long before understood what it means :)
> + spin_lock(&dev->queue_lock);
> + if (new_batch_skb) {
> + dev->features |= NETIF_F_BATCH_ON;
> + dev->tx_queue_len >>= 1;
> + } else {
> + if (!skb_queue_empty(&dev->skb_blist))
> + skb_queue_purge(&dev->skb_blist);
> + dev->features &= ~NETIF_F_BATCH_ON;
> + dev->tx_queue_len <<= 1;
> + }
> + spin_unlock(&dev->queue_lock);
Hmm, should this also stop interrupts?
--
Evgeniy Polyakov
next prev parent reply other threads:[~2007-07-23 10:44 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-22 9:04 [PATCH 00/12 -Rev2] Implement batching skb API Krishna Kumar
2007-07-22 9:05 ` [ofa-general] [PATCH 01/12 -Rev2] HOWTO documentation for Batching SKB Krishna Kumar
2007-07-22 9:05 ` [PATCH 02/12 -Rev2] Changes to netdevice.h Krishna Kumar
2007-07-22 17:06 ` [ofa-general] " Patrick McHardy
2007-07-23 2:57 ` Krishna Kumar2
2007-07-22 9:05 ` [ofa-general] [PATCH 03/12 -Rev2] dev.c changes Krishna Kumar
2007-07-23 10:44 ` Evgeniy Polyakov [this message]
2007-07-23 11:17 ` [ofa-general] " Krishna Kumar2
2007-07-22 9:05 ` [ofa-general] [PATCH 04/12 -Rev2] Ethtool changes Krishna Kumar
2007-07-22 9:05 ` [ofa-general] [PATCH 05/12 -Rev2] sysfs changes Krishna Kumar
2007-07-22 9:05 ` [ofa-general] [PATCH 06/12 -Rev2] rtnetlink changes Krishna Kumar
2007-07-22 17:10 ` Patrick McHardy
2007-07-23 2:54 ` [ofa-general] " Krishna Kumar2
2007-07-22 9:06 ` [ofa-general] [PATCH 07/12 -Rev2] Change qdisc_run & qdisc_restart API, callers Krishna Kumar
2007-07-22 9:06 ` [ofa-general] [PATCH 08/12 -Rev2] IPoIB include file changes Krishna Kumar
2007-07-22 9:06 ` [ofa-general] [PATCH 09/12 -Rev2] IPoIB verbs changes Krishna Kumar
2007-07-22 9:06 ` [ofa-general] [PATCH 10/12 -Rev2] IPoIB multicast, CM changes Krishna Kumar
2007-07-22 9:06 ` [ofa-general] [PATCH 11/12 -Rev2] IPoIB xmit API addition Krishna Kumar
2007-07-22 9:41 ` Michael S. Tsirkin
2007-07-23 2:53 ` [ofa-general] " Krishna Kumar2
2007-07-23 10:48 ` Evgeniy Polyakov
2007-07-23 11:17 ` Krishna Kumar2
2007-07-22 9:06 ` [ofa-general] [PATCH 12/12 -Rev2] IPoIB xmit internals changes (ipoib_ib.c) Krishna Kumar
2007-07-23 9:53 ` [PATCH 00/12 -Rev2] Implement batching skb API 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=20070723104428.GC22877@2ka.mipt.ru \
--to=johnpol@2ka.mipt.ru \
--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=kaber@trash.net \
--cc=krkumar2@in.ibm.com \
--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=sri@us.ibm.com \
--cc=tgraf@suug.ch \
/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).