[ofa-general] [PATCH 16/16 v4] IB/ipoib: Set default CQ moderation parameters

Eli Cohen eli at mellanox.co.il
Wed Jan 30 08:31:57 PST 2008


IB/ipoib: Set default CQ moderation parameters

Set the default params to make sure they are applied. This params
give better performance.

Signed-off-by: Eli Cohen <eli at mellanox.co.il>
---

Bellow are two runs of netperf, the first with moderation params
disabled and the second with modetation params enabled.

command: netperf -H 14.4.3.175 -t UDP_STREAM -- -m 128

1) moderation disabled
UDP UNIDIRECTIONAL SEND TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to
14.4.3.175 (14.4.3.175) port 0 AF_INET
Socket  Message  Elapsed      Messages
Size    Size     Time         Okay Errors   Throughput
bytes   bytes    secs            #      #   10^6bits/sec

114688     128   10.01     3138731      0     321.23
114688           10.01     3138722            321.23

2) moderation set to 10 usec, 16 frames

114688     128   10.00     3747251      0     383.59
114688           10.00     3739630            382.81


drivers/infiniband/ulp/ipoib/ipoib_verbs.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c
index e20f2af..ba21ea6 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c
@@ -34,6 +34,7 @@
  */
 
 #include "ipoib.h"
+#include <linux/ethtool.h>
 
 int ipoib_mcast_attach(struct net_device *dev, u16 mlid, union ib_gid *mgid)
 {
@@ -157,6 +158,7 @@ int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca)
 	};
 
 	int i, ret, size;
+	struct ethtool_coalesce *coal;
 
 	priv->pd = ib_alloc_pd(priv->ca);
 	if (IS_ERR(priv->pd)) {
@@ -185,6 +187,16 @@ int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca)
 		goto out_free_mr;
 	}
 
+	coal = kzalloc(sizeof *coal, GFP_KERNEL);
+	if (coal) {
+		coal->rx_coalesce_usecs = 10;
+		coal->tx_coalesce_usecs = 10;
+		coal->rx_max_coalesced_frames = 16;
+		coal->tx_max_coalesced_frames = 16;
+		dev->ethtool_ops->set_coalesce(dev, coal);
+		kfree(coal);
+	}
+
 	if (ib_req_notify_cq(priv->cq, IB_CQ_NEXT_COMP))
 		goto out_free_cq;
 
-- 
1.5.3.8






More information about the general mailing list