[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070723104428.GC22877@2ka.mipt.ru>
Date: Mon, 23 Jul 2007 14:44:28 +0400
From: Evgeniy Polyakov <johnpol@....mipt.ru>
To: Krishna Kumar <krkumar2@...ibm.com>
Cc: davem@...emloft.net, rdreier@...co.com, Robert.Olsson@...a.slu.se,
rick.jones2@...com, herbert@...dor.apana.org.au, gaagaan@...il.com,
kumarkr@...ux.ibm.com, peter.p.waskiewicz.jr@...el.com,
mcarlson@...adcom.com, jagana@...ibm.com,
general@...ts.openfabrics.org, netdev@...r.kernel.org,
tgraf@...g.ch, jeff@...zik.org, sri@...ibm.com, hadi@...erus.ca,
kaber@...sh.net, mchan@...adcom.com, xma@...ibm.com
Subject: Re: [PATCH 03/12 -Rev2] dev.c changes.
Hi Krishna.
On Sun, Jul 22, 2007 at 02:35:25PM +0530, Krishna Kumar (krkumar2@...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
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists