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=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 BB53FC282E1 for ; Wed, 24 Apr 2019 13:46:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 885A7218FD for ; Wed, 24 Apr 2019 13:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556113572; bh=uP3MATuyB2p95POBygbT8sFnboC+JJEXXHb1+AiTP3M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=VTO0q+7A7tX+f14I8zVO2ezkahGgCXfha3KXuxLcL6W6SN3u2Rk/xdUSw/V91aQ23 NKXTA+SiHBVKG861qf9AQ4zEkZzxoK+iFfqk/WLxcoaHlkse8km1klaupX7HE7zzap JE3iXGK99eKF4gDVTiiCIYf0V+jCCQs9kZH1ca70= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730637AbfDXNqL (ORCPT ); Wed, 24 Apr 2019 09:46:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:45538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726427AbfDXNqL (ORCPT ); Wed, 24 Apr 2019 09:46:11 -0400 Received: from localhost (unknown [77.138.135.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 398D921901; Wed, 24 Apr 2019 13:46:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556113569; bh=uP3MATuyB2p95POBygbT8sFnboC+JJEXXHb1+AiTP3M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=It9vGAu8+KR5X4e081GA+dnNfRly5KSy2moXwlU8aIWC1aWEOUKSJOaXzSsoQ8ZRN miTCU/6b2c1gNX8103xv/WFhdH4k9HU3nFli6nUePl48/k89Qn4y9gNn1F/kHVDxpW /5Z9ZL2r7LOVXv0Eo+A35Vvp92p99erXCwDW1mEo= Date: Wed, 24 Apr 2019 16:46:04 +0300 From: Leon Romanovsky To: Jason Gunthorpe 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: <20190424134604.GI27901@mtr-leonro.mtl.com> References: <20190331164450.23618-1-leon@kernel.org> <20190331164450.23618-5-leon@kernel.org> <20190424130440.GA5196@ziepe.ca> <20190424131222.GG27901@mtr-leonro.mtl.com> <20190424131405.GE16061@ziepe.ca> <20190424132516.GH27901@mtr-leonro.mtl.com> <20190424133553.GF16061@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190424133553.GF16061@ziepe.ca> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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. Thanks > > Jason