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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1DEDEB64DC for ; Mon, 3 Jul 2023 13:33:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231553AbjGCNdU (ORCPT ); Mon, 3 Jul 2023 09:33:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231820AbjGCNdI (ORCPT ); Mon, 3 Jul 2023 09:33:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB83310EA; Mon, 3 Jul 2023 06:32:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8765660F29; Mon, 3 Jul 2023 13:32:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89AB0C433C8; Mon, 3 Jul 2023 13:32:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688391166; bh=pk+2FTd4Zcg93LZyEvVLp7It0/fYBTya/f/EBtYUFN4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=B9ktR5ETbn+AAXn7P5ssFOFeAqcEeGK2LBn0WnJKo/tGi1/Hv6mWs2mxeso8jixCF RTwKY54tdXE/kGBekc9qC3EbJjJUhwE1fgcy5d6Mc8uJDTxyLsAwOU3Z2GpdW5TWLW go4R7lRZiQYwtq/cg1g4ZTb8bzDGC2EXvudt6dLERIOZhNT0D/6r97V7wY6npYXQHB FmIeu2KkwEKzrA/PgMeCZSjXUP/1bHOzCpbiJPBXqGhJkLhI/Tpy1s0GC35cpPpDJm eOlRROvlPEdkb/UR7khuqdS2lDeLRbivg0IwWcq4eg0rXDXJSdOZzBkUY+PjplMYyo FoNpdJ5T0E/wA== Date: Mon, 3 Jul 2023 16:32:42 +0300 From: Leon Romanovsky To: Linus Torvalds , Arnd Bergmann Cc: Jason Gunthorpe , Selvin Xavier , Arnd Bergmann , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] RDMA: fix INFINIBAND_USER_ACCESS dependency Message-ID: <20230703133242.GB32152@unreal> References: <20230703113025.356682-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230703113025.356682-1-arnd@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 03, 2023 at 01:30:06PM +0200, Arnd Bergmann wrote: > From: Arnd Bergmann > > After a change to the bnxt_re driver, it fails to link when > CONFIG_INFINIBAND_USER_ACCESS is disabled: > > aarch64-linux-ld: drivers/infiniband/hw/bnxt_re/ib_verbs.o: in function `bnxt_re_handler_BNXT_RE_METHOD_ALLOC_PAGE': > ib_verbs.c:(.text+0xd64): undefined reference to `ib_uverbs_get_ucontext_file' > aarch64-linux-ld: drivers/infiniband/hw/bnxt_re/ib_verbs.o:(.rodata+0x168): undefined reference to `uverbs_idr_class' > aarch64-linux-ld: drivers/infiniband/hw/bnxt_re/ib_verbs.o:(.rodata+0x1a8): undefined reference to `uverbs_destroy_def_handler' > > The problem is that the 'bnxt_re_uapi_defs' structure is built > unconditionally and references a couple of functions that are never > really called in this configuration but instead require other functions > that are left out. > > Adding an #ifdef around the new code, or a Kconfig dependency would > address this problem, but adding the compile-time check inside of the > UAPI_DEF_CHAIN_OBJ_TREE_NAMED() macro seems best because that also > addresses the problem in other drivers that may run into the same > dependency. > > Fixes: 360da60d6c6ed ("RDMA/bnxt_re: Enable low latency push") > Signed-off-by: Arnd Bergmann > --- > include/rdma/uverbs_ioctl.h | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > Thanks, Acked-by: Leon Romanovsky Linus, can you please apply this patch directly as it is overkill to send PR for one patch? https://lore.kernel.org/all/20230703113025.356682-1-arnd@kernel.org Thanks