From: Leon Romanovsky <leonro@mellanox.com>
To: Doug Ledford <dledford@redhat.com>, Jason Gunthorpe <jgg@mellanox.com>
Cc: linux-rdma@vger.kernel.org, Moshe Shemesh <moshe@mellanox.com>,
netdev@vger.kernel.org, Saeed Mahameed <saeedm@mellanox.com>
Subject: Re: [PATCH mlx5-next 02/24] net/mlx5: Update cq.c to new cmd interface
Date: Wed, 22 Apr 2020 19:49:48 +0300 [thread overview]
Message-ID: <20200422164948.GB492196@unreal> (raw)
In-Reply-To: <20200420114136.264924-3-leon@kernel.org>
On Mon, Apr 20, 2020 at 02:41:14PM +0300, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@mellanox.com>
>
> Do mass update of cq.c to reuse newly introduced
> mlx5_cmd_exec_in*() interfaces.
>
> Reviewed-by: Moshe Shemesh <moshe@mellanox.com>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/cq.c | 24 +++++++------------
> .../net/ethernet/mellanox/mlx5/core/debugfs.c | 2 +-
> .../ethernet/mellanox/mlx5/core/en/health.c | 2 +-
> include/linux/mlx5/cq.h | 2 +-
> 4 files changed, 12 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cq.c b/drivers/net/ethernet/mellanox/mlx5/core/cq.c
> index 4477a590b308..1a6f1f14da97 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/cq.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/cq.c
> @@ -90,8 +90,7 @@ int mlx5_core_create_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq,
> u32 *in, int inlen, u32 *out, int outlen)
> {
> int eqn = MLX5_GET(cqc, MLX5_ADDR_OF(create_cq_in, in, cq_context), c_eqn);
> - u32 dout[MLX5_ST_SZ_DW(destroy_cq_out)];
> - u32 din[MLX5_ST_SZ_DW(destroy_cq_in)];
> + u32 din[MLX5_ST_SZ_DW(destroy_cq_in)] = {};
> struct mlx5_eq_comp *eq;
> int err;
>
> @@ -141,20 +140,17 @@ int mlx5_core_create_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq,
> err_cq_add:
> mlx5_eq_del_cq(&eq->core, cq);
> err_cmd:
> - memset(din, 0, sizeof(din));
> - memset(dout, 0, sizeof(dout));
> MLX5_SET(destroy_cq_in, din, opcode, MLX5_CMD_OP_DESTROY_CQ);
> MLX5_SET(destroy_cq_in, din, cqn, cq->cqn);
> MLX5_SET(destroy_cq_in, din, uid, cq->uid);
> - mlx5_cmd_exec(dev, din, sizeof(din), dout, sizeof(dout));
> + mlx5_cmd_exec_in(dev, destroy_cq, din);
> return err;
> }
> EXPORT_SYMBOL(mlx5_core_create_cq);
>
> int mlx5_core_destroy_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq)
> {
> - u32 out[MLX5_ST_SZ_DW(destroy_cq_out)] = {0};
> - u32 in[MLX5_ST_SZ_DW(destroy_cq_in)] = {0};
> + u32 in[MLX5_ST_SZ_DW(destroy_cq_in)] = {};
> int err;
>
> mlx5_eq_del_cq(mlx5_get_async_eq(dev), cq);
> @@ -163,7 +159,7 @@ int mlx5_core_destroy_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq)
> MLX5_SET(destroy_cq_in, in, opcode, MLX5_CMD_OP_DESTROY_CQ);
> MLX5_SET(destroy_cq_in, in, cqn, cq->cqn);
> MLX5_SET(destroy_cq_in, in, uid, cq->uid);
> - err = mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
> + err = mlx5_cmd_exec_in(dev, destroy_cq, in);
> if (err)
> return err;
>
> @@ -178,24 +174,22 @@ int mlx5_core_destroy_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq)
> EXPORT_SYMBOL(mlx5_core_destroy_cq);
>
> int mlx5_core_query_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq,
> - u32 *out, int outlen)
> + u32 *out)
> {
> - u32 in[MLX5_ST_SZ_DW(query_cq_in)] = {0};
> + u32 in[MLX5_ST_SZ_DW(query_cq_in)] = {};
>
> MLX5_SET(query_cq_in, in, opcode, MLX5_CMD_OP_QUERY_CQ);
> MLX5_SET(query_cq_in, in, cqn, cq->cqn);
> - return mlx5_cmd_exec(dev, in, sizeof(in), out, outlen);
> + return mlx5_cmd_exec_inout(dev, query_cq, in, out);
> }
> EXPORT_SYMBOL(mlx5_core_query_cq);
>
> int mlx5_core_modify_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq,
> u32 *in, int inlen)
> {
> - u32 out[MLX5_ST_SZ_DW(modify_cq_out)] = {0};
> -
> MLX5_SET(modify_cq_in, in, opcode, MLX5_CMD_OP_MODIFY_CQ);
> MLX5_SET(modify_cq_in, in, uid, cq->uid);
> - return mlx5_cmd_exec(dev, in, inlen, out, sizeof(out));
> + return mlx5_cmd_exec_in(dev, modify_cq, in);
> }
> EXPORT_SYMBOL(mlx5_core_modify_cq);
>
This hunk needs this fixup:
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cq.c b/drivers/net/ethernet/mellanox/mlx5/core/cq.c
index 1a6f1f14da97..8379b24cb838 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/cq.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/cq.c
@@ -187,9 +187,11 @@ EXPORT_SYMBOL(mlx5_core_query_cq);
int mlx5_core_modify_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq,
u32 *in, int inlen)
{
+ u32 out[MLX5_ST_SZ_DW(modify_cq_out)] = {};
+
MLX5_SET(modify_cq_in, in, opcode, MLX5_CMD_OP_MODIFY_CQ);
MLX5_SET(modify_cq_in, in, uid, cq->uid);
- return mlx5_cmd_exec_in(dev, modify_cq, in);
+ return mlx5_cmd_exec(dev, in, inlen, out, sizeof(out));
}
EXPORT_SYMBOL(mlx5_core_modify_cq);
Thanks
next prev parent reply other threads:[~2020-04-22 16:49 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-20 11:41 [PATCH mlx5-next 00/24] Mass conversion to light mlx5 command interface Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 01/24] net/mlx5: Update vport.c to new cmd interface Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 02/24] net/mlx5: Update cq.c " Leon Romanovsky
2020-04-22 16:49 ` Leon Romanovsky [this message]
2020-04-22 18:32 ` Jason Gunthorpe
2020-04-22 18:36 ` Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 03/24] net/mlx5: Update debugfs.c " Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 04/24] net/mlx5: Update ecpf.c " Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 05/24] net/mlx5: Update eq.c " Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 06/24] net/mlx5: Update statistics " Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 07/24] net/mlx5: Update eswitch " Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 08/24] net/mlx5: Update FPGA " Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 09/24] net/mlx5: Update fs_core " Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 10/24] net/mlx5: Update fw.c " Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 11/24] net/mlx5: Update lag.c " Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 12/24] net/mlx5: Update gid.c " Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 13/24] net/mlx5: Update mpfs.c " Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 14/24] net/mlx5: Update vxlan.c " Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 15/24] net/mlx5: Update main.c " Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 16/24] net/mlx5: Update mcg.c " Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 17/24] net/mlx5: Update mr.c " Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 18/24] net/mlx5: Update pagealloc.c " Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 19/24] net/mlx5: Update pd.c " Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 20/24] net/mlx5: Update uar.c " Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 21/24] net/mlx5: Update rl.c " Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 22/24] net/mlx5: Update port.c " Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 23/24] net/mlx5: Update SW steering " Leon Romanovsky
2020-04-20 11:41 ` [PATCH mlx5-next 24/24] net/mlx5: Update transobj.c " Leon Romanovsky
2020-04-23 18:45 ` [PATCH mlx5-next 00/24] Mass conversion to light mlx5 command interface Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200422164948.GB492196@unreal \
--to=leonro@mellanox.com \
--cc=dledford@redhat.com \
--cc=jgg@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
--cc=moshe@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).