[openib-general] [PATCH] mthca: return error if set SRQ limit greater than SRQ size

Jack Morgenstein jackm at mellanox.co.il
Mon Mar 20 07:32:43 PST 2006


Return error if try to set SRQ limit greater than SRQ size.

Signed-off-by: Jack Morgenstein <jackm at mellanox.co.il>

Index: drivers/infiniband/hw/mthca/mthca_srq.c
===================================================================
--- drivers/infiniband/hw/mthca/mthca_srq.c	(revision 5887)
+++ drivers/infiniband/hw/mthca/mthca_srq.c	(working copy)
@@ -354,6 +358,8 @@ int mthca_modify_srq(struct ib_srq *ibsr
 		return -EINVAL;
 
 	if (attr_mask & IB_SRQ_LIMIT) {
+		if (attr->srq_limit > srq->max)
+			return -EINVAL;
 		ret = mthca_ARM_SRQ(dev, srq->srqn, attr->srq_limit, &status);
 		if (ret)
 			return ret;



More information about the general mailing list