From: Jason Gunthorpe <jgg-uk2M96/98Pc@public.gmane.org>
To: Alex Margolin <alexma-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [RFC] Vendor-specific QPs
Date: Thu, 2 Nov 2017 14:01:58 -0600 [thread overview]
Message-ID: <20171102200158.GU18874@ziepe.ca> (raw)
In-Reply-To: <VI1PR05MB12784029D1DE2689A8194A58B9590-79XLn2atqDMOK6E67s+DINqRiQSDpxhJvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
On Mon, Oct 30, 2017 at 03:23:24PM +0000, Alex Margolin wrote:
> We propose using the "reserved" range of QP types to serve the
> vendor-specific implementation, both within the Verbs API (API patch
> below) and the IB subsystem (ib_core). The solution requires minor
> changes to IB core, namely removing some restrictions that apply to
> standard QPs at creation, but most of the flow (and the one for
> modify and destroy) remains identical.
> The changes to support such QPs will remain in the vendor-specific
> area of the API, i.e. Mellanox "Direct Verbs" portion, and the
> change in ib_core is to use specific IB_QPT_RESERVED* definitions to
> cut through some of the required checks (but still using most of the
> logic, where applicable). No change to libibverbs is required.
Don't like the idea of a generic RESERVED.
Add a type called IB_QPT_DIRECT_VERBS and put any other information
(eg MLX5_IB_QPT_REG_UMR/DC_INI/DC_TGT etc) you need inside the driver
data.
> +++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
> @@ -193,6 +193,8 @@ struct mlx5_ib_flow_db {
> #define MLX5_IB_SEND_UMR_UPDATE_PD_ACCESS IB_SEND_RESERVED_END
>
> #define MLX5_IB_QPT_REG_UMR IB_QPT_RESERVED1
> +#define MLX5_IB_QPT_DC_INI IB_QPT_RESERVED3
> +#define MLX5_IB_QPT_DC_TGT IB_QPT_RESERVED4
> +enum mlx5dv_qp_type {
> + MLX5DV_QPT_DC_SEND = IB_QPT_RESERVED3,
> + MLX5DV_QPT_DC_RECV = IB_QPT_RESERVED4
> +};
It really bothers me every time I see someone introduce a constant
shared between kernel and userspace and then chooses to use
different names. Leon was just complaining about this.
> + #define MLX5DV_DC_CAP_FULL_HANDSHAKE (1 << 0) #define
> + MLX5DV_DC_CAP_MAX_RESPONDERS (1 << 1) #define
> + MLX5DV_DC_CAP_CNAK_REVERSE_SL (1 << 2)
?? again.. why send patches in a RFC if they are full
of garbage?
> +struct mlx5dv_qp_init_attr {
> + uint32_t comp_mask;
> + union {
> + struct {
> + enum mlx5dv_qp_handshake_mode mode;
> + uint8_t reverse_cnak_sl;
> + } dc_send;
> + struct {
> + enum mlx5dv_qp_handshake_mode mode;
> + uint64_t dc_key;
> + uint32_t min_responders;
> + uint32_t max_responders;
> + } dc_recv;
> + };
> +};
A comp_mask and a union? That is pretty wonky.
> +struct mlx5dv_send_wr {
> + uint32_t comp_mask;
> + union {
> + struct {
> + struct ibv_ah *ah;
> + uint32_t remote_qpn;
> + uint32_t remote_qkey;
> + uint64_t remote_dc_key;
> + uint8_t reverse_data_sl;
> + } dc_send;
> + };
> +};
> +struct mlx5dv_send_wr {
> + struct mlx5dv_send_wr *next;
> + struct mlx5dv_vendor_send_wr *mlx_wr;
> + struct ibv_send_wr ibv_wr;
> +};
Two structs with the same name? Not sure what this is trying to
explain. This is why people typically won't review RFCs I guess.
> +int mlx5dv_post_send(struct ibv_qp *qp,
> + struct mlx5dv_send_wr *mlx5_wr,
> + struct mlx5dv_send_wr **bad_wr);
We've talked about this in the past, I think you should have a
differentiated post send and forget the above two confusing structs.
mlx5dv_post_dc_send(..)
mlx5dv_post_dc_recv(..)
This will perform better than trying to create a multiplexed thing -
see the long discussion that reached that conclusion for the CQ side.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-11-02 20:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-30 15:23 [RFC] Vendor-specific QPs Alex Margolin
[not found] ` <VI1PR05MB12784029D1DE2689A8194A58B9590-79XLn2atqDMOK6E67s+DINqRiQSDpxhJvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-11-02 20:01 ` Jason Gunthorpe [this message]
[not found] ` <20171102200158.GU18874-uk2M96/98Pc@public.gmane.org>
2017-11-05 7:25 ` Leon Romanovsky
2017-11-22 17:47 ` Alex Margolin
[not found] ` <VI1PR05MB1278EA7700D1BEB63383FC52B9200-79XLn2atqDMOK6E67s+DINqRiQSDpxhJvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-11-22 18:07 ` Jason Gunthorpe
[not found] ` <20171122180731.GS18272-uk2M96/98Pc@public.gmane.org>
2017-11-22 20:09 ` Alex Margolin
2017-11-23 9:14 ` Moni Shoua
[not found] ` <CAG9sBKPqVwbS0cXQPTdWCx7vwWaq5EMeghnPMEHrMZZsSsEu_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-23 17:57 ` Jason Gunthorpe
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=20171102200158.GU18874@ziepe.ca \
--to=jgg-uk2m96/98pc@public.gmane.org \
--cc=alexma-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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