From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932665AbcFOQFT (ORCPT ); Wed, 15 Jun 2016 12:05:19 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:33184 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753161AbcFOQFP (ORCPT ); Wed, 15 Jun 2016 12:05:15 -0400 MIME-Version: 1.0 In-Reply-To: <20160615152816.2800830-1-arnd@arndb.de> References: <20160615152816.2800830-1-arnd@arndb.de> From: Saeed Mahameed Date: Wed, 15 Jun 2016 19:04:54 +0300 Message-ID: Subject: Re: [PATCH 1/2] mlx5: only register devlink when ethernet is available To: Arnd Bergmann Cc: Matan Barak , Leon Romanovsky , "David S. Miller" , Saeed Mahameed , Or Gerlitz , Doug Ledford , Eli Cohen , Majd Dibbiny , Linux Netdev List , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 15, 2016 at 6:27 PM, Arnd Bergmann wrote: > We get a build error with the mlx5 driver when the ethernet > support (CONFIG_MLX5_CORE_EN) is disabled: > > drivers/net/ethernet/mellanox/mlx5/core/main.c:1320:22: error: 'mlx5_devlink_eswitch_mode_set' undeclared here (not in a function) > drivers/net/ethernet/mellanox/mlx5/core/main.c:1321:22: error: 'mlx5_devlink_eswitch_mode_get' undeclared here (not in a function) > drivers/net/built-in.o:(.rodata+0x25a68): undefined reference to `mlx5_devlink_eswitch_mode_get' > drivers/net/built-in.o:(.rodata+0x25a6c): undefined reference to `mlx5_devlink_eswitch_mode_set' > > There are actually two problems here, but they are closely related, > so I'm addressing them both: > > - The header is included under an #ifdef, which is usually a bad idea > as it hides the function declarations, so we fail to compile even > if we don't actually use the functions in the end. > - The references to the functions are kept in the object file because > we don't check whether they are built-in or not. > > As we don't want to add any useless #ifdef here, this uses an > IS_ENABLED() check to drop the mlx5_devlink_ops structure when we don't > need it, and to skip the register/unregister step. > > Signed-off-by: Arnd Bergmann > Fixes: f7856daf57b9 ("net/mlx5: Add devlink interface") Hi Arnd, We already took care of those issues, they only apply to Leon's tree https://git.kernel.org/cgit/linux/kernel/git/leon/linux-rdma.git/, this tree is meant to maintain MLX5 Shared code between netdev and linux-rdma trees prior to submission to both trees. This patch is a non-shared code and it only exists in https://git.kernel.org/cgit/linux/kernel/git/leon/linux-rdma.git/log/?h=topic/net-next-mlx5. It is yet to be submitted to Dave's net/net-next tree. later on, this patch and all the others will go through the normal submission process. For the future I don't see any reason to CC the whole netdev, rdma and kernel folks. Unless you, Dave and Doug think otherwise. Thanks Saeed.