RE: [Patch v8 12/12] RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter

Bernard Metzler
2022-10-21T14:36:34Z

> -----Original Message-----
> From: Tom Talpey <tom@talpey.com>
> Sent: Friday, 21 October 2022 16:34
> To: Long Li <longli@microsoft.com>; Bernard Metzler <BMT@zurich.ibm.com>;
> KY Srinivasan <kys@microsoft.com>; Haiyang Zhang <haiyangz@microsoft.com>;
> Stephen Hemminger <sthemmin@microsoft.com>; Wei Liu <wei.liu@kernel.org>;
> Dexuan Cui <decui@microsoft.com>; David S. Miller <davem@davemloft.net>;
> Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Jason
> Gunthorpe <jgg@ziepe.ca>; Leon Romanovsky <leon@kernel.org>;
> edumazet@google.com; shiraz.saleem@intel.com; Ajay Sharma
> <sharmaajay@microsoft.com>
> Cc: linux-hyperv@vger.kernel.org; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-rdma@vger.kernel.org
> Subject: [EXTERNAL] Re: [Patch v8 12/12] RDMA/mana_ib: Add a driver for
> Microsoft Azure Network Adapter
>
> On 10/20/2022 4:42 PM, Long Li wrote:
> >> [Bernard wrote...]
>
> >>> + props->max_qp_wr = MAX_SEND_BUFFERS_PER_QUEUE;
> >>> +
> >>> + /*
> >>> + * max_cqe could be potentially much bigger.
> >>> + * As this version of driver only support RAW QP, set it to the same
> >>> + * value as max_qp_wr
> >>> + */
> >>> + props->max_cqe = MAX_SEND_BUFFERS_PER_QUEUE;
> >>> +
> >>> + props->max_mr_size = MANA_IB_MAX_MR_SIZE;
> >>> + props->max_mr = INT_MAX;
> >>
> >> How the 24 bit wide MR keys can handle INT_MAX unique
> >> MR's?
> >
> > Not sure if I understand this correctly, lkey and rkey are u32 in ib_mr.
>
> The upper 8 bits of an ib_mr remote token are reserved for use as a
> rotating key, this allows a consumer to more safely reuse an ib_mr
> without having to overallocate large region pools.
>
> Tom.

Right, my point was that one cannot encode INT_MAX different MR
identifiers into 32 - 8 = 24 bits.

Best,
Bernard.