diff mbox

[3/3] net/mlx5e: don't build RFS without ethernet

Message ID 1462365155-3861405-1-git-send-email-arnd@arndb.de (mailing list archive)
State Not Applicable
Headers show

Commit Message

Arnd Bergmann May 4, 2016, 12:32 p.m. UTC
The RFS acceleration support in mlx5 is enabled whenever CONFIG_RFS_ACCEL
is in use. However, this fails if a user turns off CONFIG_MLX5_CORE_EN,
because the rfs code now calls into the ethernet portion of the
driver:

ERROR: "mlx5e_destroy_flow_table" [drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko] undefined!

This patch adds another Kconfig symbol to control the compilation of
the RFS code, to ensure it is only built if both the ethernet support
and the core RFS support are enabled.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/ethernet/mellanox/mlx5/core/Kconfig  | 4 ++++
 drivers/net/ethernet/mellanox/mlx5/core/Makefile | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Saeed Mahameed May 4, 2016, 1:09 p.m. UTC | #1
On Wed, May 4, 2016 at 3:32 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> The RFS acceleration support in mlx5 is enabled whenever CONFIG_RFS_ACCEL
> is in use. However, this fails if a user turns off CONFIG_MLX5_CORE_EN,
> because the rfs code now calls into the ethernet portion of the
> driver:
>
> ERROR: "mlx5e_destroy_flow_table" [drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko] undefined!
>

Hi Arnd,

We already posted a fix for this, please see "[PATCH net-next V1
01/12] net/mlx5e: Fix aRFS compilation dependency", and give us your
feedback.

Saeed.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arnd Bergmann May 4, 2016, 2:23 p.m. UTC | #2
On Wednesday 04 May 2016 16:09:16 Saeed Mahameed wrote:
> On Wed, May 4, 2016 at 3:32 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > The RFS acceleration support in mlx5 is enabled whenever CONFIG_RFS_ACCEL
> > is in use. However, this fails if a user turns off CONFIG_MLX5_CORE_EN,
> > because the rfs code now calls into the ethernet portion of the
> > driver:
> >
> > ERROR: "mlx5e_destroy_flow_table" [drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko] undefined!
> >
> 
> Hi Arnd,
> 
> We already posted a fix for this, please see "[PATCH net-next V1
> 01/12] net/mlx5e: Fix aRFS compilation dependency", and give us your
> feedback.

That version looks fine as well. I think it's better to be a little
more explicit as I was, but either way seems fine.

You can also achieve the same thing in yet another way using Makefile
syntax instead of cpp or Kconfig:

ifdef CONFIG_MLX5_CORE_EN
mlx5_core-y += wq.o eswitch.o \
               en_main.o en_fs.o en_ethtool.o en_tx.o en_rx.o \
               en_txrx.o en_clock.o vxlan.o en_tc.o
               en_txrx.o en_clock.o vxlan.o en_tc.o en_arfs.o

mlx5_core-$(CONFIG_RFS_ACCEL) += en_arfs.o
endif

If you prefer Maor's version, feel free to add

Acked-by: Arnd Bergmann <arnd@arndb.de>

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Saeed Mahameed May 4, 2016, 2:55 p.m. UTC | #3
On Wed, May 4, 2016 at 5:23 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Wednesday 04 May 2016 16:09:16 Saeed Mahameed wrote:
>> On Wed, May 4, 2016 at 3:32 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>> > The RFS acceleration support in mlx5 is enabled whenever CONFIG_RFS_ACCEL
>> > is in use. However, this fails if a user turns off CONFIG_MLX5_CORE_EN,
>> > because the rfs code now calls into the ethernet portion of the
>> > driver:
>> >
>> > ERROR: "mlx5e_destroy_flow_table" [drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko] undefined!
>> >
>>
>> Hi Arnd,
>>
>> We already posted a fix for this, please see "[PATCH net-next V1
>> 01/12] net/mlx5e: Fix aRFS compilation dependency", and give us your
>> feedback.
>
> That version looks fine as well. I think it's better to be a little
> more explicit as I was, but either way seems fine.
>

Simply we didn't want to add new Kconfig flag.

>
> You can also achieve the same thing in yet another way using Makefile
> syntax instead of cpp or Kconfig:
>
> ifdef CONFIG_MLX5_CORE_EN
> mlx5_core-y += wq.o eswitch.o \
>                en_main.o en_fs.o en_ethtool.o en_tx.o en_rx.o \
>                en_txrx.o en_clock.o vxlan.o en_tc.o
>                en_txrx.o en_clock.o vxlan.o en_tc.o en_arfs.o
>
> mlx5_core-$(CONFIG_RFS_ACCEL) += en_arfs.o
> endif
>
>
> If you prefer Maor's version, feel free to add
>
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>

I do prefer this version, but the difference is small, so will keep Maor's.
Thanks Arnd for the Ack and the suggestion.

Saeed.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
index f5c3b9465d8d..5efba14a1453 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
+++ b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
@@ -38,3 +38,7 @@  config MLX5_CORE_EN_VXLAN
 	depends on MLX5_CORE_EN && VXLAN && !(MLX5_CORE=y && VXLAN=m)
 	---help---
 	  Say Y here if you want to use VXLAN offloads in the driver.
+
+config MLX5_CORE_EN_RFS
+	def_bool y
+	depends on MLX5_CORE_EN && RFS_ACCEL
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Makefile b/drivers/net/ethernet/mellanox/mlx5/core/Makefile
index 6b8da0b36acd..29118c1debb7 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/Makefile
+++ b/drivers/net/ethernet/mellanox/mlx5/core/Makefile
@@ -11,4 +11,4 @@  mlx5_core-$(CONFIG_MLX5_CORE_EN) += wq.o eswitch.o \
 mlx5_core-$(CONFIG_MLX5_CORE_EN_VXLAN) += vxlan.o
 
 mlx5_core-$(CONFIG_MLX5_CORE_EN_DCB) +=  en_dcbnl.o
-mlx5_core-$(CONFIG_RFS_ACCEL) +=  en_arfs.o
+mlx5_core-$(CONFIG_MLX5_CORE_EN_RFS) +=  en_arfs.o