From: Simon Horman <simon.horman@corigine.com>
To: Wei Hu <weh@microsoft.com>
Cc: netdev@vger.kernel.org, linux-hyperv@vger.kernel.org,
linux-rdma@vger.kernel.org, longli@microsoft.com,
sharmaajay@microsoft.com, jgg@ziepe.ca, leon@kernel.org,
kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org,
decui@microsoft.com, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, vkuznets@redhat.com,
ssengar@linux.microsoft.com, shradhagupta@linux.microsoft.com
Subject: Re: [PATCH v3 1/1] RDMA/mana_ib: Add EQ interrupt support to mana ib driver.
Date: Thu, 15 Jun 2023 16:00:05 +0200 [thread overview]
Message-ID: <ZIsZZYiYdIM1MxSj@corigine.com> (raw)
In-Reply-To: <20230615111412.1687573-1-weh@microsoft.com>
On Thu, Jun 15, 2023 at 11:14:12AM +0000, Wei Hu wrote:
Hi Wei Hu,
some minor nits from my side.
...
> @@ -69,11 +76,35 @@ int mana_ib_destroy_cq(struct ib_cq *ibcq, struct ib_udata *udata)
> struct mana_ib_cq *cq = container_of(ibcq, struct mana_ib_cq, ibcq);
> struct ib_device *ibdev = ibcq->device;
> struct mana_ib_dev *mdev;
> + struct gdma_context *gc;
> + struct gdma_dev *gd;
> + int err;
> +
>
> mdev = container_of(ibdev, struct mana_ib_dev, ib_dev);
> + gd = mdev->gdma_dev;
> + gc = gd->gdma_context;
> +
>
> - mana_ib_gd_destroy_dma_region(mdev, cq->gdma_region);
> - ib_umem_release(cq->umem);
> +
> + if (atomic_read(&ibcq->usecnt) == 0) {
> + err = mana_ib_gd_destroy_dma_region(mdev, cq->gdma_region);
> + if (err) {
> + ibdev_dbg(ibdev,
> + "Faile to destroy dma region, %d\n", err);
nit: Faile -> Failed
> + return err;
> + }
> + kfree(gc->cq_table[cq->id]);
> + gc->cq_table[cq->id] = NULL;
> + ib_umem_release(cq->umem);
> + }
>
> return 0;
> }
...
> diff --git a/drivers/infiniband/hw/mana/main.c b/drivers/infiniband/hw/mana/main.c
> index 7be4c3adb4e2..e2affb6ae5ad 100644
> --- a/drivers/infiniband/hw/mana/main.c
> +++ b/drivers/infiniband/hw/mana/main.c
> @@ -143,6 +143,79 @@ int mana_ib_dealloc_pd(struct ib_pd *ibpd, struct ib_udata *udata)
> return err;
> }
>
> +static void mana_ib_destroy_eq(struct mana_ib_ucontext *ucontext,
> + struct mana_ib_dev *mdev)
> +{
> + struct gdma_context *gc = mdev->gdma_dev->gdma_context;
> + struct ib_device *ibdev = ucontext->ibucontext.device;
nit: ibdev is set but unused.
GCC 12.3.0 with W=1 says:
drivers/infiniband/hw/mana/main.c: In function 'mana_ib_destroy_eq':
drivers/infiniband/hw/mana/main.c:150:27: warning: unused variable 'ibdev' [-Wunused-variable]
150 | struct ib_device *ibdev = ucontext->ibucontext.device;
> + struct gdma_queue *eq;
> + int i;
> +
> + if (!ucontext->eqs)
> + return;
> +
> + for (i = 0; i < gc->max_num_queues; i++) {
> + eq = ucontext->eqs[i].eq;
> + if (!eq)
> + continue;
> +
> + mana_gd_destroy_queue(gc, eq);
> + }
> +
> + kfree(ucontext->eqs);
> + ucontext->eqs = NULL;
> +}
...
next prev parent reply other threads:[~2023-06-15 14:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-15 11:14 [PATCH v3 1/1] RDMA/mana_ib: Add EQ interrupt support to mana ib driver Wei Hu
2023-06-15 14:00 ` Simon Horman [this message]
2023-06-16 0:02 ` kernel test robot
2023-06-30 3:19 ` kernel test robot
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=ZIsZZYiYdIM1MxSj@corigine.com \
--to=simon.horman@corigine.com \
--cc=davem@davemloft.net \
--cc=decui@microsoft.com \
--cc=edumazet@google.com \
--cc=haiyangz@microsoft.com \
--cc=jgg@ziepe.ca \
--cc=kuba@kernel.org \
--cc=kys@microsoft.com \
--cc=leon@kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sharmaajay@microsoft.com \
--cc=shradhagupta@linux.microsoft.com \
--cc=ssengar@linux.microsoft.com \
--cc=vkuznets@redhat.com \
--cc=weh@microsoft.com \
--cc=wei.liu@kernel.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