Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758943AbcJYMYA (ORCPT ); Tue, 25 Oct 2016 08:24:00 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:51522 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758640AbcJYMX5 (ORCPT ); Tue, 25 Oct 2016 08:23:57 -0400 From: Arnd Bergmann To: Binoy Jayan Cc: Doug Ledford , Sean Hefty , Hal Rosenstock , 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 Message-ID: <5098701.SVmQeRIiho@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <1477396919-27669-9-git-send-email-binoy.jayan@linaro.org> References: <1477396919-27669-1-git-send-email-binoy.jayan@linaro.org> <1477396919-27669-9-git-send-email-binoy.jayan@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:4CYmQA2zOveiNEDailuzOIMo6ygqqjsC866cCPsSNJbMMUvc4P4 87DtHlAmQxe3kaF+Ac+CRx/370s8CpKClPx+dO90P9tLCeD6S5j+3m0W+SAI4G/vdor2c+V gGS1Yew2yhpQ/BIDlonf/h+xKav9Zdg6yH4dsYm2S4mKZyks0NnKbAjSWNiElTv6Ow8YRnn tU8o8cUM48R0Cpw0YLeiw== X-UI-Out-Filterresults: notjunk:1;V01:K0:l/VYzGxQlhc=:5KlE5uzCKsmY3PVglmDK0V MWvfTGO+x+dVbeFibu4tQp8NFJAfND4ujukKW3ezrkzXxZxW+pm+YOojjz33/rv8kWg2G3jLO ee3sv9+PEB47vdoVKd3a09jz1A6lzzSpCQYjwSDv3ZtFeBY3AMVS8OlNXZ5HcopWWBsQGPdL2 jxunIhbYDXLRDGfUS+U5DLeXd4DBqW9Xh9Sph6V53QmOF/FAWnQ8Ces2tD6oBfyjfHiohp3Vd fg6KawfrpomP5YPrnIHgtHt5f4CXBWXA60cQCSp8Gp3smh+GgZ9Sg8pHUh0Vi+grWvbQsvKqD QZF/KdJuqtCe2kIirFA+nttq8JB9my7i4/evkcDQ+YoemQgPmujnF7S6uUHxRaSHhrMNgR9td f0DzwK3j1QxOj+/ghwNknqncADu+wuKjMAWueL4tl9Q3sMb/rDM0HkLNc6YkX+hHJu3HfZ0wm F/rxc1OoZy5LzVrQcCtZTCbw/17chhZxqRJdxBMGqv0T9O+m5Ismpl4AJVDDMdjBATeYmosE9 tiEvvw4i2S30ay24U3mSJ5tc1fTx5xv6z7wHVQCYWJhYkv2lqCeMToR6145WmS89/vvo326kw CrnqHX5mcFotq2SmsyCB3l8BtPWovhXQ92IhLjwiXDtG+Zh1l0QrjD0ebhd05l2/RVXqIPkd+ thdwuv+jhnq+0VAxmRryjvkAmyz7Bc8DS0x98/YJLFDi8J4pesn3lVwJ+Gl3VCjj/KJXL0tqt OKdWTJuqBm/IwM3q Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1567 Lines: 39 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 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