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=-16.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 D2698C433DB for ; Tue, 5 Jan 2021 12:41:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A0171229C5 for ; Tue, 5 Jan 2021 12:41:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728532AbhAEMl3 (ORCPT ); Tue, 5 Jan 2021 07:41:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:51700 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726189AbhAEMl3 (ORCPT ); Tue, 5 Jan 2021 07:41:29 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8413A229F0; Tue, 5 Jan 2021 12:40:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609850448; bh=HC9Rjmfsm3jd7AV8BBYgVuzfbob3rCRaZm49+yu/ObE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lImY4MEnl7Eji0fyfIGTQdmgqV8ZqmsGy+Z+SnKbjebecYYuP7Hyn8sSOCmf310hn TY6sxwwVvgvT9Jwwz1WzC5OsyaW8lUktlycxiS9RNE5EikoEnrhP6teTXc1P+ddSY+ 40kO52V0Zv0+y07xfQHzIPb0yj8LYGGRV4lZj94kMyCnWlpj4jSneF6c96ATvcizbj DXLblh+qfcNj1Z3LX6lO4VpigMPdmUerzXCShjHKJ11gKuCo0u2O9GXnqqYaVwUCwm uevmPq3C+geehd+YLSiJoYolDc/ii+dPZWGAj8vgug1gBIhJYj1UVGTjKfJPVWKxRx seOixoqsb+5/Q== Date: Tue, 5 Jan 2021 14:40:44 +0200 From: Leon Romanovsky To: Gal Pressman Cc: Jason Gunthorpe , Doug Ledford , linux-rdma@vger.kernel.org, Alexander Matushevsky , Firas JahJah , Leonid Feschuk , Yossi Leybovich Subject: Re: [PATCH for-next 1/2] RDMA/efa: Move host info set to first ucontext allocation Message-ID: <20210105124044.GS31158@unreal> References: <20210105104326.67895-1-galpress@amazon.com> <20210105104326.67895-2-galpress@amazon.com> <20210105112150.GR31158@unreal> <4f3de61c-55dc-e6e3-6a14-de5be10e3ecd@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4f3de61c-55dc-e6e3-6a14-de5be10e3ecd@amazon.com> Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Tue, Jan 05, 2021 at 02:22:23PM +0200, Gal Pressman wrote: > On 05/01/2021 13:21, Leon Romanovsky wrote: > > On Tue, Jan 05, 2021 at 12:43:25PM +0200, Gal Pressman wrote: > >> Downstream patch will require the userspace version which is passed as > >> part of ucontext allocation. Move the host info set there and make sure > >> it's only called once (on the first allocation). > >> > >> Reviewed-by: Firas JahJah > >> Reviewed-by: Leonid Feschuk > >> Signed-off-by: Gal Pressman > >> --- > >> drivers/infiniband/hw/efa/efa.h | 7 +++++++ > >> drivers/infiniband/hw/efa/efa_main.c | 4 +--- > >> drivers/infiniband/hw/efa/efa_verbs.c | 3 +++ > >> 3 files changed, 11 insertions(+), 3 deletions(-) > >> > >> diff --git a/drivers/infiniband/hw/efa/efa.h b/drivers/infiniband/hw/efa/efa.h > >> index e5d9712e98c4..9c9cd5867489 100644 > >> --- a/drivers/infiniband/hw/efa/efa.h > >> +++ b/drivers/infiniband/hw/efa/efa.h > >> @@ -45,6 +45,11 @@ struct efa_stats { > >> atomic64_t keep_alive_rcvd; > >> }; > >> > >> +enum { > >> + EFA_FLAGS_HOST_INFO_SET_BIT, > >> + EFA_FLAGS_NUM, > >> +}; > >> + > >> struct efa_dev { > >> struct ib_device ibdev; > >> struct efa_com_dev edev; > >> @@ -62,6 +67,7 @@ struct efa_dev { > >> struct efa_irq admin_irq; > >> > >> struct efa_stats stats; > >> + DECLARE_BITMAP(flags, EFA_FLAGS_NUM); > >> }; > > > > Why do you need such over-engineering? > > What is wrong with old school "u8 flag"? > > The main reason is for the atomic test_and_set_bit() usage, otherwise it would > be an atomic flag, not u8 flag. But efa_dev can be opened with different applications and they can have different user space versions, but you are setting this info for the first caller only. How will it help for the debug? Thanks