From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH rdma-next 2/5] RDMA/core: Don't depend device ODP capabilities on kconfig option Date: Thu, 20 Dec 2018 23:22:53 +0000 Message-ID: <20181220232247.GV29267@mellanox.com> References: <20181220092318.32672-1-leon@kernel.org> <20181220092318.32672-3-leon@kernel.org> <20181220172045.GG29267@mellanox.com> <20181220172956.GC3940@mtr-leonro.mtl.com> <20181220173306.GI29267@mellanox.com> <20181220175020.GD3940@mtr-leonro.mtl.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: Doug Ledford , RDMA mailing list , Haggai Eran , Saeed Mahameed , linux-netdev To: Leon Romanovsky Return-path: Received: from mail-eopbgr80077.outbound.protection.outlook.com ([40.107.8.77]:13680 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732380AbeLTXXA (ORCPT ); Thu, 20 Dec 2018 18:23:00 -0500 In-Reply-To: <20181220175020.GD3940@mtr-leonro.mtl.com> Content-Language: en-US Content-ID: Sender: netdev-owner@vger.kernel.org List-ID: On Thu, Dec 20, 2018 at 07:50:20PM +0200, Leon Romanovsky wrote: > > > > > -#ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING > > > > > if (MLX5_CAP_GEN(mdev, pg)) > > > > > props->device_cap_flags |=3D IB_DEVICE_ON_DEMAND_PAGING; > > > > > props->odp_caps =3D dev->odp_caps; > > > > > -#endif > > > > > > > > But shouldn't this be protected? If the driver has compiled out ODP= it > > > > shouldn't set the cap flag... > > > > > > I see those capabilities as device properties and not as kernel ones. > > > > > > Current situation looks bad for me, when I have same device which > > > reports differently information depends on some compilation flag. > > > > It is not device capabilities, it is a kernel API capability if the > > API is not available the bit should not be set. >=20 > Is it better? Should I resend the series? Hrm.. I think I'm inclined to keep the the if() in the same place as the ifdefs. We can revise it later. I noticed other busted up stuff: - IB_DEVICE_ON_DEMAND_PAGING is apparently UAPI but not in a uapi header (grr) - ucontext shouldn't have a driver callback, that should be moved to ops (ie to mlx5_ib_dev_odp_ops) - IB_DEVICE_ON_DEMAND_PAGING should be set in core code based on ops.invalidate_range being present, drivers shouldn't set it.. Jason