[ofa-general] [PATCH/RFC] IPoIB: Don't drop multicast packets sent before group is joined

Or Gerlitz ogerlitz at Voltaire.com
Wed Jun 3 05:21:15 PDT 2009


Roland Dreier wrote:
> The IPoIB drops multicast packets if more than 3 are queued while a
> multicast send is pending.  The send queue can easily contain more
> than 3 packets and when the queue is processed only the first 3
> packets will make it and the rest will be dropped.

If we go this way, I went and did the same thing for unicast, patch below. Alternatively we may have both mcast/unicast queues to remain and get their length set by the net.ipvY.neigh.ibX.unres_qlen?
I tested my patch with TCP/UDP netperf/iperf over 2.6.29.1 and things seem to work fine.

Or.


This patch applies the same reasoning and method of "IPoIB: Don't drop 
multicast packets sent before group is joined" to unicast packets.

Signed-off-by: Or Gerlitz <ogerlitz at voltaire.com>

Index: linus-linux-2.6/drivers/infiniband/ulp/ipoib/ipoib.h
===================================================================
--- linus-linux-2.6.orig/drivers/infiniband/ulp/ipoib/ipoib.h
+++ linus-linux-2.6/drivers/infiniband/ulp/ipoib/ipoib.h
@@ -78,8 +78,6 @@ enum {
 
 	IPOIB_NUM_WC		  = 4,
 
-	IPOIB_MAX_PATH_REC_QUEUE  = 3,
-
 	IPOIB_FLAG_OPER_UP	  = 0,
 	IPOIB_FLAG_INITIALIZED	  = 1,
 	IPOIB_FLAG_ADMIN_UP	  = 2,
Index: linus-linux-2.6/drivers/infiniband/ulp/ipoib/ipoib_main.c
===================================================================
--- linus-linux-2.6.orig/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ linus-linux-2.6/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -597,13 +597,7 @@ static void neigh_add_path(struct sk_buf
 				ipoib_neigh_free(dev, neigh);
 				goto err_drop;
 			}
-			if (skb_queue_len(&neigh->queue) < IPOIB_MAX_PATH_REC_QUEUE)
-				__skb_queue_tail(&neigh->queue, skb);
-			else {
-				ipoib_warn(priv, "queue length limit %d. Packet drop.\n",
-					   skb_queue_len(&neigh->queue));
-				goto err_drop;
-			}
+			__skb_queue_tail(&neigh->queue, skb);
 		} else
 			ipoib_send(dev, skb, path->ah, IPOIB_QPN(skb->dst->neighbour->ha));
 	} else {
@@ -689,8 +683,7 @@ static void unicast_arp_send(struct sk_b
 			  be16_to_cpu(path->pathrec.dlid));
 
 		ipoib_send(dev, skb, path->ah, IPOIB_QPN(phdr->hwaddr));
-	} else if ((path->query || !path_rec_start(dev, path)) &&
-		   skb_queue_len(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) {
+	} else if (path->query || !path_rec_start(dev, path)) {
 		/* put pseudoheader back on for next time */
 		skb_push(skb, sizeof *phdr);
 		__skb_queue_tail(&path->queue, skb);
@@ -747,14 +740,9 @@ static int ipoib_start_xmit(struct sk_bu
 			return NETDEV_TX_OK;
 		}
 
-		if (skb_queue_len(&neigh->queue) < IPOIB_MAX_PATH_REC_QUEUE) {
-			spin_lock_irqsave(&priv->lock, flags);
-			__skb_queue_tail(&neigh->queue, skb);
-			spin_unlock_irqrestore(&priv->lock, flags);
-		} else {
-			++dev->stats.tx_dropped;
-			dev_kfree_skb_any(skb);
-		}
+		spin_lock_irqsave(&priv->lock, flags);
+		__skb_queue_tail(&neigh->queue, skb);
+		spin_unlock_irqrestore(&priv->lock, flags);
 	} else {
 		struct ipoib_pseudoheader *phdr =
 			(struct ipoib_pseudoheader *) skb->data;



More information about the general mailing list