netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net/mlx4_core: Fix build failure introduced by the EQ pool changes
@ 2015-06-02  7:29 Or Gerlitz
  2015-06-04  2:36 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Or Gerlitz @ 2015-06-02  7:29 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, mpe, Amir Vadai, Or Gerlitz, Matan Barak

When CONFIG_RFS_ACCEL or SMP aren't set, we fail to build, fix it.

Also, avoid build warning as of unused function on that setup.

Fixes: c66fa19c405a ('net/mlx4: Add EQ pool')
Reported-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/eq.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c
index 1116882..aae13ad 100644
--- a/drivers/net/ethernet/mellanox/mlx4/eq.c
+++ b/drivers/net/ethernet/mellanox/mlx4/eq.c
@@ -221,6 +221,7 @@ static void mlx4_slave_event(struct mlx4_dev *dev, int slave,
 	slave_event(dev, slave, eqe);
 }
 
+#if defined(CONFIG_SMP)
 static void mlx4_set_eq_affinity_hint(struct mlx4_priv *priv, int vec)
 {
 	int hint_err;
@@ -234,6 +235,7 @@ static void mlx4_set_eq_affinity_hint(struct mlx4_priv *priv, int vec)
 	if (hint_err)
 		mlx4_warn(dev, "irq_set_affinity_hint failed, err %d\n", hint_err);
 }
+#endif
 
 int mlx4_gen_pkey_eqe(struct mlx4_dev *dev, int slave, u8 port)
 {
@@ -1207,8 +1209,8 @@ int mlx4_init_eq_table(struct mlx4_dev *dev)
 					     MLX4_NUM_ASYNC_EQE + MLX4_NUM_SPARE_EQE,
 					     0, &priv->eq_table.eq[MLX4_EQ_ASYNC]);
 		} else {
-#ifdef CONFIG_RFS_ACCEL
 			struct mlx4_eq	*eq = &priv->eq_table.eq[i];
+#ifdef CONFIG_RFS_ACCEL
 			int port = find_first_bit(eq->actv_ports.ports,
 						  dev->caps.num_ports) + 1;
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net/mlx4_core: Fix build failure introduced by the EQ pool changes
  2015-06-02  7:29 [PATCH net-next] net/mlx4_core: Fix build failure introduced by the EQ pool changes Or Gerlitz
@ 2015-06-04  2:36 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-06-04  2:36 UTC (permalink / raw)
  To: ogerlitz; +Cc: netdev, mpe, amirv, matanb

From: Or Gerlitz <ogerlitz@mellanox.com>
Date: Tue,  2 Jun 2015 10:29:48 +0300

> When CONFIG_RFS_ACCEL or SMP aren't set, we fail to build, fix it.
> 
> Also, avoid build warning as of unused function on that setup.
> 
> Fixes: c66fa19c405a ('net/mlx4: Add EQ pool')
> Reported-by: Michael Ellerman <mpe@ellerman.id.au>
> Signed-off-by: Matan Barak <matanb@mellanox.com>
> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>

Applied, but this is really silly.

The whole reason there are backup non-SMP inline versions of
irq_set_affinity_hint() is so that drivers don't have to crap
up their drivers with ifdef'ery like this.

Just make all of this code unconditional and ignore the error,
there isn't anything you can really do if the error happens
anyways and this allows you to just silently use the non-SMP
variant which unconditionally returns -EINVAL.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-04  2:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-02  7:29 [PATCH net-next] net/mlx4_core: Fix build failure introduced by the EQ pool changes Or Gerlitz
2015-06-04  2:36 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).