[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4225681.X40Xeo72dr@wuerfel>
Date: Wed, 19 Oct 2016 17:15:10 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Binoy Jayan <binoy.jayan@...aro.org>
Cc: Doug Ledford <dledford@...hat.com>,
Sean Hefty <sean.hefty@...el.com>,
Hal Rosenstock <hal.rosenstock@...il.com>,
linux-rdma@...r.kernel.org,
Linux kernel mailing list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 6/8] IB/hns: Replace counting semaphore event_sem with wait condition
On Tuesday, October 18, 2016 10:46:45 AM CEST Binoy Jayan wrote:
> Thank you for replying for the questions. I''ll look for alternatives
> for patches 6,7 and 8 and resend the series.
Ok, thanks!
I also looked at patch 8 some more and noticed that those four
functions all do the exact same sequence:
- initialize a mlx5_ib_umr_context on the stack
- assign "umrwr.wr.wr_cqe = &umr_context.cqe"
- take the semaphore
- call ib_post_send with a single ib_send_wr
- wait for the mlx5_ib_umr_done() function to get called
- if we get back a failure, print a warning and return -EFAULT.
- release the semaphore
Moving all of these into a shared helper function would be
a good cleanup, and it leaves only a single function using
the semaphore, which can then be rewritten to use something
else.
The existing completion in there can be simplified to a
wait_event, since we are waiting for the return value to
be filled.
Arnd
Powered by blists - more mailing lists