From: Krishna Kumar <krkumar2@in.ibm.com>
To: johnpol@2ka.mipt.ru, sri@us.ibm.com,
shemminger@linux-foundation.org, davem@davemloft.net,
kaber@trash.net
Cc: jagana@us.ibm.com, Robert.Olsson@data.slu.se, rick.jones2@hp.com,
herbert@gondor.apana.org.au, gaagaan@gmail.com,
kumarkr@linux.ibm.com, rdreier@cisco.com,
peter.p.waskiewicz.jr@intel.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 4/9 Rev3] [ethtool] Add ethtool support
Date: Wed, 08 Aug 2007 15:01:56 +0530 [thread overview]
Message-ID: <20070808093156.15396.80149.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20070808093114.15396.22797.sendpatchset@localhost.localdomain>
Add ethtool support to enable/disable batching.
Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
---
include/linux/ethtool.h | 2 ++
include/linux/netdevice.h | 2 ++
net/core/ethtool.c | 26 ++++++++++++++++++++++++++
3 files changed, 30 insertions(+)
diff -ruNp ORG/include/linux/ethtool.h NEW/include/linux/ethtool.h
--- ORG/include/linux/ethtool.h 2007-08-06 08:25:37.000000000 +0530
+++ NEW/include/linux/ethtool.h 2007-08-07 13:11:19.000000000 +0530
@@ -410,6 +410,8 @@ struct ethtool_ops {
#define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */
#define ETHTOOL_GGSO 0x00000023 /* Get GSO enable (ethtool_value) */
#define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */
+#define ETHTOOL_GBATCH 0x00000024 /* Get Batch (ethtool_value) */
+#define ETHTOOL_SBATCH 0x00000025 /* Set Batch (ethtool_value) */
/* compatibility with older code */
#define SPARC_ETH_GSET ETHTOOL_GSET
diff -ruNp ORG/include/linux/netdevice.h NEW/include/linux/netdevice.h
--- ORG/include/linux/netdevice.h 2007-08-06 08:25:37.000000000 +0530
+++ NEW/include/linux/netdevice.h 2007-08-07 13:11:19.000000000 +0530
@@ -1112,6 +1112,8 @@ extern void dev_set_promiscuity(struct
extern void dev_set_allmulti(struct net_device *dev, int inc);
extern void netdev_state_change(struct net_device *dev);
extern void netdev_features_change(struct net_device *dev);
+extern int dev_change_tx_batch_skb(struct net_device *dev,
+ unsigned long new_batch_skb);
/* Load a device via the kmod */
extern void dev_load(const char *name);
extern void dev_mcast_init(void);
diff -ruNp ORG/net/core/ethtool.c NEW/net/core/ethtool.c
--- ORG/net/core/ethtool.c 2007-08-06 08:25:40.000000000 +0530
+++ NEW/net/core/ethtool.c 2007-08-07 13:11:19.000000000 +0530
@@ -638,6 +638,25 @@ static int ethtool_set_gso(struct net_de
return 0;
}
+static int ethtool_get_batch(struct net_device *dev, char __user *useraddr)
+{
+ struct ethtool_value edata = { ETHTOOL_GBATCH };
+
+ edata.data = dev->skb_blist != NULL;
+ if (copy_to_user(useraddr, &edata, sizeof(edata)))
+ return -EFAULT;
+ return 0;
+}
+
+static int ethtool_set_gso(struct net_device *dev, char __user *useraddr)
+{
+ struct ethtool_value edata;
+
+ if (copy_from_user(&edata, useraddr, sizeof(edata)))
+ return -EFAULT;
+ return dev_change_tx_batch_skb(dev, edata.data);
+}
+
static int ethtool_self_test(struct net_device *dev, char __user *useraddr)
{
struct ethtool_test test;
@@ -817,6 +836,7 @@ int dev_ethtool(struct ifreq *ifr)
case ETHTOOL_GPERMADDR:
case ETHTOOL_GUFO:
case ETHTOOL_GGSO:
+ case ETHTOOL_GBATCH:
break;
default:
if (!capable(CAP_NET_ADMIN))
@@ -935,6 +955,12 @@ int dev_ethtool(struct ifreq *ifr)
case ETHTOOL_SGSO:
rc = ethtool_set_gso(dev, useraddr);
break;
+ case ETHTOOL_GBATCH:
+ rc = ethtool_get_batch(dev, useraddr);
+ break;
+ case ETHTOOL_SBATCH:
+ rc = ethtool_set_batch(dev, useraddr);
+ break;
default:
rc = -EOPNOTSUPP;
}
next prev parent reply other threads:[~2007-08-08 9:34 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 ` [PATCH 1/9 Rev3] [Doc] HOWTO Documentation for batching Krishna Kumar
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 ` Krishna Kumar [this message]
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=20070808093156.15396.80149.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