From: Leon Romanovsky <leon@kernel.org>
To: Yishai Hadas <yishaih@nvidia.com>
Cc: linux-rdma@vger.kernel.org, jgg@mellanox.com,
yishaih@mellanox.com, maorg@mellanox.com, phaddad@nvidia.com,
Maor Gottlieb <maorg@nvidia.com>
Subject: Re: [PATCH rdma-core 2/4] mlx5: Implement ibv_query_qp_data_in_order() verb
Date: Thu, 10 Jun 2021 08:50:59 +0300 [thread overview]
Message-ID: <YMGoQ2ZmTjSun54y@unreal> (raw)
In-Reply-To: <20210609155932.218005-3-yishaih@nvidia.com>
On Wed, Jun 09, 2021 at 06:59:30PM +0300, Yishai Hadas wrote:
> From: Patrisious Haddad <phaddad@nvidia.com>
>
> Implement the ibv_query_qp_data_in_order() verb by using DEVX to read
> from firmware the 'in_order_data' capability.
>
> Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
> Reviewed-by: Maor Gottlieb <maorg@nvidia.com>
> Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
> ---
> providers/mlx5/mlx5.c | 1 +
> providers/mlx5/mlx5.h | 3 +++
> providers/mlx5/mlx5_ifc.h | 39 +++++++++++++++++++++++++++++++--
> providers/mlx5/verbs.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 96 insertions(+), 2 deletions(-)
<...>
> +int mlx5_query_qp_data_in_order(struct ibv_qp *qp, enum ibv_wr_opcode op,
> + uint32_t flags)
> +{
> + uint32_t in_qp[DEVX_ST_SZ_DW(query_qp_in)] = {};
> + uint32_t out_qp[DEVX_ST_SZ_DW(query_qp_out)] = {};
> + struct mlx5_context *mctx = to_mctx(qp->context);
> + struct mlx5_qp *mqp = to_mqp(qp);
> + int ret;
> +
> +/* Currently this API is only supported for x86 architectures since most
> + * non-x86 platforms are known to be OOO and need to do a per-platform study.
> + */
> +#if !defined(__i386__) && !defined(__x86_64__)
> + return 0;
> +#endif
Does it compile without warnings/errors on such platforms?
You have "return 0;" in the middle of function, so the right thing to do
it is to write with "#if ..." over function or inside like below, as
long as "#else" exists.
int mlx5_query_qp_data_in_order(struct ibv_qp *qp, enum ibv_wr_opcode op,
uint32_t flags)
{
#if !defined(__i386__) && !defined(__x86_64__)
/* Currently this API is only supported for x86 architectures since most
* non-x86 platforms are known to be OOO and need to do a per-platform study.
*/
return 0;
#else
.....
#endif
> +
> + if (flags || !mctx->qp_data_in_order_cap)
> + return 0;
> +
> + if (mqp->dc_type == MLX5DV_DCTYPE_DCT)
> + return query_dct_in_order(qp);
> +
> + if (qp->state != IBV_QPS_RTS)
> + return 0;
> +
> + DEVX_SET(query_qp_in, in_qp, opcode, MLX5_CMD_OP_QUERY_QP);
> + DEVX_SET(query_qp_in, in_qp, qpn, qp->qp_num);
> + ret = mlx5dv_devx_qp_query(qp, in_qp, sizeof(in_qp), out_qp,
> + sizeof(out_qp));
> + if (ret)
> + return 0;
> +
> + return DEVX_GET(query_qp_out, out_qp, qpc.data_in_order);
> +}
> +
Thanks
next prev parent reply other threads:[~2021-06-10 5:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-09 15:59 [PATCH rdma-core 0/4] verbs: Introduce ibv_query_qp_data_in_order() verb Yishai Hadas
2021-06-09 15:59 ` [PATCH rdma-core 1/4] " Yishai Hadas
2021-06-09 15:59 ` [PATCH rdma-core 2/4] mlx5: Implement " Yishai Hadas
2021-06-10 5:50 ` Leon Romanovsky [this message]
2021-06-10 11:42 ` Jason Gunthorpe
2021-06-10 11:50 ` Leon Romanovsky
2021-06-10 12:51 ` Yishai Hadas
2021-06-16 8:03 ` Yishai Hadas
2021-06-09 15:59 ` [PATCH rdma-core 3/4] pyverbs: Add query QP data in order support Yishai Hadas
2021-06-09 15:59 ` [PATCH rdma-core 4/4] tests: Add query QP data in order coverage Yishai Hadas
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=YMGoQ2ZmTjSun54y@unreal \
--to=leon@kernel.org \
--cc=jgg@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
--cc=maorg@mellanox.com \
--cc=maorg@nvidia.com \
--cc=phaddad@nvidia.com \
--cc=yishaih@mellanox.com \
--cc=yishaih@nvidia.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