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

From: Ajay Sharma
Date: Thu Jul 21 2022 - 15:24:22 EST




> -----Original Message-----
> From: Jason Gunthorpe <jgg@xxxxxxxxxx>
> Sent: Wednesday, July 20, 2022 6:49 PM
> To: Long Li <longli@xxxxxxxxxxxxx>
> Cc: KY Srinivasan <kys@xxxxxxxxxxxxx>; Haiyang Zhang
> <haiyangz@xxxxxxxxxxxxx>; Stephen Hemminger
> <sthemmin@xxxxxxxxxxxxx>; Wei Liu <wei.liu@xxxxxxxxxx>; Dexuan Cui
> <decui@xxxxxxxxxxxxx>; David S. Miller <davem@xxxxxxxxxxxxx>; Jakub
> Kicinski <kuba@xxxxxxxxxx>; Paolo Abeni <pabeni@xxxxxxxxxx>; Leon
> Romanovsky <leon@xxxxxxxxxx>; edumazet@xxxxxxxxxx;
> shiraz.saleem@xxxxxxxxx; Ajay Sharma <sharmaajay@xxxxxxxxxxxxx>; linux-
> hyperv@xxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx; linux-rdma@xxxxxxxxxxxxxxx
> Subject: [EXTERNAL] Re: [Patch v4 12/12] RDMA/mana_ib: Add a driver for
> Microsoft Azure Network Adapter
>
> On Wed, Jun 15, 2022 at 07:07:20PM -0700, longli@xxxxxxxxxxxxxxxxx
> wrote:
>
> > +static int mana_ib_alloc_pd(struct ib_pd *ibpd, struct ib_udata
> > +*udata) {
> > + struct mana_ib_pd *pd = container_of(ibpd, struct mana_ib_pd, ibpd);
> > + struct ib_device *ibdev = ibpd->device;
> > + enum gdma_pd_flags flags = 0;
> > + struct mana_ib_dev *dev;
> > + int ret;
> > +
> > + dev = container_of(ibdev, struct mana_ib_dev, ib_dev);
> > +
> > + /* Set flags if this is a kernel request */
> > + if (!ibpd->uobject)
> > + flags = GDMA_PD_FLAG_ALLOW_GPA_MR |
> GDMA_PD_FLAG_ALLOW_FMR_MR;
>
> I'm confused, this driver doesn't seem to support kverbs:
>
> > +static const struct ib_device_ops mana_ib_dev_ops = {
> > + .owner = THIS_MODULE,
> > + .driver_id = RDMA_DRIVER_MANA,
> > + .uverbs_abi_ver = MANA_IB_UVERBS_ABI_VERSION,
> > +
> > + .alloc_pd = mana_ib_alloc_pd,
> > + .alloc_ucontext = mana_ib_alloc_ucontext,
> > + .create_cq = mana_ib_create_cq,
> > + .create_qp = mana_ib_create_qp,
> > + .create_rwq_ind_table = mana_ib_create_rwq_ind_table,
> > + .create_wq = mana_ib_create_wq,
> > + .dealloc_pd = mana_ib_dealloc_pd,
> > + .dealloc_ucontext = mana_ib_dealloc_ucontext,
> > + .dereg_mr = mana_ib_dereg_mr,
> > + .destroy_cq = mana_ib_destroy_cq,
> > + .destroy_qp = mana_ib_destroy_qp,
> > + .destroy_rwq_ind_table = mana_ib_destroy_rwq_ind_table,
> > + .destroy_wq = mana_ib_destroy_wq,
> > + .disassociate_ucontext = mana_ib_disassociate_ucontext,
> > + .get_port_immutable = mana_ib_get_port_immutable,
> > + .mmap = mana_ib_mmap,
> > + .modify_qp = mana_ib_modify_qp,
> > + .modify_wq = mana_ib_modify_wq,
> > + .query_device = mana_ib_query_device,
> > + .query_gid = mana_ib_query_gid,
> > + .query_port = mana_ib_query_port,
> > + .reg_user_mr = mana_ib_reg_user_mr,
>
> eg there is no way to create a kernel MR..
>
> So, why do I see so many kverbs like things - and why are things like FMR in
> this driver that can never be used?
>
> Jason

The idea was to introduce kernel support in future. I will remove it from the code and upload the patch.