From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755814AbdDEOzg (ORCPT ); Wed, 5 Apr 2017 10:55:36 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:34632 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755791AbdDEOzV (ORCPT ); Wed, 5 Apr 2017 10:55:21 -0400 MIME-Version: 1.0 In-Reply-To: <20170405091110.711-1-tobias.regnery@gmail.com> References: <20170405091110.711-1-tobias.regnery@gmail.com> From: Saeed Mahameed Date: Wed, 5 Apr 2017 10:55:00 -0400 Message-ID: Subject: Re: [PATCH net-next] net/mlx5e: fix build error without CONFIG_SYSFS To: Tobias Regnery Cc: Saeed Mahameed , Linux Netdev List , linux-kernel , "David S. Miller" 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, Apr 5, 2017 at 5:11 AM, Tobias Regnery wrote: > Commit 9008ae074885 ("net/mlx5e: Minimize mlx5e_{open/close}_locked") > copied the calls to netif_set_real_num_{tx,rx}_queues from > mlx5e_open_locked to mlx5e_activate_priv_channels and wraps them in an > if condition to test for netdev->real_num_{tx,rx}_queues. > > But netdev->real_num_rx_queues is conditionally compiled in if CONFIG_SYSFS > is set. Without CONFIG_SYSFS the build fails: > > drivers/net/ethernet/mellanox/mlx5/core/en_main.c: In function 'mlx5e_activate_priv_channels': > drivers/net/ethernet/mellanox/mlx5/core/en_main.c:2515:12: error: 'struct net_device' has no member named 'real_num_rx_queues'; did you mean 'real_num_tx_queues'? > > Fix this by unconditionally call netif_set_real_num{tx,rx}_queues like before > commit 9008ae074885. > > Fixes: 9008ae074885 ("net/mlx5e: Minimize mlx5e_{open/close}_locked") > Signed-off-by: Tobias Regnery > --- > drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c > index ec389b1b51cb..d5248637d44f 100644 > --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c > @@ -2510,10 +2510,8 @@ static void mlx5e_activate_priv_channels(struct mlx5e_priv *priv) > struct net_device *netdev = priv->netdev; > > mlx5e_netdev_set_tcs(netdev); > - if (netdev->real_num_tx_queues != num_txqs) > - netif_set_real_num_tx_queues(netdev, num_txqs); > - if (netdev->real_num_rx_queues != priv->channels.num) > - netif_set_real_num_rx_queues(netdev, priv->channels.num); > + netif_set_real_num_tx_queues(netdev, num_txqs); > + netif_set_real_num_rx_queues(netdev, priv->channels.num); > Acked-by: Saeed Mahameed Thanks Tobias for the fix, although it is redundant for most of the reconfiguration options of mlx5 to call set_real_num_{rx,tx} queues every time, but it is not that big of a deal, so it is ok with me to align the code with the previous behavior we had before ("net/mlx5e: Minimize mlx5e_{open/close}_locked").