public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Binoy Jayan <binoy.jayan@linaro.org>
Cc: Doug Ledford <dledford@redhat.com>,
	Sean Hefty <sean.hefty@intel.com>,
	Hal Rosenstock <hal.rosenstock@gmail.com>,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 8/8] IB/mlx5: Add helper mlx5_ib_post_send_wait
Date: Tue, 25 Oct 2016 14:23:43 +0200	[thread overview]
Message-ID: <5098701.SVmQeRIiho@wuerfel> (raw)
In-Reply-To: <1477396919-27669-9-git-send-email-binoy.jayan@linaro.org>

On Tuesday, October 25, 2016 5:31:59 PM CEST Binoy Jayan wrote:
> Clean up common code (to post a list of work requests to the send queue of
> the specified QP) at various places and add a helper function
> 'mlx5_ib_post_send_wait' to implement the same. The counting semaphore
> 'umr_common:sem' is also moved into the helper. This may later be modified
> to replace the semaphore with an alternative.
> 
> Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>

Looks reasonable.

> ---
>  drivers/infiniband/hw/mlx5/mr.c | 96 +++++++++++++----------------------------
>  1 file changed, 29 insertions(+), 67 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
> index d4ad672..261984b 100644
> --- a/drivers/infiniband/hw/mlx5/mr.c
> +++ b/drivers/infiniband/hw/mlx5/mr.c
> @@ -856,16 +856,38 @@ static inline void mlx5_ib_init_umr_context(struct mlx5_ib_umr_context *context)
>  	init_completion(&context->done);
>  }
>  
> +static inline int mlx5_ib_post_send_wait(struct mlx5_ib_dev *dev,
> +					 struct mlx5_ib_umr_context *umr_context,
> +					 struct mlx5_umr_wr *umrwr)
> +{
> +	struct umr_common *umrc = &dev->umrc;
> +	struct ib_send_wr __maybe_unused *bad;

Did you get a warning about 'bad' being unused here? I would have
guessed not, since the original code was not that different and
it does get passed into a function.

Why not move the umr_context variable into this function too?
The only thing we ever seem to do to is initialize it and
assign the wr_cqe pointer, both of which can be done here.

	Arnd

  reply	other threads:[~2016-10-25 12:23 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-25 12:01 [PATCH v2 0/8] infiniband: Remove semaphores Binoy Jayan
2016-10-25 12:01 ` [PATCH v2 3/8] IB/hns: Replace semaphore poll_sem with mutex Binoy Jayan
2016-10-25 12:01 ` [PATCH v2 4/8] IB/mthca: " Binoy Jayan
2016-10-25 12:01 ` [PATCH v2 5/8] IB/isert: Replace semaphore sem with completion Binoy Jayan
2016-10-25 12:01 ` [PATCH v2 6/8] IB/hns: Replace counting semaphore event_sem with wait_event Binoy Jayan
     [not found]   ` <1477396919-27669-7-git-send-email-binoy.jayan-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-10-25 12:28     ` Arnd Bergmann
2016-10-25 12:59       ` Binoy Jayan
2016-10-25 13:21         ` Arnd Bergmann
2016-10-25 13:35           ` Binoy Jayan
     [not found] ` <1477396919-27669-1-git-send-email-binoy.jayan-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-10-25 12:01   ` [PATCH v2 1/8] IB/core: iwpm_nlmsg_request: Replace semaphore with completion Binoy Jayan
2016-10-25 12:01   ` [PATCH v2 2/8] IB/core: Replace semaphore sm_sem " Binoy Jayan
2016-10-25 12:43     ` Jack Wang
2016-10-25 15:08       ` Binoy Jayan
     [not found]         ` <CAHv-k_86z3MTYePPQcs5fWSqFeoGxt7UYG_b-SyZGQ7zVW-hSw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-25 15:48           ` Jack Wang
2016-10-25 15:48         ` Jason Gunthorpe
     [not found]           ` <20161025154822.GA27240-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-10-25 20:15             ` Arnd Bergmann
2016-10-25 12:01   ` [PATCH v2 7/8] IB/mthca: Replace counting semaphore event_sem with wait_event Binoy Jayan
2016-10-25 12:01   ` [PATCH v2 8/8] IB/mlx5: Add helper mlx5_ib_post_send_wait Binoy Jayan
2016-10-25 12:23     ` Arnd Bergmann [this message]
2016-10-25 12:46       ` Binoy Jayan
2016-10-25 12:26     ` Leon Romanovsky
2016-10-25 13:16       ` Binoy Jayan
2016-10-27  6:05         ` Leon Romanovsky
2016-10-27  6:23           ` Binoy Jayan

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=5098701.SVmQeRIiho@wuerfel \
    --to=arnd@arndb.de \
    --cc=binoy.jayan@linaro.org \
    --cc=dledford@redhat.com \
    --cc=hal.rosenstock@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sean.hefty@intel.com \
    /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