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


Groups > linux.kernel > #1340509 > unrolled thread

[PATCH] bnx2x: add a separate GENEVE Kconfig symbol

Started byArnd Bergmann <arnd@arndb.de>
First post2016-02-23 11:40 +0100
Last post2016-02-25 04:50 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] bnx2x: add a separate GENEVE Kconfig symbol Arnd Bergmann <arnd@arndb.de> - 2016-02-23 11:40 +0100
    Re: [PATCH] bnx2x: add a separate GENEVE Kconfig symbol Yuval Mintz <Yuval.Mintz@qlogic.com> - 2016-02-23 20:10 +0100
      Re: [PATCH] bnx2x: add a separate GENEVE Kconfig symbol David Miller <davem@davemloft.net> - 2016-02-25 04:50 +0100

#1340509 — [PATCH] bnx2x: add a separate GENEVE Kconfig symbol

FromArnd Bergmann <arnd@arndb.de>
Date2016-02-23 11:40 +0100
Subject[PATCH] bnx2x: add a separate GENEVE Kconfig symbol
Message-ID<r5ixQ-3Z2-21@gated-at.bofh.it>
When CONFIG_GENEVE is built as a loadable module, and bnx2x is built-in,
we get this link error:

drivers/net/built-in.o: In function `bnx2x_open':
:(.text+0x33322): undefined reference to `geneve_get_rx_port'
drivers/net/built-in.o: In function `bnx2x_sp_rtnl_task':
:(.text+0x3e632): undefined reference to `geneve_get_rx_port'

This avoids the problem by adding a separate Kconfig symbol named
CONFIG_BNX2X_GENEVE that is only enabled when the code is
reachable from the driver.

This is the same trick that BNX2X does for VXLAN support, and
is similar to how I40E handles both.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 883ce97d25b0 ("bnx2x: Add Geneve inner-RSS support")
---
 drivers/net/ethernet/broadcom/Kconfig            | 10 ++++++++++
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 14 +++++++-------
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/Kconfig b/drivers/net/ethernet/broadcom/Kconfig
index 19f7cd02e085..18042c2460bd 100644
--- a/drivers/net/ethernet/broadcom/Kconfig
+++ b/drivers/net/ethernet/broadcom/Kconfig
@@ -149,6 +149,16 @@ config BNX2X_VXLAN
 	  Say Y here if you want to enable hardware offload support for
 	  Virtual eXtensible Local Area Network (VXLAN) in the driver.
 
+config BNX2X_GENEVE
+	bool "Generic Network Virtualization Encapsulation (GENEVE) support"
+	depends on BNX2X && GENEVE && !(BNX2X=y && GENEVE=m)
+	---help---
+          This allows one to create GENEVE virtual interfaces that provide
+          Layer 2 Networks over Layer 3 Networks. GENEVE is often used
+          to tunnel virtual network infrastructure in virtualized environments.
+	  Say Y here if you want to enable hardware offload support for
+	  Generic Network Virtualization Encapsulation (GENEVE) in the driver.
+
 config BGMAC
 	tristate "BCMA bus GBit core support"
 	depends on BCMA && BCMA_HOST_SOC
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 81fc51c4ec2b..5c95d0c3b076 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -59,7 +59,7 @@
 #include <linux/semaphore.h>
 #include <linux/stringify.h>
 #include <linux/vmalloc.h>
-#if IS_ENABLED(CONFIG_GENEVE)
+#if IS_ENABLED(CONFIG_BNX2X_GENEVE)
 #include <net/geneve.h>
 #endif
 #include "bnx2x.h"
@@ -10078,7 +10078,7 @@ static void bnx2x_parity_recover(struct bnx2x *bp)
 	}
 }
 
-#if defined(CONFIG_BNX2X_VXLAN) || IS_ENABLED(CONFIG_GENEVE)
+#if defined(CONFIG_BNX2X_VXLAN) || IS_ENABLED(CONFIG_BNX2X_GENEVE)
 static int bnx2x_udp_port_update(struct bnx2x *bp)
 {
 	struct bnx2x_func_switch_update_params *switch_update_params;
@@ -10201,7 +10201,7 @@ static void bnx2x_del_vxlan_port(struct net_device *netdev,
 }
 #endif
 
-#if IS_ENABLED(CONFIG_GENEVE)
+#if IS_ENABLED(CONFIG_BNX2X_GENEVE)
 static void bnx2x_add_geneve_port(struct net_device *netdev,
 				  sa_family_t sa_family, __be16 port)
 {
@@ -10327,7 +10327,7 @@ sp_rtnl_not_reset:
 			       &bp->sp_rtnl_state))
 		bnx2x_update_mng_version(bp);
 
-#if defined(CONFIG_BNX2X_VXLAN) || IS_ENABLED(CONFIG_GENEVE)
+#if defined(CONFIG_BNX2X_VXLAN) || IS_ENABLED(CONFIG_BNX2X_GENEVE)
 	if (test_and_clear_bit(BNX2X_SP_RTNL_CHANGE_UDP_PORT,
 			       &bp->sp_rtnl_state)) {
 		if (bnx2x_udp_port_update(bp)) {
@@ -10344,7 +10344,7 @@ sp_rtnl_not_reset:
 			if (!bp->udp_tunnel_ports[BNX2X_UDP_PORT_VXLAN].count)
 				vxlan_get_rx_port(bp->dev);
 #endif
-#if IS_ENABLED(CONFIG_GENEVE)
+#if IS_ENABLED(CONFIG_BNX2X_GENEVE)
 			if (!bp->udp_tunnel_ports[BNX2X_UDP_PORT_GENEVE].count)
 				geneve_get_rx_port(bp->dev);
 #endif
@@ -12557,7 +12557,7 @@ static int bnx2x_open(struct net_device *dev)
 	if (IS_PF(bp))
 		vxlan_get_rx_port(dev);
 #endif
-#if IS_ENABLED(CONFIG_GENEVE)
+#if IS_ENABLED(CONFIG_BNX2X_GENEVE)
 	if (IS_PF(bp))
 		geneve_get_rx_port(dev);
 #endif
@@ -13078,7 +13078,7 @@ static const struct net_device_ops bnx2x_netdev_ops = {
 	.ndo_add_vxlan_port	= bnx2x_add_vxlan_port,
 	.ndo_del_vxlan_port	= bnx2x_del_vxlan_port,
 #endif
-#if IS_ENABLED(CONFIG_GENEVE)
+#if IS_ENABLED(CONFIG_BNX2X_GENEVE)
 	.ndo_add_geneve_port	= bnx2x_add_geneve_port,
 	.ndo_del_geneve_port	= bnx2x_del_geneve_port,
 #endif
-- 
2.7.0

[toc] | [next] | [standalone]


#1340959

FromYuval Mintz <Yuval.Mintz@qlogic.com>
Date2016-02-23 20:10 +0100
Message-ID<r5qvo-1gK-33@gated-at.bofh.it>
In reply to#1340509
> When CONFIG_GENEVE is built as a loadable module, and bnx2x is built-in,
> we get this link error:

> drivers/net/built-in.o: In function `bnx2x_open':
> :(.text+0x33322): undefined reference to `geneve_get_rx_port'
> drivers/net/built-in.o: In function `bnx2x_sp_rtnl_task':
> :(.text+0x3e632): undefined reference to `geneve_get_rx_port'

> This avoids the problem by adding a separate Kconfig symbol named
> CONFIG_BNX2X_GENEVE that is only enabled when the code is
> reachable from the driver.

> This is the same trick that BNX2X does for VXLAN support, and
> is similar to how I40E handles both.

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 883ce97d25b0 ("bnx2x: Add Geneve inner-RSS support")

Ouch. Thanks for fixing this one; I tried avoiding this solution
since I don't think there's any reason to encumber the config
file with needless options [I.e., what's the gain in the ability to
disable a single offloaded protocol on a single network driver?],
but obviously, I botched the job.

BTW, if you want to handle this exactly like vxlan, you might
consider using `defined(CONFIG_BNX2X_GENEVE)' instead of
`IS_ENABLED(CONFIG_BNX2X_GENEVE)'  [It not a tristate].
But that's truly insignificant.

Acked-By: Yuval Mintz <Yuval.Mintz@qlogic.com>

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


#1342781

FromDavid Miller <davem@davemloft.net>
Date2016-02-25 04:50 +0100
Message-ID<r5V6a-6mZ-3@gated-at.bofh.it>
In reply to#1340959
From: Yuval Mintz <Yuval.Mintz@qlogic.com>
Date: Tue, 23 Feb 2016 18:33:10 +0000

>> When CONFIG_GENEVE is built as a loadable module, and bnx2x is built-in,
>> we get this link error:
> 
>> drivers/net/built-in.o: In function `bnx2x_open':
>> :(.text+0x33322): undefined reference to `geneve_get_rx_port'
>> drivers/net/built-in.o: In function `bnx2x_sp_rtnl_task':
>> :(.text+0x3e632): undefined reference to `geneve_get_rx_port'
> 
>> This avoids the problem by adding a separate Kconfig symbol named
>> CONFIG_BNX2X_GENEVE that is only enabled when the code is
>> reachable from the driver.
> 
>> This is the same trick that BNX2X does for VXLAN support, and
>> is similar to how I40E handles both.
> 
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> Fixes: 883ce97d25b0 ("bnx2x: Add Geneve inner-RSS support")
> 
> Ouch. Thanks for fixing this one; I tried avoiding this solution
> since I don't think there's any reason to encumber the config
> file with needless options [I.e., what's the gain in the ability to
> disable a single offloaded protocol on a single network driver?],
> but obviously, I botched the job.
> 
> BTW, if you want to handle this exactly like vxlan, you might
> consider using `defined(CONFIG_BNX2X_GENEVE)' instead of
> `IS_ENABLED(CONFIG_BNX2X_GENEVE)'  [It not a tristate].
> But that's truly insignificant.
> 
> Acked-By: Yuval Mintz <Yuval.Mintz@qlogic.com>

Applied, thanks everyone.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web