netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 1/2] net/ethtool: Add new coalescing parameter for queue
@ 2015-12-08  4:42 kan.liang
  2015-12-08  4:42 ` [RFC 2/2] i40e/ethtool: support per queue coalesce getting/setting kan.liang
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: kan.liang @ 2015-12-08  4:42 UTC (permalink / raw)
  To: netdev, davem, bwh
  Cc: jesse.brandeburg, andi, f.fainelli, alexander.duyck,
	jeffrey.t.kirsher, shannon.nelson, carolyn.wyborny,
	donald.c.skidmore, mitch.a.williams, ogerlitz, edumazet, jiri,
	sfeldma, gospo, sasha.levin, dsahern, tj, cascardo, corbet,
	Kan Liang

From: Kan Liang <kan.liang@intel.com>

Intrdouce "queue" option for coalesce getting and setting.
For coalesce getting, only the coalescing parameters from specific
queue will be passed to user space.
For coalesce setting, the coalescing parameters will only be applied to
specific queue.
If the queue is set to -1, the coalescing parameters will apply to all
queues.

Signed-off-by: Kan Liang <kan.liang@intel.com>
---
 include/uapi/linux/ethtool.h | 2 ++
 net/core/ethtool.c           | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index cd16291..f4fc18b 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -384,6 +384,7 @@ struct ethtool_modinfo {
  *	a TX interrupt, when the packet rate is above @pkt_rate_high.
  * @rate_sample_interval: How often to do adaptive coalescing packet rate
  *	sampling, measured in seconds.  Must not be zero.
+ * @queue: The specific queue which coalescing parameters apply to.
  *
  * Each pair of (usecs, max_frames) fields specifies that interrupts
  * should be coalesced until
@@ -434,6 +435,7 @@ struct ethtool_coalesce {
 	__u32	tx_coalesce_usecs_high;
 	__u32	tx_max_coalesced_frames_high;
 	__u32	rate_sample_interval;
+	__s32	queue;
 };
 
 /**
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 29edf74..fa8ab7a 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -1123,10 +1123,16 @@ static noinline_for_stack int ethtool_get_coalesce(struct net_device *dev,
 						   void __user *useraddr)
 {
 	struct ethtool_coalesce coalesce = { .cmd = ETHTOOL_GCOALESCE };
+	struct ethtool_coalesce tmp = { .queue = -1 };
 
 	if (!dev->ethtool_ops->get_coalesce)
 		return -EOPNOTSUPP;
 
+	if (copy_from_user(&tmp, useraddr, sizeof(coalesce)))
+		return -EFAULT;
+
+	coalesce.queue = tmp.queue;
+
 	dev->ethtool_ops->get_coalesce(dev, &coalesce);
 
 	if (copy_to_user(useraddr, &coalesce, sizeof(coalesce)))
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-12-12  0:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-08  4:42 [RFC 1/2] net/ethtool: Add new coalescing parameter for queue kan.liang
2015-12-08  4:42 ` [RFC 2/2] i40e/ethtool: support per queue coalesce getting/setting kan.liang
2015-12-08 18:02 ` [RFC 1/2] net/ethtool: Add new coalescing parameter for queue Shannon Nelson
2015-12-08 19:00   ` Ben Hutchings
2015-12-08 19:43     ` Liang, Kan
2015-12-08 19:45       ` Ben Hutchings
2015-12-12  0:40     ` David Miller
2015-12-08 19:39   ` Liang, Kan
2015-12-08 18:15 ` Florian Fainelli
2015-12-08 19:40   ` Liang, Kan

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).