More Mellanox mlx5 driver updates for 3.13
Subsystems (4)
cover More Mellanox mlx5 driver updates for 3.13
Hi Roland,
Here are some additional fixes to the mlx5 driver for the 3.13 merge window. The patches should be applied on top of the previous patches that I sent earlier and can be found here:
http://www.mail-archive.com/linux-rdma%40vger.kernel.org/msg17420.html
Eli
Eli Cohen (4):
IB/mlx5: Remove dead code in mr.c
IB/mlx5: Remove "Always false" comparison
IB/mlx5: Update opt param mask for RTS2RTS
mlx5: Use enum to indicate adapter page size
drivers/infiniband/hw/mlx5/cq.c | 2 +- drivers/infiniband/hw/mlx5/mr.c | 10 +++------- drivers/infiniband/hw/mlx5/qp.c | 13 ++++++++----- drivers/infiniband/hw/mlx5/srq.c | 4 ++-- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 2 +- include/linux/mlx5/device.h | 4 ++++ 6 files changed, 19 insertions(+), 16 deletions(-)
Signature · 6 lines
1.8.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/4 IB/mlx5: Remove dead code in mr.c
In reply to a message not in the archiveIn mlx5_mr_cache_init() the size variable is not used so remove it to avoid compiler warnings when running with make W=1.
--- drivers/infiniband/hw/mlx5/mr.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/infiniband/hw/mlx5/mr.c +3 -7
@@ -40,7 +40,6 @@#include "mlx5_ib.h" enum { -DEF_CACHE_SIZE =10 ,MAX_PENDING_REG_MR =8 , };
@@ -550,7 +549,6 @@ int mlx5_mr_cache_init(struct mlx5_ib_dev *dev)struct mlx5_mr_cache *cache = &dev->cache;struct mlx5_cache_ent *ent;int limit; -int size;int err;int i;
@@ -571,13 +569,11 @@ int mlx5_mr_cache_init(struct mlx5_ib_dev *dev) ent->order = i +2 ; ent->dev = dev; -if (dev->mdev.profile->mask &MLX5_PROF_MASK_MR_CACHE ) { - size = dev->mdev.profile->mr_cache[i].size; +if (dev->mdev.profile->mask &MLX5_PROF_MASK_MR_CACHE ) limit = dev->mdev.profile->mr_cache[i].limit; - }else { - size =DEF_CACHE_SIZE ; +else limit =0 ; - } +INIT_WORK (&ent->work, cache_work_func);INIT_DELAYED_WORK (&ent->dwork, delayed_cache_work_func); ent->limit = limit;
Signature · 6 lines
1.8.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 2/4 IB/mlx5: Remove "Always false" comparison
In reply to a message not in the archivemlx5_cur and mlx5_new cannot have negative values so remove the redundant condition.
--- drivers/infiniband/hw/mlx5/qp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/qp.c +1 -1
@@ -1550,7 +1550,7 @@ static int __mlx5_ib_modify_qp(struct ib_qp *ibqp, mlx5_cur =to_mlx5_state (cur_state); mlx5_new =to_mlx5_state (new_state); mlx5_st =to_mlx5_st (ibqp->qp_type); -if (mlx5_cur <0 || mlx5_new <0 || mlx5_st <0 ) +if (mlx5_st <0 ) goto out; optpar =ib_mask_to_mlx5_opt (attr_mask);
Signature · 6 lines
1.8.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/4 IB/mlx5: Update opt param mask for RTS2RTS
In reply to a message not in the archiveRTS to RTS transition should allow update of alternate path.
--- drivers/infiniband/hw/mlx5/qp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/infiniband/hw/mlx5/qp.c +4 -2
@@ -1317,9 +1317,11 @@ static enum mlx5_qp_optpar opt_mask[MLX5_QP_NUM_STATE][MLX5_QP_NUM_STATE][MLX5_QMLX5_QP_OPTPAR_RAE |MLX5_QP_OPTPAR_RWE |MLX5_QP_OPTPAR_RNR_TIMEOUT | - MLX5_QP_OPTPAR_PM_STATE, +MLX5_QP_OPTPAR_PM_STATE | + MLX5_QP_OPTPAR_ALT_ADDR_PATH, [MLX5_QP_ST_UC ] =MLX5_QP_OPTPAR_RWE | - MLX5_QP_OPTPAR_PM_STATE, +MLX5_QP_OPTPAR_PM_STATE | + MLX5_QP_OPTPAR_ALT_ADDR_PATH, [MLX5_QP_ST_UD ] =MLX5_QP_OPTPAR_Q_KEY |MLX5_QP_OPTPAR_SRQN | MLX5_QP_OPTPAR_CQN_RCV,
Signature · 6 lines
1.8.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 4/4 mlx5: Use enum to indicate adapter page size
In reply to a message not in the archiveThe Connect-IB adapter has an inherent page size which equals 4K. Define an new enum that equals the page shift and use it instead of using the value 12 throughout the code.
--- drivers/infiniband/hw/mlx5/cq.c | 2 +- drivers/infiniband/hw/mlx5/qp.c | 5 +++-- drivers/infiniband/hw/mlx5/srq.c | 4 ++-- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 2 +- include/linux/mlx5/device.h | 4 ++++ 5 files changed, 11 insertions(+), 6 deletions(-)
drivers/infiniband/hw/mlx5/cq.c +1 -1
@@ -620,7 +620,7 @@ static int create_cq_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq, }mlx5_fill_page_array (&cq->buf.buf, (*cqb)->pas); - (*cqb)->ctx.log_pg_sz = cq->buf.buf.page_shift -12 ; + (*cqb)->ctx.log_pg_sz = cq->buf.buf.page_shift -MLX5_ADAPTER_PAGE_SHIFT ; *index = dev->mdev.priv.uuari.uars[0 ].index;return 0 ;
drivers/infiniband/hw/mlx5/qp.c +3 -2
@@ -551,7 +551,7 @@ static int create_user_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd, }mlx5_ib_populate_pas (dev, qp->umem, page_shift, (*in)->pas,0 ); (*in)->ctx.log_pg_sz_remote_qpn = -cpu_to_be32 ((page_shift -12 ) <<24 ); +cpu_to_be32 ((page_shift -MLX5_ADAPTER_PAGE_SHIFT ) <<24 ); (*in)->ctx.params2 =cpu_to_be32 (offset <<6 ); (*in)->ctx.qp_counter_set_usr_page =cpu_to_be32 (uar_index);
@@ -648,7 +648,8 @@ static int create_kernel_qp(struct mlx5_ib_dev *dev, goto err_buf; } (*in)->ctx.qp_counter_set_usr_page =cpu_to_be32 (uar_index); - (*in)->ctx.log_pg_sz_remote_qpn =cpu_to_be32 ((qp->buf.page_shift -12 ) <<24 ); + (*in)->ctx.log_pg_sz_remote_qpn = +cpu_to_be32 ((qp->buf.page_shift -MLX5_ADAPTER_PAGE_SHIFT ) <<24 );/* Set "fast registration enabled" for all kernel QPs */ (*in)->ctx.params1 |=cpu_to_be32 (1 <<11 ); (*in)->ctx.sq_crq_size |=cpu_to_be16 (1 <<4 );
drivers/infiniband/hw/mlx5/srq.c +2 -2
@@ -123,7 +123,7 @@ static int create_srq_user(struct ib_pd *pd, struct mlx5_ib_srq *srq, goto err_in; } - (*in)->ctx.log_pg_sz = page_shift -12 ; + (*in)->ctx.log_pg_sz = page_shift -MLX5_ADAPTER_PAGE_SHIFT ; (*in)->ctx.pgoff_cqn =cpu_to_be32 (offset <<26 );return 0 ;
@@ -192,7 +192,7 @@ static int create_srq_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_srq *srq, } srq->wq_sig = !!srq_signature; - (*in)->ctx.log_pg_sz = page_shift -12 ; + (*in)->ctx.log_pg_sz = page_shift -MLX5_ADAPTER_PAGE_SHIFT ;return 0 ;
drivers/net/ethernet/mellanox/mlx5/core/eq.c +1 -1
@@ -354,7 +354,7 @@ int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq, u8 vecidx, in->hdr.opcode =cpu_to_be16 (MLX5_CMD_OP_CREATE_EQ ); in->ctx.log_sz_usr_page =cpu_to_be32 (ilog2 (eq->nent) <<24 | uar->index); in->ctx.intr = vecidx; - in->ctx.log_page_size = eq->buf.page_shift -12 ; + in->ctx.log_page_size = eq->buf.page_shift -MLX5_ADAPTER_PAGE_SHIFT ; in->events_mask =cpu_to_be64 (mask); err =mlx5_cmd_exec (dev, in, inlen, &out,sizeof (out));
include/linux/mlx5/device.h +4 -0
@@ -231,6 +231,10 @@ enum { };enum { +MLX5_ADAPTER_PAGE_SHIFT =12 +}; + +enum {MLX5_CAP_OFF_DCT =41 ,MLX5_CAP_OFF_CMDIF_CSUM =46 , };
Signature · 6 lines
1.8.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html