Problem:  When pkey-index provided > pkey_table_size, the pkey index used
        in sending packets is pkey_index % pkey_table_size (64 for Mellanox 
HCAs).

Signed-off-by: Jack Morgenstein <[EMAIL PROTECTED]>

Index: linux-kernel/infiniband/hw/mthca/mthca_qp.c
===================================================================
--- linux-kernel/infiniband/hw/mthca/mthca_qp.c (revision 3632)
+++ linux-kernel/infiniband/hw/mthca/mthca_qp.c (working copy)
@@ -585,6 +585,13 @@
                                                 IB_QP_STATE));
                return -EINVAL;
        }
+
+       if ((attr_mask & IB_QP_PKEY_INDEX) && 
+            attr->pkey_index >= dev->limits.pkey_table_len) {
+               mthca_dbg(dev, "PKey index (%u) too large. max is %d\n",
+                         attr->pkey_index,dev->limits.pkey_table_len-1); 
+               return -EINVAL;
+       }
 
        mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL);
        if (IS_ERR(mailbox))
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to