[ofa-general] [PATCH V2] mlx4: check for FW version which properly supports resize_cq

Jack Morgenstein jackm at dev.mellanox.co.il
Wed Dec 3 10:20:04 PST 2008


mlx4: check for FW version which properly supports resize_cq.

If the ConnectX cards have earlier FW installed, the resize_cq command
will return -ENOSYS.

Fixes Bugzilla 1415.

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

---
Roland,

I decided to solve the resize_cq problem "locally", and not deal with
the can of worms that my last patch opens.

We already do something similar for qp's (NoErrorCompletion bit)

I did this properly this time (#define in cq.h)

diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c
index 1830849..a637f89 100644
--- a/drivers/infiniband/hw/mlx4/cq.c
+++ b/drivers/infiniband/hw/mlx4/cq.c
@@ -347,6 +347,9 @@ int mlx4_ib_resize_cq(struct ib_cq *ibcq, int entries, struct ib_udata *udata)
 	int outst_cqe;
 	int err;
 
+	if (dev->dev->caps.fw_ver < MLX4_FW_VER_RESIZE_CQ)
+		return -ENOSYS;
+
 	mutex_lock(&cq->resize_mutex);
 
 	if (entries < 1 || entries > dev->dev->caps.max_cqes) {
diff --git a/include/linux/mlx4/cq.h b/include/linux/mlx4/cq.h
index 6f65b2c..af6740d 100644
--- a/include/linux/mlx4/cq.h
+++ b/include/linux/mlx4/cq.h
@@ -64,6 +64,9 @@ struct mlx4_err_cqe {
 	u8			owner_sr_opcode;
 };
 
+/* Which firmware version adds support for Resize CQ */
+#define MLX4_FW_VER_RESIZE_CQ  mlx4_fw_ver(2, 5, 0)
+
 enum {
 	MLX4_CQE_VLAN_PRESENT_MASK	= 1 << 29,
 	MLX4_CQE_QPN_MASK		= 0xffffff,



More information about the general mailing list