Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1616746 > unrolled thread

[PATCH net-next] net/mlx5e: fix build error without CONFIG_SYSFS

Started byTobias Regnery <tobias.regnery@gmail.com>
First post2017-04-05 11:20 +0200
Last post2017-04-06 22:00 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH net-next] net/mlx5e: fix build error without CONFIG_SYSFS Tobias Regnery <tobias.regnery@gmail.com> - 2017-04-05 11:20 +0200
    Re: [PATCH net-next] net/mlx5e: fix build error without CONFIG_SYSFS Saeed Mahameed <saeedm@dev.mellanox.co.il> - 2017-04-05 17:00 +0200
    Re: [PATCH net-next] net/mlx5e: fix build error without  CONFIG_SYSFS David Miller <davem@davemloft.net> - 2017-04-06 22:00 +0200

#1616746 — [PATCH net-next] net/mlx5e: fix build error without CONFIG_SYSFS

FromTobias Regnery <tobias.regnery@gmail.com>
Date2017-04-05 11:20 +0200
Subject[PATCH net-next] net/mlx5e: fix build error without CONFIG_SYSFS
Message-ID<tsPgB-IY-1@gated-at.bofh.it>
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 <tobias.regnery@gmail.com>
---
 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);
 
 	mlx5e_build_channels_tx_maps(priv);
 	mlx5e_activate_channels(&priv->channels);
-- 
2.11.0

[toc] | [next] | [standalone]


#1617023

FromSaeed Mahameed <saeedm@dev.mellanox.co.il>
Date2017-04-05 17:00 +0200
Message-ID<tsUzD-3Vt-5@gated-at.bofh.it>
In reply to#1616746
On Wed, Apr 5, 2017 at 5:11 AM, Tobias Regnery <tobias.regnery@gmail.com> 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 <tobias.regnery@gmail.com>
> ---
>  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 <saeedm@mellanox.com>

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").

[toc] | [prev] | [next] | [standalone]


#1618316 — Re: [PATCH net-next] net/mlx5e: fix build error without CONFIG_SYSFS

FromDavid Miller <davem@davemloft.net>
Date2017-04-06 22:00 +0200
SubjectRe: [PATCH net-next] net/mlx5e: fix build error without CONFIG_SYSFS
Message-ID<ttlJv-5fr-9@gated-at.bofh.it>
In reply to#1616746
From: Tobias Regnery <tobias.regnery@gmail.com>
Date: Wed,  5 Apr 2017 11:11:10 +0200

> 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 <tobias.regnery@gmail.com>

Applied, thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web