aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/ipoib
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@dev.mellanox.co.il>2007-03-21 09:45:05 -0400
committerRoland Dreier <rolandd@cisco.com>2007-03-22 17:40:16 -0400
commit77d8e1efea0e313edc710160c232a6fd2dc9f907 (patch)
treed52442b5807bef8cfb7a8267d1d824012828c569 /drivers/infiniband/ulp/ipoib
parentd04d01b113be5b88418eb30087753c3de0a39fd8 (diff)
IB/ipoib: Fix thinko in packet length checks
The packet length checks in ipoib are broken: we add 4 bytes (IPoIB encapsulation header) when sending a packet, not 20 bytes (hardware address length) to each packet. Therefore, if connected mode is enabled so that the interface MTU is larger than the multicast MTU, IPoIB may end up trying to send too-long multicast packets. For example, multicast is broken if a message of size 2048 bytes is sent on an interface with UD MTU 2048, because 2048 is bigger than the real limit of 2044 but the code tests against the wrong limit of 2060. This patch fixes <https://bugs.openfabrics.org/show_bug.cgi?id=418>, submitted by Scott Weitzenkamp <sweitzen@cisco.com>. Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/ulp/ipoib')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_cm.c2
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_ib.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 467564074e93..e70492db74f6 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -452,7 +452,7 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_
452 skb->len, tx->mtu); 452 skb->len, tx->mtu);
453 ++priv->stats.tx_dropped; 453 ++priv->stats.tx_dropped;
454 ++priv->stats.tx_errors; 454 ++priv->stats.tx_errors;
455 ipoib_cm_skb_too_long(dev, skb, tx->mtu - INFINIBAND_ALEN); 455 ipoib_cm_skb_too_long(dev, skb, tx->mtu - IPOIB_ENCAP_LEN);
456 return; 456 return;
457 } 457 }
458 458
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index f2aa923ddbea..ba0ee5cf2ad7 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -328,9 +328,9 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb,
328 struct ipoib_tx_buf *tx_req; 328 struct ipoib_tx_buf *tx_req;
329 u64 addr; 329 u64 addr;
330 330
331 if (unlikely(skb->len > priv->mcast_mtu + INFINIBAND_ALEN)) { 331 if (unlikely(skb->len > priv->mcast_mtu + IPOIB_ENCAP_LEN)) {
332 ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n", 332 ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n",
333 skb->len, priv->mcast_mtu + INFINIBAND_ALEN); 333 skb->len, priv->mcast_mtu + IPOIB_ENCAP_LEN);
334 ++priv->stats.tx_dropped; 334 ++priv->stats.tx_dropped;
335 ++priv->stats.tx_errors; 335 ++priv->stats.tx_errors;
336 ipoib_cm_skb_too_long(dev, skb, priv->mcast_mtu); 336 ipoib_cm_skb_too_long(dev, skb, priv->mcast_mtu);