Move QP code to be under mlx5_ib responsibility
Subsystems (7)
cover Move QP code to be under mlx5_ib responsibility
From: Leon Romanovsky <[email protected]>
Hi,
This series introduces simplified version of mlx5 command interface, refactors the code to disconnect mlx5_core from QP logic and moves qp.c to be under mlx5_ib responsibilities.
Next series will convert mlx5_core to this new interface, so at this point I tried to keep the amount of changes to the minimum.
Thanks
Leon Romanovsky (13):
net/mlx5: Provide simplified command interfaces net/mlx5: Open-code create and destroy QP calls net/mlx5: Remove empty QP and CQ events handlers net/mlx5: Open-code modify QP in steering module net/mlx5: Open-code modify QP in the FPGA module net/mlx5: Open-code modify QP in the IPoIB module net/mlx5: Remove extra indirection while storing QPN net/mlx5: Replace hand written QP context struct with automatic
getters
net/mlx5: Remove Q counter low level helper APIs RDMA/mlx5: Delete Q counter allocations command net/mlx5: Delete not-used cmd header
RDMA/mlx5: Alphabetically sort build artifacts net/mlx5: Move QP logic to mlx5_ib
drivers/infiniband/hw/mlx5/Makefile | 28 +-
drivers/infiniband/hw/mlx5/cmd.c | 17 -
drivers/infiniband/hw/mlx5/cmd.h | 2 -
drivers/infiniband/hw/mlx5/cq.c | 3 +-
drivers/infiniband/hw/mlx5/devx.c | 10 +-
drivers/infiniband/hw/mlx5/mad.c | 1 -
drivers/infiniband/hw/mlx5/main.c | 94 ++++--
drivers/infiniband/hw/mlx5/mlx5_ib.h | 3 +-
drivers/infiniband/hw/mlx5/odp.c | 3 +-
drivers/infiniband/hw/mlx5/qp.c | 47 ++-
drivers/infiniband/hw/mlx5/qp.h | 46 +++
.../core/qp.c => infiniband/hw/mlx5/qpc.c} | 304 +++++-------------
drivers/infiniband/hw/mlx5/srq_cmd.c | 2 +-
.../net/ethernet/mellanox/mlx5/core/Makefile | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/cq.c | 1 -
.../net/ethernet/mellanox/mlx5/core/debugfs.c | 57 ++--
.../net/ethernet/mellanox/mlx5/core/en_main.c | 39 ++-
.../ethernet/mellanox/mlx5/core/en_stats.c | 35 +-
drivers/net/ethernet/mellanox/mlx5/core/eq.c | 1 -
.../ethernet/mellanox/mlx5/core/fpga/cmd.c | 1 -
.../ethernet/mellanox/mlx5/core/fpga/conn.c | 136 +++-----
.../ethernet/mellanox/mlx5/core/fpga/conn.h | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/fw.c | 1 -
.../net/ethernet/mellanox/mlx5/core/health.c | 1 -
.../ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 150 +++++----
.../ethernet/mellanox/mlx5/core/ipoib/ipoib.h | 6 +-
.../mellanox/mlx5/core/ipoib/ipoib_vlan.c | 19 +-
.../mellanox/mlx5/core/lib/port_tun.c | 1 -
.../net/ethernet/mellanox/mlx5/core/main.c | 4 -
drivers/net/ethernet/mellanox/mlx5/core/mcg.c | 1 -
drivers/net/ethernet/mellanox/mlx5/core/mr.c | 1 -
.../ethernet/mellanox/mlx5/core/pagealloc.c | 1 -
drivers/net/ethernet/mellanox/mlx5/core/pd.c | 1 -
drivers/net/ethernet/mellanox/mlx5/core/rl.c | 1 -
.../mellanox/mlx5/core/steering/dr_send.c | 58 ++--
.../mellanox/mlx5/core/steering/dr_types.h | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/uar.c | 1 -
include/linux/mlx5/cmd.h | 51 ---
include/linux/mlx5/driver.h | 15 +-
include/linux/mlx5/qp.h | 49 ---
40 files changed, 496 insertions(+), 701 deletions(-)
create mode 100644 drivers/infiniband/hw/mlx5/qp.h
rename drivers/{net/ethernet/mellanox/mlx5/core/qp.c => infiniband/hw/mlx5/qpc.c} (55%)
delete mode 100644 include/linux/mlx5/cmd.h--
2.25.2
PATCH 1/13 net/mlx5: Provide simplified command interfaces
From: Leon Romanovsky <[email protected]>
Many mlx5_cmd_exec() callers are not interested in the output from that command or have standard in/out structures. Those callers simply allocate those structure on the stack and use sizeof() to provide in/out arguments.
In this naive approach provide simplified versions of mlx5_cmd_exec().
--- include/linux/mlx5/driver.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)
include/linux/mlx5/driver.h +13 -0
@@ -903,6 +903,19 @@ int mlx5_cmd_exec_cb(struct mlx5_async_ctx *ctx, void *in, int in_size,int mlx5_cmd_exec (struct mlx5_core_dev *dev,void *in,int in_size,void *out,int out_size); + +#define mlx5_cmd_exec_inout (dev, ifc_cmd, in, out) \ + ({ \ + mlx5_cmd_exec(dev, in, MLX5_ST_SZ_BYTES(ifc_cmd##_in), out, \ + MLX5_ST_SZ_BYTES(ifc_cmd##_out)); \ + }) + +#define mlx5_cmd_exec_in (dev, ifc_cmd, in) \ + ({ \ + u32 _out[MLX5_ST_SZ_DW(ifc_cmd##_out)] = {}; \ + mlx5_cmd_exec_inout(dev, ifc_cmd, in, _out); \ + }) +int mlx5_cmd_exec_polling (struct mlx5_core_dev *dev,void *in,int in_size,void *out,int out_size);void mlx5_cmd_mbox_status (void *out,u8 *status,u32 *syndrome);
Signature · 1 line
2.25.2
PATCH 2/13 net/mlx5: Open-code create and destroy QP calls
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
FPGA, IPoIB and SW steering don't need anything from the mlx5_core_create_qp() and mlx5_core_destroy_qp() except calls to mlx5_cmd_exec().
Let's open-code it, so we will be able to move qp.c to mlx5_ib.
--- .../ethernet/mellanox/mlx5/core/fpga/conn.c | 24 ++++++++------- .../ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 30 +++++++++---------- .../mellanox/mlx5/core/steering/dr_send.c | 18 +++++++---- 3 files changed, 39 insertions(+), 33 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c +13 -11
@@ -534,8 +534,9 @@ static int mlx5_fpga_conn_create_qp(struct mlx5_fpga_conn *conn, unsigned int tx_size, unsigned int rx_size) {struct mlx5_fpga_device *fdev = conn->fdev; +u32 out[MLX5_ST_SZ_DW (create_qp_out)] = {};struct mlx5_core_dev *mdev = fdev->mdev; -u32 temp_qpc[MLX5_ST_SZ_DW (qpc)] = {0 }; +u32 temp_qpc[MLX5_ST_SZ_DW (qpc)] = {};void *in =NULL , *qpc;int err, inlen;
@@ -600,10 +601,12 @@ static int mlx5_fpga_conn_create_qp(struct mlx5_fpga_conn *conn,mlx5_fill_page_frag_array (&conn->qp.wq_ctrl.buf, (__be64 *)MLX5_ADDR_OF (create_qp_in, in, pas)); - err =mlx5_core_create_qp (mdev, &conn->qp.mqp, in, inlen); +MLX5_SET (create_qp_in, in, opcode,MLX5_CMD_OP_CREATE_QP ); + err =mlx5_cmd_exec (mdev, in, inlen, out,sizeof (out));if (err) goto err_sq_bufs; + conn->qp.mqp.qpn =MLX5_GET (create_qp_out, out, qpn); conn->qp.mqp.event = mlx5_fpga_conn_event;mlx5_fpga_dbg (fdev,"Created QP #0x%x\n" , conn->qp.mqp.qpn);
@@ -658,7 +661,14 @@ static void mlx5_fpga_conn_flush_send_bufs(struct mlx5_fpga_conn *conn)static void mlx5_fpga_conn_destroy_qp (struct mlx5_fpga_conn *conn) { -mlx5_core_destroy_qp (conn->fdev->mdev, &conn->qp.mqp); +struct mlx5_core_dev *dev = conn->fdev->mdev; +u32 in[MLX5_ST_SZ_DW (destroy_qp_in)] = {}; +struct mlx5_core_qp *qp = &conn->qp.mqp; + +MLX5_SET (destroy_qp_in, in, opcode,MLX5_CMD_OP_DESTROY_QP ); +MLX5_SET (destroy_qp_in, in, qpn, qp->qpn); +mlx5_cmd_exec_in (dev, destroy_qp, in); +mlx5_fpga_conn_free_recv_bufs (conn);mlx5_fpga_conn_flush_send_bufs (conn);kvfree (conn->qp.sq.bufs);
@@ -972,19 +982,11 @@ struct mlx5_fpga_conn *mlx5_fpga_conn_create(struct mlx5_fpga_device *fdev,void mlx5_fpga_conn_destroy (struct mlx5_fpga_conn *conn) { -struct mlx5_fpga_device *fdev = conn->fdev; -struct mlx5_core_dev *mdev = fdev->mdev; -int err =0 ; - conn->qp.active = false;tasklet_disable (&conn->cq.tasklet);synchronize_irq (conn->cq.mcq.irqn);mlx5_fpga_destroy_qp (conn->fdev->mdev, conn->fpga_qpn); - err =mlx5_core_qp_modify (mdev,MLX5_CMD_OP_2ERR_QP ,0 ,NULL , - &conn->qp.mqp); -if (err) -mlx5_fpga_warn (fdev,"qp_modify 2ERR failed: %d\n" , err);mlx5_fpga_conn_destroy_qp (conn);mlx5_fpga_conn_destroy_cq (conn);
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c +14 -16
@@ -219,17 +219,12 @@ void mlx5i_uninit_underlay_qp(struct mlx5e_priv *priv)int mlx5i_create_underlay_qp (struct mlx5_core_dev *mdev,struct mlx5_core_qp *qp) { -u32 *in =NULL ; +u32 out[MLX5_ST_SZ_DW (create_qp_out)] = {}; +u32 in[MLX5_ST_SZ_DW (create_qp_in)] = {};void *addr_path;int ret =0 ; -int inlen;void *qpc; - inlen =MLX5_ST_SZ_BYTES (create_qp_in); - in =kvzalloc (inlen,GFP_KERNEL ); -if (!in) -return -ENOMEM ; - qpc =MLX5_ADDR_OF (create_qp_in, in, qpc);MLX5_SET (qpc, qpc, st,MLX5_QP_ST_UD );MLX5_SET (qpc, qpc, pm_state,MLX5_QP_PM_MIGRATED );
@@ -240,20 +235,23 @@ int mlx5i_create_underlay_qp(struct mlx5_core_dev *mdev, struct mlx5_core_qp *qpMLX5_SET (ads, addr_path, vhca_port_num,1 );MLX5_SET (ads, addr_path, grh,1 ); - ret =mlx5_core_create_qp (mdev, qp, in, inlen); -if (ret) { -mlx5_core_err (mdev,"Failed creating IPoIB QP err : %d\n" , ret); - goto out; - } +MLX5_SET (create_qp_in, in, opcode,MLX5_CMD_OP_CREATE_QP ); + ret =mlx5_cmd_exec_inout (mdev, create_qp, in, out); +if (ret) +return ret; -out: -kvfree (in); -return ret; + qp->qpn =MLX5_GET (create_qp_out, out, qpn); + +return 0 ; }void mlx5i_destroy_underlay_qp (struct mlx5_core_dev *mdev,struct mlx5_core_qp *qp) { -mlx5_core_destroy_qp (mdev, qp); +u32 in[MLX5_ST_SZ_DW (destroy_qp_in)] = {}; + +MLX5_SET (destroy_qp_in, in, opcode,MLX5_CMD_OP_DESTROY_QP ); +MLX5_SET (destroy_qp_in, in, qpn, qp->qpn); +mlx5_cmd_exec_in (mdev, destroy_qp, in); }int mlx5i_create_tis (struct mlx5_core_dev *mdev,u32 underlay_qpn,u32 *tisn)
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c +12 -6
@@ -108,6 +108,7 @@ static void dr_qp_event(struct mlx5_core_qp *mqp, int event)static struct mlx5dr_qp *dr_create_rc_qp (struct mlx5_core_dev *mdev,struct dr_qp_init_attr *attr) { +u32 out[MLX5_ST_SZ_DW (create_qp_out)] = {};u32 temp_qpc[MLX5_ST_SZ_DW (qpc)] = {};struct mlx5_wq_param wqp;struct mlx5dr_qp *dr_qp;
@@ -180,13 +181,12 @@ static struct mlx5dr_qp *dr_create_rc_qp(struct mlx5_core_dev *mdev, (__be64 *)MLX5_ADDR_OF (create_qp_in, in, pas)); - err =mlx5_core_create_qp (mdev, &dr_qp->mqp, in, inlen); +MLX5_SET (create_qp_in, in, opcode,MLX5_CMD_OP_CREATE_QP ); + err =mlx5_cmd_exec (mdev, in, inlen, out,sizeof (out)); + dr_qp->mqp.qpn =MLX5_GET (create_qp_out, out, qpn);kfree (in); - -if (err) { -mlx5_core_warn (mdev," Can't create QP\n" ); +if (err) goto err_in; - } dr_qp->mqp.event = dr_qp_event; dr_qp->uar = attr->uar;
@@ -204,7 +204,13 @@ static struct mlx5dr_qp *dr_create_rc_qp(struct mlx5_core_dev *mdev,static void dr_destroy_qp (struct mlx5_core_dev *mdev,struct mlx5dr_qp *dr_qp) { -mlx5_core_destroy_qp (mdev, &dr_qp->mqp); +u32 in[MLX5_ST_SZ_DW (destroy_qp_in)] = {}; +struct mlx5_core_qp *qp = &dr_qp->mqp; + +MLX5_SET (destroy_qp_in, in, opcode,MLX5_CMD_OP_DESTROY_QP ); +MLX5_SET (destroy_qp_in, in, qpn, qp->qpn); +mlx5_cmd_exec_in (mdev, destroy_qp, in); +kfree (dr_qp->sq.wqe_head);mlx5_wq_destroy (&dr_qp->wq_ctrl);kfree (dr_qp);
Signature · 1 line
2.25.2
PATCH 3/13 net/mlx5: Remove empty QP and CQ events handlers
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
The QP and CQ events functions do nothing except printing some debug messages. There is nothing to do with this knowledge and such events, so remove them.
--- .../ethernet/mellanox/mlx5/core/fpga/conn.c | 19 ------------------- .../mellanox/mlx5/core/steering/dr_send.c | 14 -------------- 2 files changed, 33 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c +0 -19
@@ -362,23 +362,6 @@ static void mlx5_fpga_conn_arm_cq(struct mlx5_fpga_conn *conn) conn->fdev->conn_res.uar->map, conn->cq.wq.cc); } -static void mlx5_fpga_conn_cq_event (struct mlx5_core_cq *mcq, -enum mlx5_event event) -{ -struct mlx5_fpga_conn *conn; - - conn = container_of(mcq, struct mlx5_fpga_conn, cq.mcq); -mlx5_fpga_warn (conn->fdev,"CQ event %u on CQ #%u\n" , event, mcq->cqn); -} - -static void mlx5_fpga_conn_event (struct mlx5_core_qp *mqp,int event) -{ -struct mlx5_fpga_conn *conn; - - conn = container_of(mqp, struct mlx5_fpga_conn, qp.mqp); -mlx5_fpga_warn (conn->fdev,"QP event %u on QP #%u\n" , event, mqp->qpn); -} -static inline void mlx5_fpga_conn_cqes (struct mlx5_fpga_conn *conn,unsigned int budget) {
@@ -493,7 +476,6 @@ static int mlx5_fpga_conn_create_cq(struct mlx5_fpga_conn *conn, int cq_size) *conn->cq.mcq.arm_db =0 ; conn->cq.mcq.vector =0 ; conn->cq.mcq.comp = mlx5_fpga_conn_cq_complete; - conn->cq.mcq.event = mlx5_fpga_conn_cq_event; conn->cq.mcq.irqn = irqn; conn->cq.mcq.uar = fdev->conn_res.uar; tasklet_init(&conn->cq.tasklet, mlx5_fpga_conn_cq_tasklet,
@@ -607,7 +589,6 @@ static int mlx5_fpga_conn_create_qp(struct mlx5_fpga_conn *conn, goto err_sq_bufs; conn->qp.mqp.qpn =MLX5_GET (create_qp_out, out, qpn); - conn->qp.mqp.event = mlx5_fpga_conn_event;mlx5_fpga_dbg (fdev,"Created QP #0x%x\n" , conn->qp.mqp.qpn); goto out;
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c +0 -14
@@ -100,11 +100,6 @@ static int dr_poll_cq(struct mlx5dr_cq *dr_cq, int ne)return err ==CQ_POLL_ERR ? err : npolled; } -static void dr_qp_event (struct mlx5_core_qp *mqp,int event) -{ -pr_info ("DR QP event %u on QP #%u\n" , event, mqp->qpn); -} -static struct mlx5dr_qp *dr_create_rc_qp (struct mlx5_core_dev *mdev,struct dr_qp_init_attr *attr) {
@@ -187,7 +182,6 @@ static struct mlx5dr_qp *dr_create_rc_qp(struct mlx5_core_dev *mdev,kfree (in);if (err) goto err_in; - dr_qp->mqp.event = dr_qp_event; dr_qp->uar = attr->uar;return dr_qp;
@@ -695,12 +689,6 @@ static int dr_prepare_qp_to_rts(struct mlx5dr_domain *dmn)return 0 ; } -static void dr_cq_event (struct mlx5_core_cq *mcq, -enum mlx5_event event) -{ -pr_info ("CQ event %u on CQ #%u\n" , event, mcq->cqn); -} -static struct mlx5dr_cq *dr_create_cq (struct mlx5_core_dev *mdev,struct mlx5_uars_page *uar,size_t ncqe)
@@ -761,8 +749,6 @@ static struct mlx5dr_cq *dr_create_cq(struct mlx5_core_dev *mdev, pas = (__be64 *)MLX5_ADDR_OF (create_cq_in, in, pas);mlx5_fill_page_frag_array (&cq->wq_ctrl.buf, pas); - cq->mcq.event = dr_cq_event; - err =mlx5_core_create_cq (mdev, &cq->mcq, in, inlen, out,sizeof (out));kvfree (in);
Signature · 1 line
2.25.2
PATCH 4/13 net/mlx5: Open-code modify QP in steering module
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
Remove dependency on qp.c from SW steering by open coding modify QP interface.
--- .../mellanox/mlx5/core/steering/dr_send.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c +12 -7
@@ -585,8 +585,10 @@ static int dr_modify_qp_rst2init(struct mlx5_core_dev *mdev,MLX5_SET (qpc, qpc, rre,1 );MLX5_SET (qpc, qpc, rwe,1 ); -return mlx5_core_qp_modify (mdev,MLX5_CMD_OP_RST2INIT_QP ,0 , qpc, - &dr_qp->mqp); +MLX5_SET (rst2init_qp_in, in, opcode,MLX5_CMD_OP_RST2INIT_QP ); +MLX5_SET (rst2init_qp_in, in, qpn, dr_qp->mqp.qpn); + +return mlx5_cmd_exec_in (mdev, rst2init_qp, in); } static int dr_cmd_modify_qp_rtr2rts(struct mlx5_core_dev *mdev,
@@ -600,12 +602,13 @@ static int dr_cmd_modify_qp_rtr2rts(struct mlx5_core_dev *mdev,MLX5_SET (rtr2rts_qp_in, in, qpn, dr_qp->mqp.qpn); -MLX5_SET (qpc, qpc, log_ack_req_freq,0 );MLX5_SET (qpc, qpc, retry_count, attr->retry_cnt);MLX5_SET (qpc, qpc, rnr_retry, attr->rnr_retry); -return mlx5_core_qp_modify (mdev,MLX5_CMD_OP_RTR2RTS_QP ,0 , qpc, - &dr_qp->mqp); +MLX5_SET (rtr2rts_qp_in, in, opcode,MLX5_CMD_OP_RTR2RTS_QP ); +MLX5_SET (rtr2rts_qp_in, in, qpn, dr_qp->mqp.qpn); + +return mlx5_cmd_exec_in (mdev, rtr2rts_qp, in); } static int dr_cmd_modify_qp_init2rtr(struct mlx5_core_dev *mdev,
@@ -636,8 +639,10 @@ static int dr_cmd_modify_qp_init2rtr(struct mlx5_core_dev *mdev,MLX5_SET (qpc, qpc, primary_address_path.vhca_port_num, attr->port_num);MLX5_SET (qpc, qpc, min_rnr_nak,1 ); -return mlx5_core_qp_modify (mdev,MLX5_CMD_OP_INIT2RTR_QP ,0 , qpc, - &dr_qp->mqp); +MLX5_SET (init2rtr_qp_in, in, opcode,MLX5_CMD_OP_INIT2RTR_QP ); +MLX5_SET (init2rtr_qp_in, in, qpn, dr_qp->mqp.qpn); + +return mlx5_cmd_exec_in (mdev, init2rtr_qp, in); }static int dr_prepare_qp_to_rts (struct mlx5dr_domain *dmn)
Signature · 1 line
2.25.2
PATCH 5/13 net/mlx5: Open-code modify QP in the FPGA module
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
Remove dependency on qp.c from the FPGA by open coding modify QP interface.
--- .../ethernet/mellanox/mlx5/core/fpga/conn.c | 84 +++++++------------ 1 file changed, 28 insertions(+), 56 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c +28 -56
@@ -657,30 +657,29 @@ static void mlx5_fpga_conn_destroy_qp(struct mlx5_fpga_conn *conn)mlx5_wq_destroy (&conn->qp.wq_ctrl); } -static inline int mlx5_fpga_conn_reset_qp (struct mlx5_fpga_conn *conn) +static int mlx5_fpga_conn_reset_qp (struct mlx5_fpga_conn *conn) {struct mlx5_core_dev *mdev = conn->fdev->mdev; +u32 in[MLX5_ST_SZ_DW (qp_2rst_in)] = {};mlx5_fpga_dbg (conn->fdev,"Modifying QP %u to RST\n" , conn->qp.mqp.qpn); -return mlx5_core_qp_modify (mdev,MLX5_CMD_OP_2RST_QP ,0 ,NULL , - &conn->qp.mqp); +MLX5_SET (qp_2rst_in, in, opcode,MLX5_CMD_OP_2RST_QP ); +MLX5_SET (qp_2rst_in, in, qpn, conn->qp.mqp.qpn); + +return mlx5_cmd_exec_in (mdev, qp_2rst, in); } -static inline int mlx5_fpga_conn_init_qp (struct mlx5_fpga_conn *conn) +static int mlx5_fpga_conn_init_qp (struct mlx5_fpga_conn *conn) { +u32 in[MLX5_ST_SZ_DW (rst2init_qp_in)] = {};struct mlx5_fpga_device *fdev = conn->fdev;struct mlx5_core_dev *mdev = fdev->mdev; -u32 *qpc =NULL ; -int err; +u32 *qpc;mlx5_fpga_dbg (conn->fdev,"Modifying QP %u to INIT\n" , conn->qp.mqp.qpn); - qpc =kzalloc (MLX5_ST_SZ_BYTES (qpc),GFP_KERNEL ); -if (!qpc) { - err = -ENOMEM ; - goto out; - } + qpc =MLX5_ADDR_OF (rst2init_qp_in, in, qpc);MLX5_SET (qpc, qpc, st,MLX5_QP_ST_RC );MLX5_SET (qpc, qpc, pm_state,MLX5_QP_PM_MIGRATED );
@@ -691,32 +690,22 @@ static inline int mlx5_fpga_conn_init_qp(struct mlx5_fpga_conn *conn)MLX5_SET (qpc, qpc, cqn_rcv, conn->cq.mcq.cqn);MLX5_SET64 (qpc, qpc, dbr_addr, conn->qp.wq_ctrl.db.dma); - err =mlx5_core_qp_modify (mdev,MLX5_CMD_OP_RST2INIT_QP ,0 , qpc, - &conn->qp.mqp); -if (err) { -mlx5_fpga_warn (fdev,"qp_modify RST2INIT failed: %d\n" , err); - goto out; - } +MLX5_SET (rst2init_qp_in, in, opcode,MLX5_CMD_OP_RST2INIT_QP ); +MLX5_SET (rst2init_qp_in, in, qpn, conn->qp.mqp.qpn); -out: -kfree (qpc); -return err; +return mlx5_cmd_exec_in (mdev, rst2init_qp, in); } -static inline int mlx5_fpga_conn_rtr_qp (struct mlx5_fpga_conn *conn) +static int mlx5_fpga_conn_rtr_qp (struct mlx5_fpga_conn *conn) { +u32 in[MLX5_ST_SZ_DW (init2rtr_qp_in)] = {};struct mlx5_fpga_device *fdev = conn->fdev;struct mlx5_core_dev *mdev = fdev->mdev; -u32 *qpc =NULL ; -int err; +u32 *qpc;mlx5_fpga_dbg (conn->fdev,"QP RTR\n" ); - qpc =kzalloc (MLX5_ST_SZ_BYTES (qpc),GFP_KERNEL ); -if (!qpc) { - err = -ENOMEM ; - goto out; - } + qpc =MLX5_ADDR_OF (init2rtr_qp_in, in, qpc);MLX5_SET (qpc, qpc, mtu,MLX5_QPC_MTU_1K_BYTES );MLX5_SET (qpc, qpc, log_msg_max, (u8 )MLX5_CAP_GEN (mdev, log_max_msg));
@@ -736,33 +725,22 @@ static inline int mlx5_fpga_conn_rtr_qp(struct mlx5_fpga_conn *conn)MLX5_ADDR_OF (fpga_qpc, conn->fpga_qpc, fpga_ip), MLX5_FLD_SZ_BYTES(qpc, primary_address_path.rgid_rip)); - err =mlx5_core_qp_modify (mdev,MLX5_CMD_OP_INIT2RTR_QP ,0 , qpc, - &conn->qp.mqp); -if (err) { -mlx5_fpga_warn (fdev,"qp_modify RST2INIT failed: %d\n" , err); - goto out; - } +MLX5_SET (init2rtr_qp_in, in, opcode,MLX5_CMD_OP_INIT2RTR_QP ); +MLX5_SET (init2rtr_qp_in, in, qpn, conn->qp.mqp.qpn); -out: -kfree (qpc); -return err; +return mlx5_cmd_exec_in (mdev, init2rtr_qp, in); } -static inline int mlx5_fpga_conn_rts_qp (struct mlx5_fpga_conn *conn) +static int mlx5_fpga_conn_rts_qp (struct mlx5_fpga_conn *conn) {struct mlx5_fpga_device *fdev = conn->fdev; +u32 in[MLX5_ST_SZ_DW (rtr2rts_qp_in)] = {};struct mlx5_core_dev *mdev = fdev->mdev; -u32 *qpc =NULL ; -u32 opt_mask; -int err; +u32 *qpc;mlx5_fpga_dbg (conn->fdev,"QP RTS\n" ); - qpc =kzalloc (MLX5_ST_SZ_BYTES (qpc),GFP_KERNEL ); -if (!qpc) { - err = -ENOMEM ; - goto out; - } + qpc =MLX5_ADDR_OF (rtr2rts_qp_in, in, qpc);MLX5_SET (qpc, qpc, log_ack_req_freq,8 );MLX5_SET (qpc, qpc, min_rnr_nak,0x12 );
@@ -772,17 +750,11 @@ static inline int mlx5_fpga_conn_rts_qp(struct mlx5_fpga_conn *conn)MLX5_SET (qpc, qpc, retry_count,7 );MLX5_SET (qpc, qpc, rnr_retry,7 );/* Infinite retry if RNR NACK */ - opt_mask =MLX5_QP_OPTPAR_RNR_TIMEOUT ; - err =mlx5_core_qp_modify (mdev,MLX5_CMD_OP_RTR2RTS_QP , opt_mask, qpc, - &conn->qp.mqp); -if (err) { -mlx5_fpga_warn (fdev,"qp_modify RST2INIT failed: %d\n" , err); - goto out; - } +MLX5_SET (rtr2rts_qp_in, in, opcode,MLX5_CMD_OP_RTR2RTS_QP ); +MLX5_SET (rtr2rts_qp_in, in, qpn, conn->qp.mqp.qpn); +MLX5_SET (rtr2rts_qp_in, in, opt_param_mask,MLX5_QP_OPTPAR_RNR_TIMEOUT ); -out: -kfree (qpc); -return err; +return mlx5_cmd_exec_in (mdev, rtr2rts_qp, in); }static int mlx5_fpga_conn_connect (struct mlx5_fpga_conn *conn)
Signature · 1 line
2.25.2
PATCH 6/13 net/mlx5: Open-code modify QP in the IPoIB module
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
Remove dependency on qp.c from the IPoIB by open coding modify QP interface.
--- .../ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 76 ++++++++++--------- 1 file changed, 42 insertions(+), 34 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c +42 -34
@@ -161,44 +161,54 @@ int mlx5i_init_underlay_qp(struct mlx5e_priv *priv)struct mlx5_core_dev *mdev = priv->mdev;struct mlx5i_priv *ipriv = priv->ppriv;struct mlx5_core_qp *qp = &ipriv->qp; -struct mlx5_qp_context *context;int ret; -/* QP states */ - context =kzalloc (sizeof (*context),GFP_KERNEL ); -if (!context) -return -ENOMEM ; + { +u32 in[MLX5_ST_SZ_DW (rst2init_qp_in)] = {}; +u32 *qpc; - context->flags =cpu_to_be32 (MLX5_QP_PM_MIGRATED <<11 ); - context->pri_path.port =1 ; - context->pri_path.pkey_index =cpu_to_be16 (ipriv->pkey_index); - context->qkey =cpu_to_be32 (IB_DEFAULT_Q_KEY ); + qpc =MLX5_ADDR_OF (rst2init_qp_in, in, qpc); - ret =mlx5_core_qp_modify (mdev,MLX5_CMD_OP_RST2INIT_QP ,0 , context, qp); -if (ret) { -mlx5_core_err (mdev,"Failed to modify qp RST2INIT, err: %d\n" , ret); - goto err_qp_modify_to_err; - } -memset (context,0 ,sizeof (*context)); +MLX5_SET (qpc, qpc, pm_state,MLX5_QP_PM_MIGRATED ); +MLX5_SET (qpc, qpc, primary_address_path.pkey_index, + ipriv->pkey_index); +MLX5_SET (qpc, qpc, primary_address_path.vhca_port_num,1 ); +MLX5_SET (qpc, qpc, q_key,IB_DEFAULT_Q_KEY ); - ret =mlx5_core_qp_modify (mdev,MLX5_CMD_OP_INIT2RTR_QP ,0 , context, qp); -if (ret) { -mlx5_core_err (mdev,"Failed to modify qp INIT2RTR, err: %d\n" , ret); - goto err_qp_modify_to_err; +MLX5_SET (rst2init_qp_in, in, opcode,MLX5_CMD_OP_RST2INIT_QP ); +MLX5_SET (rst2init_qp_in, in, qpn, qp->qpn); + ret =mlx5_cmd_exec_in (mdev, rst2init_qp, in); +if (ret) + goto err_qp_modify_to_err; } - - ret =mlx5_core_qp_modify (mdev,MLX5_CMD_OP_RTR2RTS_QP ,0 , context, qp); -if (ret) { -mlx5_core_err (mdev,"Failed to modify qp RTR2RTS, err: %d\n" , ret); - goto err_qp_modify_to_err; + { +u32 in[MLX5_ST_SZ_DW (init2rtr_qp_in)] = {}; + +MLX5_SET (init2rtr_qp_in, in, opcode,MLX5_CMD_OP_INIT2RTR_QP ); +MLX5_SET (init2rtr_qp_in, in, qpn, qp->qpn); + ret =mlx5_cmd_exec_in (mdev, init2rtr_qp, in); +if (ret) + goto err_qp_modify_to_err; + } + { +u32 in[MLX5_ST_SZ_DW (rtr2rts_qp_in)] = {}; + +MLX5_SET (rtr2rts_qp_in, in, opcode,MLX5_CMD_OP_RTR2RTS_QP ); +MLX5_SET (rtr2rts_qp_in, in, qpn, qp->qpn); + ret =mlx5_cmd_exec_in (mdev, rtr2rts_qp, in); +if (ret) + goto err_qp_modify_to_err; } - -kfree (context);return 0 ; err_qp_modify_to_err: -mlx5_core_qp_modify (mdev,MLX5_CMD_OP_2ERR_QP ,0 , &context, qp); -kfree (context); + { +u32 in[MLX5_ST_SZ_DW (qp_2err_in)] = {}; + +MLX5_SET (qp_2err_in, in, opcode,MLX5_CMD_OP_2ERR_QP ); +MLX5_SET (qp_2err_in, in, qpn, qp->qpn); +mlx5_cmd_exec_in (mdev, qp_2err, in); + }return ret; }
@@ -206,13 +216,11 @@ void mlx5i_uninit_underlay_qp(struct mlx5e_priv *priv) {struct mlx5i_priv *ipriv = priv->ppriv;struct mlx5_core_dev *mdev = priv->mdev; -struct mlx5_qp_context context; -int err; +u32 in[MLX5_ST_SZ_DW (qp_2rst_in)] = {}; - err =mlx5_core_qp_modify (mdev,MLX5_CMD_OP_2RST_QP ,0 , &context, - &ipriv->qp); -if (err) -mlx5_core_err (mdev,"Failed to modify qp 2RST, err: %d\n" , err); +MLX5_SET (qp_2rst_in, in, opcode,MLX5_CMD_OP_2RST_QP ); +MLX5_SET (qp_2rst_in, in, qpn, ipriv->qp.qpn); +mlx5_cmd_exec_in (mdev, qp_2rst, in); }#define MLX5_QP_ENHANCED_ULP_STATELESS_MODE 2
Signature · 1 line
2.25.2
PATCH 7/13 net/mlx5: Remove extra indirection while storing QPN
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
The FPGA, SW steering and IPoIB need to have only QPN from the mlx5_core_qp struct, so reduce memory footprint by storing QPN directly.
--- .../ethernet/mellanox/mlx5/core/fpga/conn.c | 23 ++++--- .../ethernet/mellanox/mlx5/core/fpga/conn.h | 2 +- .../ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 60 ++++++++++--------- .../ethernet/mellanox/mlx5/core/ipoib/ipoib.h | 6 +- .../mellanox/mlx5/core/ipoib/ipoib_vlan.c | 19 +++--- .../mellanox/mlx5/core/steering/dr_send.c | 19 +++--- .../mellanox/mlx5/core/steering/dr_types.h | 2 +- 7 files changed, 64 insertions(+), 67 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c +11 -12
@@ -165,7 +165,7 @@ static void mlx5_fpga_conn_post_send(struct mlx5_fpga_conn *conn, ctrl->fm_ce_se =MLX5_WQE_CTRL_CQ_UPDATE ; ctrl->opmod_idx_opcode =cpu_to_be32 (((conn->qp.sq.pc &0xffff ) <<8 ) |MLX5_OPCODE_SEND ); - ctrl->qpn_ds =cpu_to_be32 (size | (conn->qp.mqp.qpn <<8 )); + ctrl->qpn_ds =cpu_to_be32 (size | (conn->qp.qpn <<8 )); conn->qp.sq.pc++; conn->qp.sq.bufs[ix] = buf;
@@ -588,8 +588,8 @@ static int mlx5_fpga_conn_create_qp(struct mlx5_fpga_conn *conn,if (err) goto err_sq_bufs; - conn->qp.mqp.qpn =MLX5_GET (create_qp_out, out, qpn); -mlx5_fpga_dbg (fdev,"Created QP #0x%x\n" , conn->qp.mqp.qpn); + conn->qp.qpn =MLX5_GET (create_qp_out, out, qpn); +mlx5_fpga_dbg (fdev,"Created QP #0x%x\n" , conn->qp.qpn); goto out;
@@ -644,10 +644,9 @@ static void mlx5_fpga_conn_destroy_qp(struct mlx5_fpga_conn *conn) {struct mlx5_core_dev *dev = conn->fdev->mdev;u32 in[MLX5_ST_SZ_DW (destroy_qp_in)] = {}; -struct mlx5_core_qp *qp = &conn->qp.mqp;MLX5_SET (destroy_qp_in, in, opcode,MLX5_CMD_OP_DESTROY_QP ); -MLX5_SET (destroy_qp_in, in, qpn, qp->qpn); +MLX5_SET (destroy_qp_in, in, qpn, conn->qp.qpn);mlx5_cmd_exec_in (dev, destroy_qp, in);mlx5_fpga_conn_free_recv_bufs (conn);
@@ -662,10 +661,10 @@ static int mlx5_fpga_conn_reset_qp(struct mlx5_fpga_conn *conn)struct mlx5_core_dev *mdev = conn->fdev->mdev;u32 in[MLX5_ST_SZ_DW (qp_2rst_in)] = {}; -mlx5_fpga_dbg (conn->fdev,"Modifying QP %u to RST\n" , conn->qp.mqp.qpn); +mlx5_fpga_dbg (conn->fdev,"Modifying QP %u to RST\n" , conn->qp.qpn);MLX5_SET (qp_2rst_in, in, opcode,MLX5_CMD_OP_2RST_QP ); -MLX5_SET (qp_2rst_in, in, qpn, conn->qp.mqp.qpn); +MLX5_SET (qp_2rst_in, in, qpn, conn->qp.qpn);return mlx5_cmd_exec_in (mdev, qp_2rst, in); }
@@ -677,7 +676,7 @@ static int mlx5_fpga_conn_init_qp(struct mlx5_fpga_conn *conn)struct mlx5_core_dev *mdev = fdev->mdev;u32 *qpc; -mlx5_fpga_dbg (conn->fdev,"Modifying QP %u to INIT\n" , conn->qp.mqp.qpn); +mlx5_fpga_dbg (conn->fdev,"Modifying QP %u to INIT\n" , conn->qp.qpn); qpc =MLX5_ADDR_OF (rst2init_qp_in, in, qpc);
@@ -691,7 +690,7 @@ static int mlx5_fpga_conn_init_qp(struct mlx5_fpga_conn *conn)MLX5_SET64 (qpc, qpc, dbr_addr, conn->qp.wq_ctrl.db.dma);MLX5_SET (rst2init_qp_in, in, opcode,MLX5_CMD_OP_RST2INIT_QP ); -MLX5_SET (rst2init_qp_in, in, qpn, conn->qp.mqp.qpn); +MLX5_SET (rst2init_qp_in, in, qpn, conn->qp.qpn);return mlx5_cmd_exec_in (mdev, rst2init_qp, in); }
@@ -726,7 +725,7 @@ static int mlx5_fpga_conn_rtr_qp(struct mlx5_fpga_conn *conn) MLX5_FLD_SZ_BYTES(qpc, primary_address_path.rgid_rip));MLX5_SET (init2rtr_qp_in, in, opcode,MLX5_CMD_OP_INIT2RTR_QP ); -MLX5_SET (init2rtr_qp_in, in, qpn, conn->qp.mqp.qpn); +MLX5_SET (init2rtr_qp_in, in, qpn, conn->qp.qpn);return mlx5_cmd_exec_in (mdev, init2rtr_qp, in); }
@@ -751,7 +750,7 @@ static int mlx5_fpga_conn_rts_qp(struct mlx5_fpga_conn *conn)MLX5_SET (qpc, qpc, rnr_retry,7 );/* Infinite retry if RNR NACK */ MLX5_SET (rtr2rts_qp_in, in, opcode,MLX5_CMD_OP_RTR2RTS_QP ); -MLX5_SET (rtr2rts_qp_in, in, qpn, conn->qp.mqp.qpn); +MLX5_SET (rtr2rts_qp_in, in, qpn, conn->qp.qpn);MLX5_SET (rtr2rts_qp_in, in, opt_param_mask,MLX5_QP_OPTPAR_RNR_TIMEOUT );return mlx5_cmd_exec_in (mdev, rtr2rts_qp, in);
@@ -894,7 +893,7 @@ struct mlx5_fpga_conn *mlx5_fpga_conn_create(struct mlx5_fpga_device *fdev,MLX5_SET (fpga_qpc, conn->fpga_qpc, next_rcv_psn,1 );MLX5_SET (fpga_qpc, conn->fpga_qpc, next_send_psn,0 );MLX5_SET (fpga_qpc, conn->fpga_qpc, pkey,MLX5_FPGA_PKEY ); -MLX5_SET (fpga_qpc, conn->fpga_qpc, remote_qpn, conn->qp.mqp.qpn); +MLX5_SET (fpga_qpc, conn->fpga_qpc, remote_qpn, conn->qp.qpn);MLX5_SET (fpga_qpc, conn->fpga_qpc, rnr_retry,7 );MLX5_SET (fpga_qpc, conn->fpga_qpc, retry_count,7 );
drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.h +1 -1
@@ -65,7 +65,7 @@ struct mlx5_fpga_conn {int sgid_index;struct mlx5_wq_qp wq;struct mlx5_wq_ctrl wq_ctrl; -struct mlx5_core_qp mqp; +u32 qpn;struct {spinlock_t lock;/* Protects all SQ state */ unsigned int pc;
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c +31 -29
193 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.h +3 -3
@@ -51,7 +51,7 @@ extern const struct ethtool_ops mlx5i_pkey_ethtool_ops;/* ipoib rdma netdev's private data structure */ struct mlx5i_priv {struct rdma_netdev rn;/* keep this first */ -struct mlx5_core_qp qp; +u32 qpn;bool sub_interface;u32 qkey;u16 pkey_index;
@@ -62,8 +62,8 @@ struct mlx5i_priv {int mlx5i_create_tis (struct mlx5_core_dev *mdev,u32 underlay_qpn,u32 *tisn);/* Underlay QP create/destroy functions */ -int mlx5i_create_underlay_qp (struct mlx5_core_dev *mdev,struct mlx5_core_qp *qp); -void mlx5i_destroy_underlay_qp (struct mlx5_core_dev *mdev,struct mlx5_core_qp *qp); +int mlx5i_create_underlay_qp (struct mlx5e_priv *priv); +void mlx5i_destroy_underlay_qp (struct mlx5_core_dev *mdev,u32 qpn);/* Underlay QP state modification init/uninit functions */ int mlx5i_init_underlay_qp (struct mlx5e_priv *priv);
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c +8 -11
@@ -204,13 +204,13 @@ static int mlx5i_pkey_open(struct net_device *netdev) goto err_release_lock; } - err =mlx5_fs_add_rx_underlay_qpn (mdev, ipriv->qp.qpn); + err =mlx5_fs_add_rx_underlay_qpn (mdev, ipriv->qpn);if (err) {mlx5_core_warn (mdev,"attach child underlay qp to ft failed, %d\n" , err); goto err_unint_underlay_qp; } - err =mlx5i_create_tis (mdev, ipriv->qp.qpn, &epriv->tisn[0 ][0 ]); + err =mlx5i_create_tis (mdev, ipriv->qpn, &epriv->tisn[0 ][0 ]);if (err) {mlx5_core_warn (mdev,"create child tis failed, %d\n" , err); goto err_remove_rx_uderlay_qp;
@@ -230,7 +230,7 @@ static int mlx5i_pkey_open(struct net_device *netdev) err_clear_state_opened_flag:mlx5e_destroy_tis (mdev, epriv->tisn[0 ][0 ]); err_remove_rx_uderlay_qp: -mlx5_fs_remove_rx_underlay_qpn (mdev, ipriv->qp.qpn); +mlx5_fs_remove_rx_underlay_qpn (mdev, ipriv->qpn); err_unint_underlay_qp:mlx5i_uninit_underlay_qp (epriv); err_release_lock:
@@ -253,7 +253,7 @@ static int mlx5i_pkey_close(struct net_device *netdev)clear_bit (MLX5E_STATE_OPENED , &priv->state);netif_carrier_off (priv->netdev); -mlx5_fs_remove_rx_underlay_qpn (mdev, ipriv->qp.qpn); +mlx5_fs_remove_rx_underlay_qpn (mdev, ipriv->qpn);mlx5i_uninit_underlay_qp (priv);mlx5e_deactivate_priv_channels (priv);mlx5e_close_channels (&priv->channels);
@@ -307,23 +307,20 @@ static void mlx5i_pkey_cleanup(struct mlx5e_priv *priv)static int mlx5i_pkey_init_tx (struct mlx5e_priv *priv) { -struct mlx5i_priv *ipriv = priv->ppriv;int err; - err =mlx5i_create_underlay_qp (priv->mdev, &ipriv->qp); -if (err) { + err =mlx5i_create_underlay_qp (priv); +if (err)mlx5_core_warn (priv->mdev,"create child underlay QP failed, %d\n" , err); -return err; - } -return 0 ; +return err; }static void mlx5i_pkey_cleanup_tx (struct mlx5e_priv *priv) {struct mlx5i_priv *ipriv = priv->ppriv; -mlx5i_destroy_underlay_qp (priv->mdev, &ipriv->qp); +mlx5i_destroy_underlay_qp (priv->mdev, ipriv->qpn); }static int mlx5i_pkey_init_rx (struct mlx5e_priv *priv)
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c +9 -10
@@ -178,7 +178,7 @@ static struct mlx5dr_qp *dr_create_rc_qp(struct mlx5_core_dev *mdev,MLX5_SET (create_qp_in, in, opcode,MLX5_CMD_OP_CREATE_QP ); err =mlx5_cmd_exec (mdev, in, inlen, out,sizeof (out)); - dr_qp->mqp.qpn =MLX5_GET (create_qp_out, out, qpn); + dr_qp->qpn =MLX5_GET (create_qp_out, out, qpn);kfree (in);if (err) goto err_in;
@@ -199,10 +199,9 @@ static void dr_destroy_qp(struct mlx5_core_dev *mdev, struct mlx5dr_qp *dr_qp) {u32 in[MLX5_ST_SZ_DW (destroy_qp_in)] = {}; -struct mlx5_core_qp *qp = &dr_qp->mqp;MLX5_SET (destroy_qp_in, in, opcode,MLX5_CMD_OP_DESTROY_QP ); -MLX5_SET (destroy_qp_in, in, qpn, qp->qpn); +MLX5_SET (destroy_qp_in, in, qpn, dr_qp->qpn);mlx5_cmd_exec_in (mdev, destroy_qp, in);kfree (dr_qp->sq.wqe_head);
@@ -242,7 +241,7 @@ static void dr_rdma_segments(struct mlx5dr_qp *dr_qp, u64 remote_addr, MLX5_WQE_CTRL_CQ_UPDATE :0 ; wq_ctrl->opmod_idx_opcode =cpu_to_be32 (((dr_qp->sq.pc &0xffff ) <<8 ) | opcode); - wq_ctrl->qpn_ds =cpu_to_be32 (size | dr_qp->mqp.qpn <<8 ); + wq_ctrl->qpn_ds =cpu_to_be32 (size | dr_qp->qpn <<8 ); wq_raddr = (void *)(wq_ctrl +1 ); wq_raddr->raddr =cpu_to_be64 (remote_addr); wq_raddr->rkey =cpu_to_be32 (rkey);
@@ -586,7 +585,7 @@ static int dr_modify_qp_rst2init(struct mlx5_core_dev *mdev,MLX5_SET (qpc, qpc, rwe,1 );MLX5_SET (rst2init_qp_in, in, opcode,MLX5_CMD_OP_RST2INIT_QP ); -MLX5_SET (rst2init_qp_in, in, qpn, dr_qp->mqp.qpn); +MLX5_SET (rst2init_qp_in, in, qpn, dr_qp->qpn);return mlx5_cmd_exec_in (mdev, rst2init_qp, in); }
@@ -600,13 +599,13 @@ static int dr_cmd_modify_qp_rtr2rts(struct mlx5_core_dev *mdev, qpc =MLX5_ADDR_OF (rtr2rts_qp_in, in, qpc); -MLX5_SET (rtr2rts_qp_in, in, qpn, dr_qp->mqp.qpn); +MLX5_SET (rtr2rts_qp_in, in, qpn, dr_qp->qpn);MLX5_SET (qpc, qpc, retry_count, attr->retry_cnt);MLX5_SET (qpc, qpc, rnr_retry, attr->rnr_retry);MLX5_SET (rtr2rts_qp_in, in, opcode,MLX5_CMD_OP_RTR2RTS_QP ); -MLX5_SET (rtr2rts_qp_in, in, qpn, dr_qp->mqp.qpn); +MLX5_SET (rtr2rts_qp_in, in, qpn, dr_qp->qpn);return mlx5_cmd_exec_in (mdev, rtr2rts_qp, in); }
@@ -620,7 +619,7 @@ static int dr_cmd_modify_qp_init2rtr(struct mlx5_core_dev *mdev, qpc =MLX5_ADDR_OF (init2rtr_qp_in, in, qpc); -MLX5_SET (init2rtr_qp_in, in, qpn, dr_qp->mqp.qpn); +MLX5_SET (init2rtr_qp_in, in, qpn, dr_qp->qpn);MLX5_SET (qpc, qpc, mtu, attr->mtu);MLX5_SET (qpc, qpc, log_msg_max,DR_CHUNK_SIZE_MAX -1 );
@@ -640,7 +639,7 @@ static int dr_cmd_modify_qp_init2rtr(struct mlx5_core_dev *mdev,MLX5_SET (qpc, qpc, min_rnr_nak,1 );MLX5_SET (init2rtr_qp_in, in, opcode,MLX5_CMD_OP_INIT2RTR_QP ); -MLX5_SET (init2rtr_qp_in, in, qpn, dr_qp->mqp.qpn); +MLX5_SET (init2rtr_qp_in, in, qpn, dr_qp->qpn);return mlx5_cmd_exec_in (mdev, init2rtr_qp, in); }
@@ -668,7 +667,7 @@ static int dr_prepare_qp_to_rts(struct mlx5dr_domain *dmn)return ret; rtr_attr.mtu = mtu; - rtr_attr.qp_num = dr_qp->mqp.qpn; + rtr_attr.qp_num = dr_qp->qpn; rtr_attr.min_rnr_timer =12 ; rtr_attr.port_num = port; rtr_attr.sgid_index = gid_index;
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h +1 -1
@@ -990,7 +990,7 @@ struct mlx5dr_qp {struct mlx5_wq_qp wq;struct mlx5_uars_page *uar;struct mlx5_wq_ctrl wq_ctrl; -struct mlx5_core_qp mqp; +u32 qpn;struct {unsigned int pc;unsigned int cc;
Signature · 1 line
2.25.2
PATCH 8/13 net/mlx5: Replace hand written QP context struct with automatic getters
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
By changing debugfs to not use any QP related API, convert the debugfs code to use MLX5_GET() directly to access QP context instead of hand written struct.
--- .../net/ethernet/mellanox/mlx5/core/debugfs.c | 51 ++++++++----------- 1 file changed, 20 insertions(+), 31 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/debugfs.c +20 -31
@@ -202,42 +202,37 @@ void mlx5_cq_debugfs_cleanup(struct mlx5_core_dev *dev)static u64 qp_read_field (struct mlx5_core_dev *dev,struct mlx5_core_qp *qp,int index,int *is_str) { -int outlen =MLX5_ST_SZ_BYTES (query_qp_out); -struct mlx5_qp_context *ctx; +u32 out[MLX5_ST_SZ_BYTES (query_qp_out)] = {}; +u32 in[MLX5_ST_SZ_DW (query_qp_in)] = {};u64 param =0 ; -u32 *out; +int state; +u32 *qpc;int err; -int no_sq; - out =kzalloc (outlen,GFP_KERNEL ); -if (!out) -return param; - - err =mlx5_core_qp_query (dev, qp, out, outlen); -if (err) { -mlx5_core_warn (dev,"failed to query qp err=%d\n" , err); - goto out; - } +MLX5_SET (query_qp_in, in, opcode,MLX5_CMD_OP_QUERY_QP ); +MLX5_SET (query_qp_in, in, qpn, qp->qpn); + err =mlx5_cmd_exec_inout (dev, query_qp, in, out); +if (err) +return 0 ; *is_str =0 ; -/* FIXME: use MLX5_GET rather than mlx5_qp_context manual struct */ - ctx = (struct mlx5_qp_context *)MLX5_ADDR_OF (query_qp_out, out, qpc); - + qpc =MLX5_ADDR_OF (query_qp_out, out, qpc);switch (index) {case QP_PID : param = qp->pid;break ;case QP_STATE : - param = (unsigned long )mlx5_qp_state_str (be32_to_cpu (ctx->flags) >>28 ); + state =MLX5_GET (qpc, qpc, state); + param = (unsigned long )mlx5_qp_state_str (state); *is_str =1 ;break ;case QP_XPORT : - param = (unsigned long )mlx5_qp_type_str ((be32_to_cpu (ctx->flags) >>16 ) &0xff ); + param = (unsigned long )mlx5_qp_type_str (MLX5_GET (qpc, qpc, st)); *is_str =1 ;break ;case QP_MTU : -switch (ctx->mtu_msgmax >>5 ) { +switch (MLX5_GET (qpc, qpc, mtu)) {case IB_MTU_256 : param =256 ;break ;
@@ -258,29 +253,23 @@ static u64 qp_read_field(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp, }break ;case QP_N_RECV : - param =1 << ((ctx->rq_size_stride >>3 ) &0xf ); + param =1 <<MLX5_GET (qpc, qpc, log_rq_size);break ;case QP_RECV_SZ : - param =1 << ((ctx->rq_size_stride &7 ) +4 ); + param =1 << (MLX5_GET (qpc, qpc, log_rq_stride) +4 );break ;case QP_N_SEND : - no_sq =be16_to_cpu (ctx->sq_crq_size) >>15 ; -if (!no_sq) - param =1 << (be16_to_cpu (ctx->sq_crq_size) >>11 ); -else - param =0 ; +if (!MLX5_GET (qpc, qpc, no_sq)) + param =1 <<MLX5_GET (qpc, qpc, log_sq_size);break ;case QP_LOG_PG_SZ : - param = (be32_to_cpu (ctx->log_pg_sz_remote_qpn) >>24 ) &0x1f ; - param +=12 ; + param =MLX5_GET (qpc, qpc, log_page_size) +12 ;break ;case QP_RQPN : - param =be32_to_cpu (ctx->log_pg_sz_remote_qpn) &0xffffff ; + param =MLX5_GET (qpc, qpc, remote_qpn);break ; } -out: -kfree (out);return param; }
Signature · 1 line
2.25.2
PATCH 9/13 net/mlx5: Remove Q counter low level helper APIs
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
mlx5 core users are encouraged to use low level API (mlx5_cmd_exec) without the need of helper functions, do this for q counters, remove helper functions and call mlx5_cmd_exec directly from users.
This will help reduce the total amount of code and reduction of the mlx5_core symbol table.
--- drivers/infiniband/hw/mlx5/main.c | 55 +++++++++++-------- .../net/ethernet/mellanox/mlx5/core/en_main.c | 39 ++++++++----- .../ethernet/mellanox/mlx5/core/en_stats.c | 35 ++++++++---- drivers/net/ethernet/mellanox/mlx5/core/qp.c | 39 ------------- include/linux/mlx5/qp.h | 4 -- 5 files changed, 80 insertions(+), 92 deletions(-)
drivers/infiniband/hw/mlx5/main.c +32 -23
@@ -5411,15 +5411,21 @@ static bool is_mdev_switchdev_mode(const struct mlx5_core_dev *mdev)static void mlx5_ib_dealloc_counters (struct mlx5_ib_dev *dev) { +u32 in[MLX5_ST_SZ_DW (dealloc_q_counter_in)] = {};int num_cnt_ports;int i; num_cnt_ports =is_mdev_switchdev_mode (dev->mdev) ?1 : dev->num_ports; +MLX5_SET (dealloc_q_counter_in, in, opcode, +MLX5_CMD_OP_DEALLOC_Q_COUNTER ); +for (i =0 ; i < num_cnt_ports; i++) { -if (dev->port[i].cnts.set_id_valid) -mlx5_core_dealloc_q_counter (dev->mdev, - dev->port[i].cnts.set_id); +if (dev->port[i].cnts.set_id_valid) { +MLX5_SET (dealloc_q_counter_in, in, counter_set_id, + dev->port[i].cnts.set_id); +mlx5_cmd_exec_in (dev->mdev, dealloc_q_counter, in); + }kfree (dev->port[i].cnts.names);kfree (dev->port[i].cnts.offsets); }
@@ -5610,27 +5616,23 @@ static int mlx5_ib_query_q_counters(struct mlx5_core_dev *mdev, struct rdma_hw_stats *stats, u16 set_id) { - int outlen = MLX5_ST_SZ_BYTES(query_q_counter_out); -void *out; +u32 out[MLX5_ST_SZ_DW (query_q_counter_out)] = {}; +u32 in[MLX5_ST_SZ_DW (query_q_counter_in)] = {};__be32 val;int ret, i; - out =kvzalloc (outlen,GFP_KERNEL ); -if (!out) -return -ENOMEM ; - - ret =mlx5_core_query_q_counter (mdev, set_id,0 , out, outlen); +MLX5_SET (query_q_counter_in, in, opcode,MLX5_CMD_OP_QUERY_Q_COUNTER ); +MLX5_SET (query_q_counter_in, in, counter_set_id, set_id); + ret =mlx5_cmd_exec_inout (mdev, query_q_counter, in, out);if (ret) - goto free; +return ret;for (i =0 ; i < cnts->num_q_counters; i++) { - val = *(__be32 *)(out + cnts->offsets[i]); + val = *(__be32 *)((void *)out + cnts->offsets[i]); stats->value[i] = (u64 )be32_to_cpu (val); } -free: -kvfree (out); -return ret; +return 0 ; } static int mlx5_ib_query_ext_ppcnt_counters(struct mlx5_ib_dev *dev,
@@ -5737,6 +5739,20 @@ static int mlx5_ib_counter_update_stats(struct rdma_counter *counter) counter->stats, counter->id); } +static int mlx5_ib_counter_dealloc (struct rdma_counter *counter) +{ +struct mlx5_ib_dev *dev =to_mdev (counter->device); +u32 in[MLX5_ST_SZ_DW (dealloc_q_counter_in)] = {}; + +if (!counter->id) +return 0 ; + +MLX5_SET (dealloc_q_counter_in, in, opcode, +MLX5_CMD_OP_DEALLOC_Q_COUNTER ); +MLX5_SET (dealloc_q_counter_in, in, counter_set_id, counter->id); +return mlx5_cmd_exec_in (dev->mdev, dealloc_q_counter, in); +} +static int mlx5_ib_counter_bind_qp (struct rdma_counter *counter,struct ib_qp *qp) {
@@ -5760,7 +5776,7 @@ static int mlx5_ib_counter_bind_qp(struct rdma_counter *counter,return 0 ; fail_set_counter: -mlx5_core_dealloc_q_counter (dev->mdev, cnt_set_id); +mlx5_ib_counter_dealloc (counter); counter->id =0 ;return err;
@@ -5771,13 +5787,6 @@ static int mlx5_ib_counter_unbind_qp(struct ib_qp *qp)return mlx5_ib_qp_set_counter (qp,NULL ); } -static int mlx5_ib_counter_dealloc (struct rdma_counter *counter) -{ -struct mlx5_ib_dev *dev =to_mdev (counter->device); - -return mlx5_core_dealloc_q_counter (dev->mdev, counter->id); -} -static int mlx5_ib_rn_get_params (struct ib_device *device,u8 port_num,enum rdma_netdev_t type,struct rdma_netdev_alloc_params *params)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +25 -14
@@ -4997,29 +4997,40 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev)void mlx5e_create_q_counters (struct mlx5e_priv *priv) { +u32 out[MLX5_ST_SZ_DW (alloc_q_counter_out)] = {}; +u32 in[MLX5_ST_SZ_DW (alloc_q_counter_in)] = {};struct mlx5_core_dev *mdev = priv->mdev;int err; - err =mlx5_core_alloc_q_counter (mdev, &priv->q_counter); -if (err) { -mlx5_core_warn (mdev,"alloc queue counter failed, %d\n" , err); - priv->q_counter =0 ; - } +MLX5_SET (alloc_q_counter_in, in, opcode,MLX5_CMD_OP_ALLOC_Q_COUNTER ); + err =mlx5_cmd_exec_inout (mdev, alloc_q_counter, in, out); +if (!err) + priv->q_counter = +MLX5_GET (alloc_q_counter_out, out, counter_set_id); - err =mlx5_core_alloc_q_counter (mdev, &priv->drop_rq_q_counter); -if (err) { -mlx5_core_warn (mdev,"alloc drop RQ counter failed, %d\n" , err); - priv->drop_rq_q_counter =0 ; - } + err =mlx5_cmd_exec_inout (mdev, alloc_q_counter, in, out); +if (!err) + priv->drop_rq_q_counter = +MLX5_GET (alloc_q_counter_out, out, counter_set_id); }void mlx5e_destroy_q_counters (struct mlx5e_priv *priv) { -if (priv->q_counter) -mlx5_core_dealloc_q_counter (priv->mdev, priv->q_counter); +u32 in[MLX5_ST_SZ_DW (dealloc_q_counter_in)] = {}; + +MLX5_SET (dealloc_q_counter_in, in, opcode, +MLX5_CMD_OP_DEALLOC_Q_COUNTER ); +if (priv->q_counter) { +MLX5_SET (dealloc_q_counter_in, in, counter_set_id, + priv->q_counter); +mlx5_cmd_exec_in (priv->mdev, dealloc_q_counter, in); + } -if (priv->drop_rq_q_counter) -mlx5_core_dealloc_q_counter (priv->mdev, priv->drop_rq_q_counter); +if (priv->drop_rq_q_counter) { +MLX5_SET (dealloc_q_counter_in, in, counter_set_id, + priv->drop_rq_q_counter); +mlx5_cmd_exec_in (priv->mdev, dealloc_q_counter, in); + } } static int mlx5e_nic_init(struct mlx5_core_dev *mdev,
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +23 -12
@@ -411,18 +411,29 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(qcnt)static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS (qcnt) {struct mlx5e_qcounter_stats *qcnt = &priv->stats.qcnt; -u32 out[MLX5_ST_SZ_DW (query_q_counter_out)]; - -if (priv->q_counter && - !mlx5_core_query_q_counter (priv->mdev, priv->q_counter,0 , out, -sizeof (out))) - qcnt->rx_out_of_buffer =MLX5_GET (query_q_counter_out, - out, out_of_buffer); -if (priv->drop_rq_q_counter && - !mlx5_core_query_q_counter (priv->mdev, priv->drop_rq_q_counter,0 , - out,sizeof (out))) - qcnt->rx_if_down_packets =MLX5_GET (query_q_counter_out, out, - out_of_buffer); +u32 out[MLX5_ST_SZ_DW (query_q_counter_out)] = {}; +u32 in[MLX5_ST_SZ_DW (query_q_counter_in)] = {}; +int ret; + +MLX5_SET (query_q_counter_in, in, opcode,MLX5_CMD_OP_QUERY_Q_COUNTER ); + +if (priv->q_counter) { +MLX5_SET (query_q_counter_in, in, counter_set_id, + priv->q_counter); + ret =mlx5_cmd_exec_inout (priv->mdev, query_q_counter, in, out); +if (!ret) + qcnt->rx_out_of_buffer =MLX5_GET (query_q_counter_out, + out, out_of_buffer); + } + +if (priv->drop_rq_q_counter) { +MLX5_SET (query_q_counter_in, in, counter_set_id, + priv->drop_rq_q_counter); + ret =mlx5_cmd_exec_inout (priv->mdev, query_q_counter, in, out); +if (!ret) + qcnt->rx_if_down_packets =MLX5_GET (query_q_counter_out, + out, out_of_buffer); + } }#define VNIC_ENV_OFF (c) MLX5_BYTE_OFF(query_vnic_env_out, c)
drivers/net/ethernet/mellanox/mlx5/core/qp.c +0 -39
@@ -680,45 +680,6 @@ void mlx5_core_destroy_sq_tracked(struct mlx5_core_dev *dev, }EXPORT_SYMBOL (mlx5_core_destroy_sq_tracked); -int mlx5_core_alloc_q_counter (struct mlx5_core_dev *dev,u16 *counter_id) -{ -u32 in[MLX5_ST_SZ_DW (alloc_q_counter_in)] = {0 }; -u32 out[MLX5_ST_SZ_DW (alloc_q_counter_out)] = {0 }; -int err; - -MLX5_SET (alloc_q_counter_in, in, opcode,MLX5_CMD_OP_ALLOC_Q_COUNTER ); - err =mlx5_cmd_exec (dev, in,sizeof (in), out,sizeof (out)); -if (!err) - *counter_id =MLX5_GET (alloc_q_counter_out, out, - counter_set_id); -return err; -} -EXPORT_SYMBOL_GPL (mlx5_core_alloc_q_counter); - -int mlx5_core_dealloc_q_counter (struct mlx5_core_dev *dev,u16 counter_id) -{ -u32 in[MLX5_ST_SZ_DW (dealloc_q_counter_in)] = {0 }; -u32 out[MLX5_ST_SZ_DW (dealloc_q_counter_out)] = {0 }; - -MLX5_SET (dealloc_q_counter_in, in, opcode, -MLX5_CMD_OP_DEALLOC_Q_COUNTER ); -MLX5_SET (dealloc_q_counter_in, in, counter_set_id, counter_id); -return mlx5_cmd_exec (dev, in,sizeof (in), out,sizeof (out)); -} -EXPORT_SYMBOL_GPL (mlx5_core_dealloc_q_counter); - -int mlx5_core_query_q_counter (struct mlx5_core_dev *dev,u16 counter_id, -int reset,void *out,int out_size) -{ -u32 in[MLX5_ST_SZ_DW (query_q_counter_in)] = {0 }; - -MLX5_SET (query_q_counter_in, in, opcode,MLX5_CMD_OP_QUERY_Q_COUNTER ); -MLX5_SET (query_q_counter_in, in, clear, reset); -MLX5_SET (query_q_counter_in, in, counter_set_id, counter_id); -return mlx5_cmd_exec (dev, in,sizeof (in), out, out_size); -} -EXPORT_SYMBOL_GPL (mlx5_core_query_q_counter); -struct mlx5_core_rsc_common *mlx5_core_res_hold (struct mlx5_core_dev *dev,int res_num,enum mlx5_res_type res_type)
include/linux/mlx5/qp.h +0 -4
@@ -597,10 +597,6 @@ int mlx5_core_create_sq_tracked(struct mlx5_core_dev *dev, u32 *in, int inlen, struct mlx5_core_qp *sq);void mlx5_core_destroy_sq_tracked (struct mlx5_core_dev *dev,struct mlx5_core_qp *sq); -int mlx5_core_alloc_q_counter (struct mlx5_core_dev *dev,u16 *counter_id); -int mlx5_core_dealloc_q_counter (struct mlx5_core_dev *dev,u16 counter_id); -int mlx5_core_query_q_counter (struct mlx5_core_dev *dev,u16 counter_id, -int reset,void *out,int out_size); struct mlx5_core_rsc_common *mlx5_core_res_hold(struct mlx5_core_dev *dev, int res_num,
Signature · 1 line
2.25.2
PATCH 10/13 RDMA/mlx5: Delete Q counter allocations command
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
Remove mlx5_ib implementation of Q counter allocation logic together with cleaning boolean which controlled validity of the counter. It is not needed, because counter_id == 0 means that counter is not valid.
--- drivers/infiniband/hw/mlx5/cmd.c | 17 --------------- drivers/infiniband/hw/mlx5/cmd.h | 2 -- drivers/infiniband/hw/mlx5/main.c | 31 ++++++++++++++++++---------- drivers/infiniband/hw/mlx5/mlx5_ib.h | 1 - 4 files changed, 20 insertions(+), 31 deletions(-)
drivers/infiniband/hw/mlx5/cmd.c +0 -17
@@ -327,23 +327,6 @@ int mlx5_cmd_xrcd_dealloc(struct mlx5_core_dev *dev, u32 xrcdn, u16 uid)return mlx5_cmd_exec (dev, in,sizeof (in), out,sizeof (out)); } -int mlx5_cmd_alloc_q_counter (struct mlx5_core_dev *dev,u16 *counter_id, -u16 uid) -{ -u32 in[MLX5_ST_SZ_DW (alloc_q_counter_in)] = {0 }; -u32 out[MLX5_ST_SZ_DW (alloc_q_counter_out)] = {0 }; -int err; - -MLX5_SET (alloc_q_counter_in, in, opcode,MLX5_CMD_OP_ALLOC_Q_COUNTER ); -MLX5_SET (alloc_q_counter_in, in, uid, uid); - - err =mlx5_cmd_exec (dev, in,sizeof (in), out,sizeof (out)); -if (!err) - *counter_id =MLX5_GET (alloc_q_counter_out, out, - counter_set_id); -return err; -} -int mlx5_cmd_mad_ifc (struct mlx5_core_dev *dev,const void *inb,void *outb,u16 opmod,u8 port) {
drivers/infiniband/hw/mlx5/cmd.h +0 -2
@@ -61,8 +61,6 @@ int mlx5_cmd_detach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn, u16 uid);int mlx5_cmd_xrcd_alloc (struct mlx5_core_dev *dev,u32 *xrcdn,u16 uid);int mlx5_cmd_xrcd_dealloc (struct mlx5_core_dev *dev,u32 xrcdn,u16 uid); -int mlx5_cmd_alloc_q_counter (struct mlx5_core_dev *dev,u16 *counter_id, -u16 uid);int mlx5_cmd_mad_ifc (struct mlx5_core_dev *dev,const void *inb,void *outb,u16 opmod,u8 port);#endif /* MLX5_IB_CMD_H */
drivers/infiniband/hw/mlx5/main.c +20 -11
@@ -5421,7 +5421,7 @@ static void mlx5_ib_dealloc_counters(struct mlx5_ib_dev *dev) MLX5_CMD_OP_DEALLOC_Q_COUNTER);for (i =0 ; i < num_cnt_ports; i++) { -if (dev->port[i].cnts.set_id_valid) { +if (dev->port[i].cnts.set_id) {MLX5_SET (dealloc_q_counter_in, in, counter_set_id, dev->port[i].cnts.set_id);mlx5_cmd_exec_in (dev->mdev, dealloc_q_counter, in);
@@ -5534,11 +5534,14 @@ static void mlx5_ib_fill_counters(struct mlx5_ib_dev *dev,static int mlx5_ib_alloc_counters (struct mlx5_ib_dev *dev) { +u32 out[MLX5_ST_SZ_DW (alloc_q_counter_out)] = {}; +u32 in[MLX5_ST_SZ_DW (alloc_q_counter_in)] = {};int num_cnt_ports;int err =0 ;int i;bool is_shared; +MLX5_SET (alloc_q_counter_in, in, opcode,MLX5_CMD_OP_ALLOC_Q_COUNTER ); is_shared =MLX5_CAP_GEN (dev->mdev, log_max_uctx) !=0 ; num_cnt_ports =is_mdev_switchdev_mode (dev->mdev) ?1 : dev->num_ports;
@@ -5550,17 +5553,19 @@ static int mlx5_ib_alloc_counters(struct mlx5_ib_dev *dev)mlx5_ib_fill_counters (dev, dev->port[i].cnts.names, dev->port[i].cnts.offsets); - err =mlx5_cmd_alloc_q_counter (dev->mdev, - &dev->port[i].cnts.set_id, - is_shared ? -MLX5_SHARED_RESOURCE_UID :0 ); +MLX5_SET (alloc_q_counter_in, in, uid, + is_shared ?MLX5_SHARED_RESOURCE_UID :0 ); + + err =mlx5_cmd_exec_inout (dev->mdev, alloc_q_counter, in, out);if (err) {mlx5_ib_warn (dev,"couldn't allocate queue counter for port %d, err %d\n" , i +1 , err); goto err_alloc; } - dev->port[i].cnts.set_id_valid = true; + + dev->port[i].cnts.set_id = +MLX5_GET (alloc_q_counter_out, out, counter_set_id); }return 0 ;
@@ -5757,16 +5762,20 @@ static int mlx5_ib_counter_bind_qp(struct rdma_counter *counter, struct ib_qp *qp) {struct mlx5_ib_dev *dev =to_mdev (qp->device); -u16 cnt_set_id =0 ;int err;if (!counter->id) { - err =mlx5_cmd_alloc_q_counter (dev->mdev, - &cnt_set_id, -MLX5_SHARED_RESOURCE_UID ); +u32 out[MLX5_ST_SZ_DW (alloc_q_counter_out)] = {}; +u32 in[MLX5_ST_SZ_DW (alloc_q_counter_in)] = {}; + +MLX5_SET (alloc_q_counter_in, in, opcode, +MLX5_CMD_OP_ALLOC_Q_COUNTER ); +MLX5_SET (alloc_q_counter_in, in, uid,MLX5_SHARED_RESOURCE_UID ); + err =mlx5_cmd_exec_inout (dev->mdev, alloc_q_counter, in, out);if (err)return err; - counter->id = cnt_set_id; + counter->id = +MLX5_GET (alloc_q_counter_out, out, counter_set_id); } err =mlx5_ib_qp_set_counter (qp, counter);
drivers/infiniband/hw/mlx5/mlx5_ib.h +0 -1
@@ -781,7 +781,6 @@ struct mlx5_ib_counters {u32 num_cong_counters;u32 num_ext_ppcnt_counters;u16 set_id; -bool set_id_valid; };struct mlx5_ib_multiport_info ;
Signature · 1 line
2.25.2
PATCH 11/13 net/mlx5: Delete not-used cmd header
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
The structures defined in the cmd header are not used and can be safely removed from the driver. This patch removes that file and deletes all relevant includes.
--- drivers/infiniband/hw/mlx5/mad.c | 1 - drivers/infiniband/hw/mlx5/srq_cmd.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/cq.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/eq.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/fpga/cmd.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/fw.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/health.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/lib/port_tun.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/mcg.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/mr.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/pd.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/qp.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/rl.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/uar.c | 1 - 15 files changed, 15 deletions(-)
drivers/infiniband/hw/mlx5/mad.c +0 -1
@@ -30,7 +30,6 @@* SOFTWARE. */ -#include <linux/mlx5/cmd.h> #include <linux/mlx5/vport.h> #include <rdma/ib_mad.h> #include <rdma/ib_smi.h>
drivers/infiniband/hw/mlx5/srq_cmd.c +0 -1
@@ -5,7 +5,6 @@#include <linux/kernel.h> #include <linux/mlx5/driver.h> -#include <linux/mlx5/cmd.h> #include "mlx5_ib.h" #include "srq.h"
drivers/net/ethernet/mellanox/mlx5/core/cq.c +0 -1
@@ -34,7 +34,6 @@#include <linux/module.h> #include <linux/hardirq.h> #include <linux/mlx5/driver.h> -#include <linux/mlx5/cmd.h> #include <rdma/ib_verbs.h> #include <linux/mlx5/cq.h> #include "mlx5_core.h"
drivers/net/ethernet/mellanox/mlx5/core/eq.c +0 -1
@@ -36,7 +36,6 @@#include <linux/mlx5/driver.h> #include <linux/mlx5/vport.h> #include <linux/mlx5/eq.h> -#include <linux/mlx5/cmd.h> #ifdef CONFIG_RFS_ACCEL #include <linux/cpu_rmap.h> #endif
drivers/net/ethernet/mellanox/mlx5/core/fpga/cmd.c +0 -1
@@ -31,7 +31,6 @@*/ #include <linux/etherdevice.h> -#include <linux/mlx5/cmd.h> #include <linux/mlx5/driver.h> #include <linux/mlx5/device.h>
drivers/net/ethernet/mellanox/mlx5/core/fw.c +0 -1
@@ -31,7 +31,6 @@*/ #include <linux/mlx5/driver.h> -#include <linux/mlx5/cmd.h> #include <linux/mlx5/eswitch.h> #include <linux/module.h> #include "mlx5_core.h"
drivers/net/ethernet/mellanox/mlx5/core/health.c +0 -1
@@ -36,7 +36,6 @@#include <linux/vmalloc.h> #include <linux/hardirq.h> #include <linux/mlx5/driver.h> -#include <linux/mlx5/cmd.h> #include "mlx5_core.h" #include "lib/eq.h" #include "lib/mlx5.h"
drivers/net/ethernet/mellanox/mlx5/core/lib/port_tun.c +0 -1
@@ -4,7 +4,6 @@#include <linux/module.h> #include <linux/mlx5/driver.h> #include <linux/mlx5/port.h> -#include <linux/mlx5/cmd.h> #include "mlx5_core.h" #include "lib/port_tun.h"
drivers/net/ethernet/mellanox/mlx5/core/mcg.c +0 -1
@@ -33,7 +33,6 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/mlx5/driver.h> -#include <linux/mlx5/cmd.h> #include <rdma/ib_verbs.h> #include "mlx5_core.h"
drivers/net/ethernet/mellanox/mlx5/core/mr.c +0 -1
@@ -33,7 +33,6 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/mlx5/driver.h> -#include <linux/mlx5/cmd.h> #include "mlx5_core.h" int mlx5_core_create_mkey(struct mlx5_core_dev *dev,
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c +0 -1
@@ -35,7 +35,6 @@#include <linux/module.h> #include <linux/delay.h> #include <linux/mlx5/driver.h> -#include <linux/mlx5/cmd.h> #include "mlx5_core.h" #include "lib/eq.h"
drivers/net/ethernet/mellanox/mlx5/core/pd.c +0 -1
@@ -33,7 +33,6 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/mlx5/driver.h> -#include <linux/mlx5/cmd.h> #include "mlx5_core.h" int mlx5_core_alloc_pd (struct mlx5_core_dev *dev,u32 *pdn)
drivers/net/ethernet/mellanox/mlx5/core/qp.c +0 -1
@@ -32,7 +32,6 @@#include <linux/gfp.h> #include <linux/export.h> -#include <linux/mlx5/cmd.h> #include <linux/mlx5/qp.h> #include <linux/mlx5/driver.h> #include <linux/mlx5/transobj.h>
drivers/net/ethernet/mellanox/mlx5/core/rl.c +0 -1
@@ -33,7 +33,6 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/mlx5/driver.h> -#include <linux/mlx5/cmd.h> #include "mlx5_core.h" /* Scheduling element fw management */
drivers/net/ethernet/mellanox/mlx5/core/uar.c +0 -1
@@ -34,7 +34,6 @@#include <linux/module.h> #include <linux/io-mapping.h> #include <linux/mlx5/driver.h> -#include <linux/mlx5/cmd.h> #include "mlx5_core.h" int mlx5_cmd_alloc_uar (struct mlx5_core_dev *dev,u32 *uarn)
Signature · 1 line
2.25.2
PATCH 12/13 RDMA/mlx5: Alphabetically sort build artifacts
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
Sort .o objects in makefile to make addition of new object less cumbersome.
--- drivers/infiniband/hw/mlx5/Makefile | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-)
drivers/infiniband/hw/mlx5/Makefile +20 -7
@@ -1,11 +1,24 @@ # SPDX-License-Identifier: GPL-2.0-only -obj-$(CONFIG_MLX5_INFINIBAND) += mlx5_ib.o +obj-$(CONFIG_MLX5_INFINIBAND) += mlx5_ib.o + +mlx5_ib-y := ah.o \ + cmd.o \ + cong.o \ + cq.o \ + doorbell.o \ + gsi.o \ + ib_virt.o \ + mad.o \ + main.o \ + mem.o \ + mr.o \ + qp.o \ + restrack.o \ + srq.o \ + srq_cmd.o -mlx5_ib-y := main.o cq.o doorbell.o qp.o mem.o srq_cmd.o \ - srq.o mr.o ah.o mad.o gsi.o ib_virt.o cmd.o \ - cong.o restrack.o mlx5_ib-$(CONFIG_INFINIBAND_ON_DEMAND_PAGING) += odp.o mlx5_ib-$(CONFIG_MLX5_ESWITCH) += ib_rep.o -mlx5_ib-$(CONFIG_INFINIBAND_USER_ACCESS) += devx.o -mlx5_ib-$(CONFIG_INFINIBAND_USER_ACCESS) += flow.o -mlx5_ib-$(CONFIG_INFINIBAND_USER_ACCESS) += qos.o +mlx5_ib-$(CONFIG_INFINIBAND_USER_ACCESS) += devx.o \ + flow.o \ + qos.o
Signature · 1 line
2.25.2
PATCH 13/13 net/mlx5: Move QP logic to mlx5_ib
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
The mlx5_core doesn't need any functionality coded in qp.c, so move that file to drivers/infiniband/ be under mlx5_ib responsibility.
---
drivers/infiniband/hw/mlx5/Makefile | 1 +
drivers/infiniband/hw/mlx5/cq.c | 3 +-
drivers/infiniband/hw/mlx5/devx.c | 10 +-
drivers/infiniband/hw/mlx5/main.c | 10 +-
drivers/infiniband/hw/mlx5/mlx5_ib.h | 2 +
drivers/infiniband/hw/mlx5/odp.c | 3 +-
drivers/infiniband/hw/mlx5/qp.c | 47 ++--
drivers/infiniband/hw/mlx5/qp.h | 46 +++
.../core/qp.c => infiniband/hw/mlx5/qpc.c} | 264 ++++++------------
drivers/infiniband/hw/mlx5/srq_cmd.c | 1 +
.../net/ethernet/mellanox/mlx5/core/Makefile | 2 +-
.../net/ethernet/mellanox/mlx5/core/debugfs.c | 6 +-
.../net/ethernet/mellanox/mlx5/core/main.c | 4 -
include/linux/mlx5/cmd.h | 51 ----
include/linux/mlx5/driver.h | 2 -
include/linux/mlx5/qp.h | 45 ---
16 files changed, 180 insertions(+), 317 deletions(-)
create mode 100644 drivers/infiniband/hw/mlx5/qp.h
rename drivers/{net/ethernet/mellanox/mlx5/core/qp.c => infiniband/hw/mlx5/qpc.c} (59%)
delete mode 100644 include/linux/mlx5/cmd.hdrivers/infiniband/hw/mlx5/Makefile +1 -0
@@ -13,6 +13,7 @@ mlx5_ib-y := ah.o \ mem.o \ mr.o \ qp.o \ + qpc.o \ restrack.o \ srq.o \ srq_cmd.o
drivers/infiniband/hw/mlx5/cq.c +2 -1
@@ -36,6 +36,7 @@#include <rdma/ib_cache.h> #include "mlx5_ib.h" #include "srq.h" +#include "qp.h" static void mlx5_ib_cq_comp (struct mlx5_core_cq *cq,struct mlx5_eqe *eqe) {
@@ -484,7 +485,7 @@ static int mlx5_poll_one(struct mlx5_ib_cq *cq,* because CQs will be locked while QPs are removed * from the table. */ - mqp =__mlx5_qp_lookup (dev->mdev, qpn); + mqp =radix_tree_lookup (&dev->qp_table.tree, qpn); *cur_qp =to_mibqp (mqp); }
drivers/infiniband/hw/mlx5/devx.c +5 -5
@@ -14,6 +14,7 @@#include <linux/mlx5/driver.h> #include <linux/mlx5/fs.h> #include "mlx5_ib.h" +#include "qp.h" #include <linux/xarray.h> #define UVERBS_MODULE_NAME mlx5_ib
@@ -1356,7 +1357,7 @@ static int devx_obj_cleanup(struct ib_uobject *uobject, }if (obj->flags &DEVX_OBJ_FLAGS_DCT ) - ret =mlx5_core_destroy_dct (obj->ib_dev->mdev, &obj->core_dct); + ret =mlx5_core_destroy_dct (obj->ib_dev, &obj->core_dct);else if (obj->flags &DEVX_OBJ_FLAGS_CQ ) ret =mlx5_core_destroy_cq (obj->ib_dev->mdev, &obj->core_cq);else
@@ -1450,9 +1451,8 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_OBJ_CREATE)(if (opcode ==MLX5_CMD_OP_CREATE_DCT ) { obj->flags |=DEVX_OBJ_FLAGS_DCT ; - err =mlx5_core_create_dct (dev->mdev, &obj->core_dct, - cmd_in, cmd_in_len, - cmd_out, cmd_out_len); + err =mlx5_core_create_dct (dev, &obj->core_dct, cmd_in, + cmd_in_len, cmd_out, cmd_out_len); }else if (opcode ==MLX5_CMD_OP_CREATE_CQ ) { obj->flags |=DEVX_OBJ_FLAGS_CQ ; obj->core_cq.comp = devx_cq_comp;
@@ -1499,7 +1499,7 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_OBJ_CREATE)( obj_destroy:if (obj->flags &DEVX_OBJ_FLAGS_DCT ) -mlx5_core_destroy_dct (obj->ib_dev->mdev, &obj->core_dct); +mlx5_core_destroy_dct (obj->ib_dev, &obj->core_dct);else if (obj->flags &DEVX_OBJ_FLAGS_CQ )mlx5_core_destroy_cq (obj->ib_dev->mdev, &obj->core_cq);else
drivers/infiniband/hw/mlx5/main.c +8 -2
@@ -60,6 +60,7 @@#include "ib_rep.h" #include "cmd.h" #include "srq.h" +#include "qp.h" #include <linux/mlx5/fs_helpers.h> #include <linux/mlx5/accel.h> #include <rdma/uverbs_std_types.h>
@@ -4604,8 +4605,7 @@ static void delay_drop_handler(struct work_struct *work)atomic_inc (&delay_drop->events_cnt);mutex_lock (&delay_drop->lock); - err =mlx5_core_set_delay_drop (delay_drop->dev->mdev, - delay_drop->timeout); + err =mlx5_core_set_delay_drop (delay_drop->dev, delay_drop->timeout);if (err) {mlx5_ib_warn (delay_drop->dev,"Failed to set delay drop, timeout=%u\n" , delay_drop->timeout);
@@ -7166,6 +7166,9 @@ static const struct mlx5_ib_profile pf_profile = {STAGE_CREATE (MLX5_IB_STAGE_ROCE , mlx5_ib_stage_roce_init, mlx5_ib_stage_roce_cleanup), +STAGE_CREATE (MLX5_IB_STAGE_QP , + mlx5_init_qp_table, + mlx5_cleanup_qp_table),STAGE_CREATE (MLX5_IB_STAGE_SRQ , mlx5_init_srq_table, mlx5_cleanup_srq_table),
@@ -7223,6 +7226,9 @@ const struct mlx5_ib_profile raw_eth_profile = {STAGE_CREATE (MLX5_IB_STAGE_ROCE , mlx5_ib_stage_raw_eth_roce_init, mlx5_ib_stage_raw_eth_roce_cleanup), +STAGE_CREATE (MLX5_IB_STAGE_QP , + mlx5_init_qp_table, + mlx5_cleanup_qp_table),STAGE_CREATE (MLX5_IB_STAGE_SRQ , mlx5_init_srq_table, mlx5_cleanup_srq_table),
drivers/infiniband/hw/mlx5/mlx5_ib.h +2 -0
@@ -870,6 +870,7 @@ enum mlx5_ib_stages {MLX5_IB_STAGE_CAPS ,MLX5_IB_STAGE_NON_DEFAULT_CB ,MLX5_IB_STAGE_ROCE , +MLX5_IB_STAGE_QP ,MLX5_IB_STAGE_SRQ ,MLX5_IB_STAGE_DEVICE_RESOURCES , MLX5_IB_STAGE_DEVICE_NOTIFIER,
@@ -1065,6 +1066,7 @@ struct mlx5_ib_dev {struct mlx5_dm dm;u16 devx_whitelist_uid;struct mlx5_srq_table srq_table; +struct mlx5_qp_table qp_table;struct mlx5_async_ctx async_ctx;struct mlx5_devx_event_table devx_event_table;struct mlx5_var_table var_table;
drivers/infiniband/hw/mlx5/odp.c +2 -1
@@ -36,6 +36,7 @@#include "mlx5_ib.h" #include "cmd.h" +#include "qp.h" #include <linux/mlx5/eq.h>
@@ -1219,7 +1220,7 @@ static inline struct mlx5_core_rsc_common *odp_get_rsc(struct mlx5_ib_dev *dev,case MLX5_WQE_PF_TYPE_REQ_SEND_OR_WRITE :case MLX5_WQE_PF_TYPE_RESP :case MLX5_WQE_PF_TYPE_REQ_READ_OR_ATOMIC : - common =mlx5_core_res_hold (dev->mdev, wq_num,MLX5_RES_QP ); + common =mlx5_core_res_hold (dev, wq_num,MLX5_RES_QP );break ;default :break ;
drivers/infiniband/hw/mlx5/qp.c +22 -25
166 lines not on this page · raw message
drivers/infiniband/hw/mlx5/qp.h new file +46 -0
46 lines not on this page · raw message
drivers/infiniband/hw/mlx5/qpc.c renamed from drivers/net/ethernet/mellanox/mlx5/core/qp.c +86 -178
538 lines not on this page · raw message
drivers/infiniband/hw/mlx5/srq_cmd.c +1 -0
@@ -7,6 +7,7 @@#include <linux/mlx5/driver.h> #include "mlx5_ib.h" #include "srq.h" +#include "qp.h" static int get_pas_size (struct mlx5_srq_attr *in) {
drivers/net/ethernet/mellanox/mlx5/core/Makefile +1 -1
@@ -12,7 +12,7 @@ obj-$(CONFIG_MLX5_CORE) += mlx5_core.o # mlx5 core basic # mlx5_core-y := main.o cmd.o debugfs.o fw.o eq.o uar.o pagealloc.o \ - health.o mcg.o cq.o alloc.o qp.o port.o mr.o pd.o \ + health.o mcg.o cq.o alloc.o port.o mr.o pd.o \ transobj.o vport.o sriov.o fs_cmd.o fs_core.o pci_irq.o \ fs_counters.o rl.o lag.o dev.o events.o wq.o lib/gid.o \ lib/devcom.o lib/pci_vsc.o lib/dm.o diag/fs_tracepoint.o \
drivers/net/ethernet/mellanox/mlx5/core/debugfs.c +4 -2
@@ -101,15 +101,15 @@ void mlx5_unregister_debugfs(void)void mlx5_qp_debugfs_init (struct mlx5_core_dev *dev) { -atomic_set (&dev->num_qps,0 ); - dev->priv.qp_debugfs =debugfs_create_dir ("QPs" , dev->priv.dbg_root); } +EXPORT_SYMBOL (mlx5_qp_debugfs_init);void mlx5_qp_debugfs_cleanup (struct mlx5_core_dev *dev) {debugfs_remove_recursive (dev->priv.qp_debugfs); } +EXPORT_SYMBOL (mlx5_qp_debugfs_cleanup);void mlx5_eq_debugfs_init (struct mlx5_core_dev *dev) {
@@ -450,6 +450,7 @@ int mlx5_debug_qp_add(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp)return err; } +EXPORT_SYMBOL (mlx5_debug_qp_add);void mlx5_debug_qp_remove (struct mlx5_core_dev *dev,struct mlx5_core_qp *qp) {
@@ -459,6 +460,7 @@ void mlx5_debug_qp_remove(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp)if (qp->dbg)rem_res_tree (qp->dbg); } +EXPORT_SYMBOL (mlx5_debug_qp_remove);int mlx5_debug_eq_add (struct mlx5_core_dev *dev,struct mlx5_eq *eq) {
drivers/net/ethernet/mellanox/mlx5/core/main.c +0 -4
@@ -850,8 +850,6 @@ static int mlx5_init_once(struct mlx5_core_dev *dev)mlx5_cq_debugfs_init (dev); -mlx5_init_qp_table (dev); -mlx5_init_reserved_gids (dev);mlx5_init_clock (dev);
@@ -910,7 +908,6 @@ static int mlx5_init_once(struct mlx5_core_dev *dev) err_tables_cleanup:mlx5_geneve_destroy (dev->geneve);mlx5_vxlan_destroy (dev->vxlan); -mlx5_cleanup_qp_table (dev);mlx5_cq_debugfs_cleanup (dev);mlx5_events_cleanup (dev); err_eq_cleanup:
@@ -938,7 +935,6 @@ static void mlx5_cleanup_once(struct mlx5_core_dev *dev)mlx5_vxlan_destroy (dev->vxlan);mlx5_cleanup_clock (dev);mlx5_cleanup_reserved_gids (dev); -mlx5_cleanup_qp_table (dev);mlx5_cq_debugfs_cleanup (dev);mlx5_events_cleanup (dev);mlx5_eq_table_cleanup (dev);
include/linux/mlx5/cmd.h deleted +0 -51
51 lines not on this page · raw message
include/linux/mlx5/driver.h +0 -2
@@ -541,7 +541,6 @@ struct mlx5_priv {struct mlx5_core_health health;/* start: qp staff */ -struct mlx5_qp_table qp_table;struct dentry *qp_debugfs;struct dentry *eq_debugfs;struct dentry *cq_debugfs;
@@ -687,7 +686,6 @@ struct mlx5_core_dev {unsigned long intf_state;struct mlx5_priv priv;struct mlx5_profile *profile; -atomic_t num_qps;u32 issi;struct mlx5e_resources mlx5e_res;struct mlx5_dm *dm;
include/linux/mlx5/qp.h +0 -45
53 lines not on this page · raw message
Signature · 1 line
2.25.2
Quoted 13 lines · Leon Romanovsky
From: Leon Romanovsky <[email protected]>
Hi,
This series introduces simplified version of mlx5 command interface, refactors the code to disconnect
mlx5_corefrom QP logic and movesqp.cto be undermlx5_ibresponsibilities.Next series will convert
mlx5_coreto this new interface, so at this point I tried to keep the amount of changes to the minimum.Thanks
Quoted 15 lines
Leon Romanovsky (13):
net/mlx5: Provide simplified command interfaces net/mlx5: Open-code create and destroy QP calls net/mlx5: Remove empty QP and CQ events handlers net/mlx5: Open-code modify QP in steering module net/mlx5: Open-code modify QP in the FPGA module net/mlx5: Open-code modify QP in the IPoIB module net/mlx5: Remove extra indirection while storing QPN net/mlx5: Replace hand written QP context struct with automatic
getters
net/mlx5: Remove Q counter low level helper APIs RDMA/mlx5: Delete Q counter allocations command net/mlx5: Delete not-used cmd header
RDMA/mlx5: Alphabetically sort build artifacts net/mlx5: Move QP logic tomlx5_ib
The whole series applied to the mlx5-next, please pull.
Thanks