[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <SN6PR2101MB13271E9D5865923393D67649BF899@SN6PR2101MB1327.namprd21.prod.outlook.com>
Date: Wed, 13 Jul 2022 07:36:53 +0000
From: Dexuan Cui <decui@...rosoft.com>
To: Ajay Sharma <sharmaajay@...rosoft.com>,
Long Li <longli@...rosoft.com>,
KY Srinivasan <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
Wei Liu <wei.liu@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Jason Gunthorpe <jgg@...pe.ca>,
Leon Romanovsky <leon@...nel.org>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"shiraz.saleem@...el.com" <shiraz.saleem@...el.com>
CC: "linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>
Subject: RE: [Patch v4 12/12] RDMA/mana_ib: Add a driver for Microsoft Azure
Network Adapter
> From: Ajay Sharma <sharmaajay@...rosoft.com>
> Sent: Tuesday, July 12, 2022 9:33 PM
> > ...
> > + switch (mr_params->mr_type) {
> > + case GDMA_MR_TYPE_GVA:
> > + req.mr_type = GDMA_MR_TYPE_GVA;
> > + req.gva.dma_region_handle = mr_params->gva.dma_region_handle;
> > + req.gva.virtual_address = mr_params->gva.virtual_address;
> > + req.gva.access_flags = mr_params->gva.access_flags;
> > + break;
> > +
> > + case GDMA_MR_TYPE_GPA:
> > + req.mr_type = GDMA_MR_TYPE_GPA;
> > + req.gpa.access_flags = mr_params->gpa.access_flags;
> > + break;
> > +
> > + case GDMA_MR_TYPE_FMR:
> > + req.mr_type = GDMA_MR_TYPE_FMR;
> > + req.fmr.page_size = mr_params->fmr.page_size;
> > + req.fmr.reserved_pte_count = mr_params->fmr.reserved_pte_count;
> > + break;
> > +
> > + default:
> > + ibdev_dbg(&dev->ib_dev,
> > + "invalid param (GDMA_MR_TYPE) passed, type %d\n",
> > + req.mr_type);
>
> Here req.mr_type is always 0.
> We should remove the 3 above lines of "req.mr_type = ...", and add a line
> "req.mr_type = mr_params->mr_type;" before the "switch" line..
>
> No, That's incorrect. The mr_type is being explicitly set here to control what
> regions get exposed to the user and kernel. GPA and FMR are never exposed to
> user. So we cannot assign req.mr_type = mr_params->mr_type.
I'm not following you. I meant the below change, which should have no
functional change, right? In the "default:" branch , we just "goto error;", so
there is no functional change either.
--- drivers/infiniband/hw/mana/main.c.orig
+++ drivers/infiniband/hw/mana/main.c
@@ -394,21 +394,19 @@
sizeof(resp));
req.pd_handle = mr_params->pd_handle;
+ req.mr_type = mr_params->mr_type;
switch (mr_params->mr_type) {
case GDMA_MR_TYPE_GVA:
- req.mr_type = GDMA_MR_TYPE_GVA;
req.gva.dma_region_handle = mr_params->gva.dma_region_handle;
req.gva.virtual_address = mr_params->gva.virtual_address;
req.gva.access_flags = mr_params->gva.access_flags;
break;
case GDMA_MR_TYPE_GPA:
- req.mr_type = GDMA_MR_TYPE_GPA;
req.gpa.access_flags = mr_params->gpa.access_flags;
break;
case GDMA_MR_TYPE_FMR:
- req.mr_type = GDMA_MR_TYPE_FMR;
req.fmr.page_size = mr_params->fmr.page_size;
req.fmr.reserved_pte_count = mr_params->fmr.reserved_pte_count;
break;
Powered by blists - more mailing lists