All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Saeed Mahameed <saeed@kernel.org>
Cc: Jason Gunthorpe <jgg@nvidia.com>,
	Yishai Hadas <yishaih@nvidia.com>,
	Doug Ledford <dledford@redhat.com>,
	Jakub Kicinski <kuba@kernel.org>,
	linux-rdma@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH mlx5-next v1] RDMA/mlx5: Cleanup the synchronize_srcu() from the ODP flow
Date: Tue, 2 Feb 2021 08:43:49 +0200	[thread overview]
Message-ID: <20210202064349.GA1945456@unreal> (raw)
In-Reply-To: <b6dc9fc1532a17efd7fdc33d65641626d9760183.camel@kernel.org>

On Mon, Feb 01, 2021 at 12:03:15PM -0800, Saeed Mahameed wrote:
> On Mon, 2021-02-01 at 15:49 -0400, Jason Gunthorpe wrote:
> > On Sun, Jan 31, 2021 at 03:24:50PM +0200, Yishai Hadas wrote:
> > > On 1/29/2021 2:23 PM, Saeed Mahameed wrote:
> > > > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/mr.c
> > > > > b/drivers/net/ethernet/mellanox/mlx5/core/mr.c
> > > > > index 9eb51f06d3ae..50af84e76fb6 100644
> > > > > +++ b/drivers/net/ethernet/mellanox/mlx5/core/mr.c
> > > > > @@ -56,6 +56,7 @@ int mlx5_core_create_mkey(struct
> > > > > mlx5_core_dev
> > > > > *dev,
> > > > >          mkey->size = MLX5_GET64(mkc, mkc, len);
> > > > >          mkey->key |= mlx5_idx_to_mkey(mkey_index);
> > > > >          mkey->pd = MLX5_GET(mkc, mkc, pd);
> > > > > +       init_waitqueue_head(&mkey->wait);
> > > > >
> > > > >          mlx5_core_dbg(dev, "out 0x%x, mkey 0x%x\n",
> > > > > mkey_index, mkey-
> > > > > > key);
> > > > >          return 0;
> > > > > diff --git a/include/linux/mlx5/driver.h
> > > > > b/include/linux/mlx5/driver.h
> > > > > index 4901b4fadabb..f9e7036ae5a5 100644
> > > > > +++ b/include/linux/mlx5/driver.h
> > > > > @@ -373,6 +373,8 @@ struct mlx5_core_mkey {
> > > > >          u32                     key;
> > > > >          u32                     pd;
> > > > >          u32                     type;
> > > > > +       struct wait_queue_head wait;
> > > > > +       refcount_t usecount;
> > > > mlx5_core_mkey is used everywhere in mlx5_core and we don't care
> > > > about
> > > > odp complexity, i would like to keep the core simple and
> > > > primitive as
> > > > it is today.
> > > > please keep the layer separation and find a way to manage
> > > > refcount and
> > > > wait queue in mlx5_ib driver..
> > > >
> > > The alternative could really be to come with some wrapped mlx5_ib
> > > structure
> > > that will hold 'mlx5_core_mkey' and will add those two fields.
> >
> > Yes
> >
> > struct mlx5_ib_mkey
> > {
> >    struct mlx5_core_mkey mkey;
> >    struct wait_queue_head wait;
> >    refcount_t usecount;
> > }
> >
> > struct mlx5_ib_mr/mw/devx
> > {
> >     struct mlx5_ib_mkey mkey;
> > }
> >
>
> Yep, also i have a series internally that moves mlx5_core_mkey to
> mlx5_ib, in mlx5_core we don't need it we only need the u32 key :)
>
> I will send you this series internally.

Let's first finish this patch and perform "moving" later.

Thanks

>
>

      reply	other threads:[~2021-02-02  6:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28  6:48 [PATCH mlx5-next v1] RDMA/mlx5: Cleanup the synchronize_srcu() from the ODP flow Leon Romanovsky
     [not found] ` <c79124a204f2207f5f1fae69cc34fb08d91d3535.camel@kernel.org>
     [not found]   ` <549b337b-b51e-c984-a4d8-72f9f738be9c@nvidia.com>
2021-02-01 19:49     ` Jason Gunthorpe
2021-02-01 20:03       ` Saeed Mahameed
2021-02-02  6:43         ` Leon Romanovsky [this message]

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=20210202064349.GA1945456@unreal \
    --to=leon@kernel.org \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=saeed@kernel.org \
    --cc=yishaih@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.