Patchwork cxgb4: set coalesce parameters on all queues

login
register
mail settings
Submitter Thadeu Lima de Souza Cascardo
Date Jan. 15, 2013, 3:15 p.m.
Message ID <1358262910-23121-1-git-send-email-cascardo@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/212210/
State Accepted
Delegated to: David Miller
Headers show

Comments

Thadeu Lima de Souza Cascardo - Jan. 15, 2013, 3:15 p.m.
The coalesce parameters was set only on the first queue, which caused
interrupt rates to be larger on all the other queues.

This patch allows interrupt rates to be reduced for certain workloads
and colaesce parameters by 41%.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Cc: steved@us.ibm.com
Cc: toml@us.ibm.com
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)
David Miller - Jan. 16, 2013, 8:28 p.m.
From: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Date: Tue, 15 Jan 2013 13:15:10 -0200

> The coalesce parameters was set only on the first queue, which caused
> interrupt rates to be larger on all the other queues.
> 
> This patch allows interrupt rates to be reduced for certain workloads
> and colaesce parameters by 41%.
> 
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 0df1284..53ec2ad 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -1762,9 +1762,20 @@  static int set_coalesce(struct net_device *dev, struct ethtool_coalesce *c)
 {
 	const struct port_info *pi = netdev_priv(dev);
 	struct adapter *adap = pi->adapter;
-
-	return set_rxq_intr_params(adap, &adap->sge.ethrxq[pi->first_qset].rspq,
-			c->rx_coalesce_usecs, c->rx_max_coalesced_frames);
+	struct sge_rspq *q;
+	int i;
+	int r = 0;
+
+	for (i = pi->first_qset; i < pi->first_qset + pi->nqsets; i++) {
+		q = &adap->sge.ethrxq[i].rspq;
+		r = set_rxq_intr_params(adap, q, c->rx_coalesce_usecs,
+			c->rx_max_coalesced_frames);
+		if (r) {
+			dev_err(&dev->dev, "failed to set coalesce %d\n", r);
+			break;
+		}
+	}
+	return r;
 }
 
 static int get_coalesce(struct net_device *dev, struct ethtool_coalesce *c)