]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
IPoIB/cm: Fix interoperability when MTU doesn't match
authorMichael S. Tsirkin <mst@dev.mellanox.co.il>
Wed, 20 Jun 2007 16:22:15 +0000 (19:22 +0300)
committerRoland Dreier <rolandd@cisco.com>
Thu, 21 Jun 2007 20:38:08 +0000 (13:38 -0700)
IPoIB connected mode currently rejects a connection request unless the
supported MTU is >= the local netdevice MTU. This breaks
interoperability with implementations that might have tweaked
IPOIB_CM_MTU, and there's real no longer a reason to do so: this test
is just a leftover from when we did not tweak MTU per-connection.  Fix
this by making the test as permissive as possible.

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/ulp/ipoib/ipoib_cm.c

index c64249f7caedfb697098d47c63df4c776acc69c1..472c632ee52cf6ad5c8a5ec31de5714e81dc1e52 100644 (file)
@@ -759,9 +759,9 @@ static int ipoib_cm_rep_handler(struct ib_cm_id *cm_id, struct ib_cm_event *even
 
        p->mtu = be32_to_cpu(data->mtu);
 
-       if (p->mtu < priv->dev->mtu + IPOIB_ENCAP_LEN) {
-               ipoib_warn(priv, "Rejecting connection: mtu %d < device mtu %d + 4\n",
-                          p->mtu, priv->dev->mtu);
+       if (p->mtu <= IPOIB_ENCAP_LEN) {
+               ipoib_warn(priv, "Rejecting connection: mtu %d <= %d\n",
+                          p->mtu, IPOIB_ENCAP_LEN);
                return -EINVAL;
        }