IB/mlx4: Exposing modify CQ callback to uverbs layer
authorYonatan Cohen <yonatanc@mellanox.com>
Mon, 13 Nov 2017 08:51:14 +0000 (10:51 +0200)
committerDoug Ledford <dledford@redhat.com>
Mon, 13 Nov 2017 21:59:22 +0000 (16:59 -0500)
Exposed mlx4_ib_modify_cq to be called from ib device
verb list.

Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com>
Reviewed-by: Majd Dibbiny <majd@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/mlx4/main.c
drivers/infiniband/hw/mlx4/mlx4_ib.h
include/linux/mlx4/cq.h

index d8f0b94f1dc446cc9ae0a994f21ced9d03c17e01..28c10ffc19e216e0d008c37b015a044d191b5fe9 100644 (file)
@@ -2750,6 +2750,9 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
        ibdev->ib_dev.get_dev_fw_str    = get_fw_ver_str;
        ibdev->ib_dev.disassociate_ucontext = mlx4_ib_disassociate_ucontext;
 
+       ibdev->ib_dev.uverbs_ex_cmd_mask |=
+               (1ull << IB_USER_VERBS_EX_CMD_MODIFY_CQ);
+
        if ((dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_RSS) &&
            ((mlx4_ib_port_link_layer(&ibdev->ib_dev, 1) ==
            IB_LINK_LAYER_ETHERNET) ||
index 719dae354066eb3bb43ac94dfd474803a3ee696e..e14919c15b06e620dad56a91587928f06e1939e7 100644 (file)
@@ -47,6 +47,7 @@
 #include <linux/mlx4/device.h>
 #include <linux/mlx4/doorbell.h>
 #include <linux/mlx4/qp.h>
+#include <linux/mlx4/cq.h>
 
 #define MLX4_IB_DRV_NAME       "mlx4_ib"
 
index 09cebe528488e18c8561b27f2f18eade1f51c356..508e8cc5ee860b67d4025d378ce4eba886f215c4 100644 (file)
@@ -136,6 +136,9 @@ enum {
        MLX4_CQE_BAD_FCS                 = 1 << 4,
 };
 
+#define MLX4_MAX_CQ_PERIOD (BIT(16) - 1)
+#define MLX4_MAX_CQ_COUNT (BIT(16) - 1)
+
 static inline void mlx4_cq_arm(struct mlx4_cq *cq, u32 cmd,
                               void __iomem *uar_page,
                               spinlock_t *doorbell_lock)