All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Leon Romanovsky <leon@kernel.org>
Cc: Doug Ledford <dledford@redhat.com>,
	RDMA mailing list <linux-rdma@vger.kernel.org>,
	Ariel Levkovich <lariel@mellanox.com>,
	Eli Cohen <eli@mellanox.com>, Mark Bloch <markb@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>,
	linux-netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH rdma-next 4/8] IB/mlx5: Add steering SW ICM device memory type
Date: Sun, 28 Apr 2019 08:56:41 -0300	[thread overview]
Message-ID: <20190428115641.GE2278@ziepe.ca> (raw)
In-Reply-To: <20190428113848.GK6705@mtr-leonro.mtl.com>

On Sun, Apr 28, 2019 at 02:38:48PM +0300, Leon Romanovsky wrote:
> On Wed, Apr 24, 2019 at 01:39:26PM -0300, Jason Gunthorpe wrote:
> > On Wed, Apr 24, 2019 at 07:27:36PM +0300, Leon Romanovsky wrote:
> > > On Wed, Apr 24, 2019 at 12:53:13PM -0300, Jason Gunthorpe wrote:
> > > > On Wed, Apr 24, 2019 at 06:49:37PM +0300, Leon Romanovsky wrote:
> > > > > On Wed, Apr 24, 2019 at 10:47:03AM -0300, Jason Gunthorpe wrote:
> > > > > > On Wed, Apr 24, 2019 at 04:46:04PM +0300, Leon Romanovsky wrote:
> > > > > > > On Wed, Apr 24, 2019 at 10:35:53AM -0300, Jason Gunthorpe wrote:
> > > > > > > > On Wed, Apr 24, 2019 at 04:25:16PM +0300, Leon Romanovsky wrote:
> > > > > > > > > On Wed, Apr 24, 2019 at 10:14:05AM -0300, Jason Gunthorpe wrote:
> > > > > > > > > > On Wed, Apr 24, 2019 at 04:12:22PM +0300, Leon Romanovsky wrote:
> > > > > > > > > > > On Wed, Apr 24, 2019 at 10:04:40AM -0300, Jason Gunthorpe wrote:
> > > > > > > > > > > > On Sun, Mar 31, 2019 at 07:44:46PM +0300, Leon Romanovsky wrote:
> > > > > > > > > > > > > From: Ariel Levkovich <lariel@mellanox.com>
> > > > > > > > > > > > >
> > > > > > > > > > > > > This patch adds support for allocating, deallocating and registering
> > > > > > > > > > > > > a new device memory type, STEERING_SW_ICM.
> > > > > > > > > > > > > This memory can be allocated and used by a privileged user for direct
> > > > > > > > > > > > > rule insertion and management of the device's steering tables.
> > > > > > > > > > > > >
> > > > > > > > > > > > > The type is provided by the user via the dedicated attribute in
> > > > > > > > > > > > > the alloc_dm ioctl command.
> > > > > > > > > > > > >
> > > > > > > > > > > > > Signed-off-by: Ariel Levkovich <lariel@mellanox.com>
> > > > > > > > > > > > > Reviewed-by: Eli Cohen <eli@mellanox.com>
> > > > > > > > > > > > > Reviewed-by: Mark Bloch <markb@mellanox.com>
> > > > > > > > > > > > > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> > > > > > > > > > > > >  drivers/infiniband/hw/mlx5/Kconfig        |   2 +-
> > > > > > > > > > > > >  drivers/infiniband/hw/mlx5/cmd.c          | 127 +++++++++++++++++++-
> > > > > > > > > > > > >  drivers/infiniband/hw/mlx5/cmd.h          |   6 +-
> > > > > > > > > > > > >  drivers/infiniband/hw/mlx5/main.c         | 136 +++++++++++++++++++++-
> > > > > > > > > > > > >  drivers/infiniband/hw/mlx5/mlx5_ib.h      |  17 +++
> > > > > > > > > > > > >  drivers/infiniband/hw/mlx5/mr.c           |   7 ++
> > > > > > > > > > > > >  include/uapi/rdma/mlx5_user_ioctl_verbs.h |   2 +
> > > > > > > > > > > > >  7 files changed, 291 insertions(+), 6 deletions(-)
> > > > > > > > > > > > >
> > > > > > > > > > > > > diff --git a/drivers/infiniband/hw/mlx5/Kconfig b/drivers/infiniband/hw/mlx5/Kconfig
> > > > > > > > > > > > > index 8d651c05de62..347d457fcb2f 100644
> > > > > > > > > > > > > +++ b/drivers/infiniband/hw/mlx5/Kconfig
> > > > > > > > > > > > > @@ -1,6 +1,6 @@
> > > > > > > > > > > > >  config MLX5_INFINIBAND
> > > > > > > > > > > > >  	tristate "Mellanox 5th generation network adapters (ConnectX series) support"
> > > > > > > > > > > > > -	depends on NETDEVICES && ETHERNET && PCI && MLX5_CORE
> > > > > > > > > > > > > +	depends on NETDEVICES && ETHERNET && PCI && MLX5_CORE && PHYS_ADDR_T_64BIT
> > > > > > > > > > > >
> > > > > > > > > > > > Why do we need this?
> > > > > > > > > > >
> > > > > > > > > > > We are using phys_addr_t type and not u64 as an input to FW to emphasize
> > > > > > > > > > > the caller interface, but it is different between 32 and 64 bits systems.
> > > > > > > > > > > Such PHYS_ADDR_T_64BIT will ensure that phys_addr_t will be always 64 bits.
> > > > > > > > > >
> > > > > > > > > > ???
> > > > > > > > > >
> > > > > > > > > > PHYS_ADDR_T should only ever be used to store a bus address - and if
> > > > > > > > > > you are passing a bus address to/from FW then you 0 extend it on 32
> > > > > > > > > > bit, and range check on 64 bit.
> > > > > > > > > >
> > > > > > > > > > This is not a reason to force PHYS_ADDR_T_64BIT from a driver
> > > > > > > > >
> > > > > > > > > So how will I mark that we are forwarding physical address to FW?
> > > > > > > >
> > > > > > > > I don't know what this means.. phys_addr_t will transparently 0 extend
> > > > > > > > to 64 bit which is the correct thing to do when passing a phys_addr_t
> > > > > > > > to HW.
> > > > > > >
> > > > > > > It looks to me very similar to what I wanted: mark input as an address
> > > > > > > and ensure that it is always u64 as our FW expects.
> > > > > >
> > > > > > So there is no reason for the kconfig hunk then
> > > > >
> > > > > The kconfig is needed to ensure that u64 value is truncated to be u32 on
> > > > > 32bits systems.
> > > >
> > > > What?
> > >
> > > I wanted to say "not truncated", sorry about that.
> >
> > Are we reading back a u64 physical value from the HW? Where?
> 
> No, we are setting address only.

There there is no need for the kconfig, the phys_addr_t transparently
0 extends to 64 bits which is the right thing to do.

Jason

  reply	other threads:[~2019-04-28 11:56 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-31 16:44 [PATCH rdma-next 0/8] User space steering Leon Romanovsky
2019-03-31 16:44 ` Leon Romanovsky
2019-03-31 16:44 ` [PATCH mlx5-next 1/8] net/mlx5: Expose SW ICM related device memory capabilities Leon Romanovsky
2019-03-31 16:44 ` [PATCH rdma-next 2/8] IB/mlx5: Support device memory type attribute Leon Romanovsky
2019-03-31 16:44 ` [PATCH rdma-next 3/8] IB/mlx5: Warn on allocated MEMIC buffers during cleanup Leon Romanovsky
2019-03-31 16:44 ` [PATCH rdma-next 4/8] IB/mlx5: Add steering SW ICM device memory type Leon Romanovsky
2019-04-24 13:04   ` Jason Gunthorpe
2019-04-24 13:12     ` Leon Romanovsky
2019-04-24 13:14       ` Jason Gunthorpe
2019-04-24 13:25         ` Leon Romanovsky
2019-04-24 13:35           ` Jason Gunthorpe
2019-04-24 13:46             ` Leon Romanovsky
2019-04-24 13:47               ` Jason Gunthorpe
2019-04-24 15:49                 ` Leon Romanovsky
2019-04-24 15:53                   ` Jason Gunthorpe
2019-04-24 16:27                     ` Leon Romanovsky
2019-04-24 16:39                       ` Jason Gunthorpe
2019-04-28 11:38                         ` Leon Romanovsky
2019-04-28 11:56                           ` Jason Gunthorpe [this message]
2019-03-31 16:44 ` [PATCH rdma-next 5/8] IB/mlx5: Device resource control for privileged DEVX user Leon Romanovsky
2019-03-31 16:44 ` [PATCH mlx5-next 6/8] net/mlx5: Expose TIR ICM address in command outbox Leon Romanovsky
2019-03-31 16:44 ` [PATCH mlx5-next 7/8] net/mlx5: Introduce new TIR creation core API Leon Romanovsky
2019-03-31 16:44 ` [PATCH rdma-next 8/8] IB/mlx5: Expose TIR ICM address to user space Leon Romanovsky
2019-03-31 21:06 ` [PATCH rdma-next 0/8] User space steering Jakub Kicinski
2019-04-01  6:28   ` Leon Romanovsky
2019-04-01 18:32     ` Jakub Kicinski
2019-04-02  8:14       ` Leon Romanovsky
2019-04-02 17:10         ` Jakub Kicinski
2019-04-24 13:07 ` Jason Gunthorpe
2019-04-24 16:40   ` Saeed Mahameed
2019-04-24 19:03     ` Jason Gunthorpe
2019-04-24 19:41       ` Saeed Mahameed
2019-04-25 13:34 ` 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=20190428115641.GE2278@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=dledford@redhat.com \
    --cc=eli@mellanox.com \
    --cc=lariel@mellanox.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=markb@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@mellanox.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.