From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10753C43219 for ; Sun, 28 Apr 2019 11:56:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C2D88206C1 for ; Sun, 28 Apr 2019 11:56:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="FXXAA3dg" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726674AbfD1L4o (ORCPT ); Sun, 28 Apr 2019 07:56:44 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:40068 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726598AbfD1L4o (ORCPT ); Sun, 28 Apr 2019 07:56:44 -0400 Received: by mail-qt1-f193.google.com with SMTP id y49so3331027qta.7 for ; Sun, 28 Apr 2019 04:56:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5w73k3UlEwiKNnP4Klejjq5WGTukb/j1768aTQhq2Jk=; b=FXXAA3dgbQShN/R/hktl3EqHXD1VG5zxdFMyD01IzD6Z4Lz+ynw21DjnnJWr3IsHhK /vqItPVLjtIK4girDoONa/7qP0baGqQh+yVpb2a94D6RmNuSjVSyFLMpBmr1XItjhoLW fgZahUJLAF+qsrEMEMQ4Wc9YfG4Hp2dlHrajV/1XU5ZwO0dAB2uA9TpY6mRnxf50NI20 fWTwAZ/11pLexO9KFz7sRgtcpbN+ys3/SMV7YdLl5g1V83dH8j2iQwbsgt7+6Vt7pd5P /apOnebo9aTLthe69ch0LMf6R/BBqgnSZo+/UTIs9ud4cQ5VDkteEIHtsVUUqn1LuFEf +h/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5w73k3UlEwiKNnP4Klejjq5WGTukb/j1768aTQhq2Jk=; b=LsSjhknk1dvuVSUpjFkZGsDZRa8HeaiGyNkUGqiaAtcq2X1KYmo23zyvqJz4Y0lhwq J1h98q3AvLe96b3x+ZETaXnvmObUzGThpKCqwtEl2wKlyrjc8jKXyvQlZgD5QwMNzj0O uicvKvG64zj9GgLhpm9nE3OIRsl+56FdOGSnp3YMKsJFDCgWBIzYGwNMOmg9YtsTiv0J J1gLTG8IQN7m9H8n/1Zxxaa+LcJk2mOSyZjYrFjBlBcqXGXSqe4iIxEoJVUcrJABP4mq sWl4o/CMJDRy+JD4KaX+36bej85A1oos8YuUeXuvj4+awxeiAfj86kL2NvDfoNDLydCS BJ0A== X-Gm-Message-State: APjAAAVN6543ME6rmFDxo3angppR/XKEFcqDvAjc/FLzJatal+UE5ImT Lp38UoHJz/RBvv1reHexjtVKvg== X-Google-Smtp-Source: APXvYqw9ICwsbGtYlDxlQ1eRLUNiDK+a5lLnVKBu2n71z8oqz0XaI6h3QttrwbPYA37Z6sT0koloNw== X-Received: by 2002:ac8:3368:: with SMTP id u37mr34002921qta.322.1556452603020; Sun, 28 Apr 2019 04:56:43 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id a124sm344212qkd.3.2019.04.28.04.56.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Apr 2019 04:56:42 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hKiQD-0003CY-OB; Sun, 28 Apr 2019 08:56:41 -0300 Date: Sun, 28 Apr 2019 08:56:41 -0300 From: Jason Gunthorpe To: Leon Romanovsky Cc: Doug Ledford , RDMA mailing list , Ariel Levkovich , Eli Cohen , Mark Bloch , Saeed Mahameed , linux-netdev Subject: Re: [PATCH rdma-next 4/8] IB/mlx5: Add steering SW ICM device memory type Message-ID: <20190428115641.GE2278@ziepe.ca> References: <20190424131405.GE16061@ziepe.ca> <20190424132516.GH27901@mtr-leonro.mtl.com> <20190424133553.GF16061@ziepe.ca> <20190424134604.GI27901@mtr-leonro.mtl.com> <20190424134703.GG16061@ziepe.ca> <20190424154937.GJ27901@mtr-leonro.mtl.com> <20190424155313.GI16061@ziepe.ca> <20190424162736.GK27901@mtr-leonro.mtl.com> <20190424163926.GL16061@ziepe.ca> <20190428113848.GK6705@mtr-leonro.mtl.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190428113848.GK6705@mtr-leonro.mtl.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 > > > > > > > > > > > > > > > > > > > > > > > > > > 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 > > > > > > > > > > > > > Reviewed-by: Eli Cohen > > > > > > > > > > > > > Reviewed-by: Mark Bloch > > > > > > > > > > > > > Signed-off-by: Leon Romanovsky > > > > > > > > > > > > > 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