Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Gal Pressman <galpress@amazon.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>,
	Doug Ledford <dledford@redhat.com>,
	linux-rdma@vger.kernel.org,
	Alexander Matushevsky <matua@amazon.com>,
	Firas JahJah <firasj@amazon.com>,
	Leonid Feschuk <lfesch@amazon.com>,
	Yossi Leybovich <sleybo@amazon.com>
Subject: Re: [PATCH for-next 1/2] RDMA/efa: Move host info set to first ucontext allocation
Date: Tue, 5 Jan 2021 14:40:44 +0200	[thread overview]
Message-ID: <20210105124044.GS31158@unreal> (raw)
In-Reply-To: <4f3de61c-55dc-e6e3-6a14-de5be10e3ecd@amazon.com>

On Tue, Jan 05, 2021 at 02:22:23PM +0200, Gal Pressman wrote:
> On 05/01/2021 13:21, Leon Romanovsky wrote:
> > On Tue, Jan 05, 2021 at 12:43:25PM +0200, Gal Pressman wrote:
> >> Downstream patch will require the userspace version which is passed as
> >> part of ucontext allocation. Move the host info set there and make sure
> >> it's only called once (on the first allocation).
> >>
> >> Reviewed-by: Firas JahJah <firasj@amazon.com>
> >> Reviewed-by: Leonid Feschuk <lfesch@amazon.com>
> >> Signed-off-by: Gal Pressman <galpress@amazon.com>
> >> ---
> >>  drivers/infiniband/hw/efa/efa.h       | 7 +++++++
> >>  drivers/infiniband/hw/efa/efa_main.c  | 4 +---
> >>  drivers/infiniband/hw/efa/efa_verbs.c | 3 +++
> >>  3 files changed, 11 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/infiniband/hw/efa/efa.h b/drivers/infiniband/hw/efa/efa.h
> >> index e5d9712e98c4..9c9cd5867489 100644
> >> --- a/drivers/infiniband/hw/efa/efa.h
> >> +++ b/drivers/infiniband/hw/efa/efa.h
> >> @@ -45,6 +45,11 @@ struct efa_stats {
> >>       atomic64_t keep_alive_rcvd;
> >>  };
> >>
> >> +enum {
> >> +     EFA_FLAGS_HOST_INFO_SET_BIT,
> >> +     EFA_FLAGS_NUM,
> >> +};
> >> +
> >>  struct efa_dev {
> >>       struct ib_device ibdev;
> >>       struct efa_com_dev edev;
> >> @@ -62,6 +67,7 @@ struct efa_dev {
> >>       struct efa_irq admin_irq;
> >>
> >>       struct efa_stats stats;
> >> +     DECLARE_BITMAP(flags, EFA_FLAGS_NUM);
> >>  };
> >
> > Why do you need such over-engineering?
> > What is wrong with old school "u8 flag"?
>
> The main reason is for the atomic test_and_set_bit() usage, otherwise it would
> be an atomic flag, not u8 flag.

But efa_dev can be opened with different applications and they can have
different user space versions, but you are setting this info for the
first caller only. How will it help for the debug?

Thanks

  reply	other threads:[~2021-01-05 12:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-05 10:43 [PATCH for-next 0/2] Host information userspace version Gal Pressman
2021-01-05 10:43 ` [PATCH for-next 1/2] RDMA/efa: Move host info set to first ucontext allocation Gal Pressman
2021-01-05 11:21   ` Leon Romanovsky
2021-01-05 12:22     ` Gal Pressman
2021-01-05 12:40       ` Leon Romanovsky [this message]
2021-01-05 13:39         ` Gal Pressman
2021-01-05 10:43 ` [PATCH for-next 2/2] RDMA/efa: Report userspace version in host info Gal Pressman
2021-01-19  7:17 ` [PATCH for-next 0/2] Host information userspace version Gal Pressman
2021-01-19  8:46   ` Leon Romanovsky
2021-01-19  9:10     ` Gal Pressman
2021-01-19 11:58       ` Leon Romanovsky
2021-01-19 13:19         ` Gal Pressman
2021-01-19 13:34           ` Leon Romanovsky
2021-01-21 18:35   ` Jason Gunthorpe
2021-01-21 19:40     ` Gal Pressman
2021-01-27 16:57       ` Jason Gunthorpe
2021-01-27 17:53         ` Gal Pressman
2021-02-28  9:56           ` Gal Pressman
2021-03-02  0:04             ` Jason Gunthorpe

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=20210105124044.GS31158@unreal \
    --to=leon@kernel.org \
    --cc=dledford@redhat.com \
    --cc=firasj@amazon.com \
    --cc=galpress@amazon.com \
    --cc=jgg@nvidia.com \
    --cc=lfesch@amazon.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=matua@amazon.com \
    --cc=sleybo@amazon.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