aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSathya Perla <sathya.perla@emulex.com>2014-04-01 03:03:59 -0400
committerDavid S. Miller <davem@davemloft.net>2014-04-01 16:25:51 -0400
commitc5abe7c0a44ac2e8147543203de48b4aa0d4eaec (patch)
treeaa102e2bd4028b81605ca399a5972a0e71e56452
parente462ded699aa2cca04b68fbf203ea4675d4c44d4 (diff)
be2net: fix build dependency on VxLAN
Introduce a CONFIG_BE2NET_VXLAN define to control be2net's build dependency on the VXLAN driver. Without this fix, the kernel build fails when VxLAN driver is selected to be built as a module while be2net is built-in. fixes: c9c47142 ("be2net: csum, tso and rss steering offload support for VxLAN") Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/emulex/benet/Kconfig8
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c12
2 files changed, 19 insertions, 1 deletions
diff --git a/drivers/net/ethernet/emulex/benet/Kconfig b/drivers/net/ethernet/emulex/benet/Kconfig
index 231129dd1764..ea94a8eb6b35 100644
--- a/drivers/net/ethernet/emulex/benet/Kconfig
+++ b/drivers/net/ethernet/emulex/benet/Kconfig
@@ -4,3 +4,11 @@ config BE2NET
4 ---help--- 4 ---help---
5 This driver implements the NIC functionality for ServerEngines' 5 This driver implements the NIC functionality for ServerEngines'
6 10Gbps network adapter - BladeEngine. 6 10Gbps network adapter - BladeEngine.
7
8config BE2NET_VXLAN
9 bool "VXLAN offload support on be2net driver"
10 default y
11 depends on BE2NET && VXLAN && !(BE2NET=y && VXLAN=m)
12 ---help---
13 Say Y here if you want to enable VXLAN offload support on
14 be2net driver.
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index c89dc85ad8d6..3e6df47b6973 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -2862,8 +2862,11 @@ static int be_open(struct net_device *netdev)
2862 netif_tx_start_all_queues(netdev); 2862 netif_tx_start_all_queues(netdev);
2863 be_roce_dev_open(adapter); 2863 be_roce_dev_open(adapter);
2864 2864
2865#ifdef CONFIG_BE2NET_VXLAN
2865 if (skyhawk_chip(adapter)) 2866 if (skyhawk_chip(adapter))
2866 vxlan_get_rx_port(netdev); 2867 vxlan_get_rx_port(netdev);
2868#endif
2869
2867 return 0; 2870 return 0;
2868err: 2871err:
2869 be_close(adapter->netdev); 2872 be_close(adapter->netdev);
@@ -3019,6 +3022,7 @@ static void be_mac_clear(struct be_adapter *adapter)
3019 } 3022 }
3020} 3023}
3021 3024
3025#ifdef CONFIG_BE2NET_VXLAN
3022static void be_disable_vxlan_offloads(struct be_adapter *adapter) 3026static void be_disable_vxlan_offloads(struct be_adapter *adapter)
3023{ 3027{
3024 if (adapter->flags & BE_FLAGS_VXLAN_OFFLOADS) 3028 if (adapter->flags & BE_FLAGS_VXLAN_OFFLOADS)
@@ -3031,6 +3035,7 @@ static void be_disable_vxlan_offloads(struct be_adapter *adapter)
3031 adapter->flags &= ~BE_FLAGS_VXLAN_OFFLOADS; 3035 adapter->flags &= ~BE_FLAGS_VXLAN_OFFLOADS;
3032 adapter->vxlan_port = 0; 3036 adapter->vxlan_port = 0;
3033} 3037}
3038#endif
3034 3039
3035static int be_clear(struct be_adapter *adapter) 3040static int be_clear(struct be_adapter *adapter)
3036{ 3041{
@@ -3039,8 +3044,9 @@ static int be_clear(struct be_adapter *adapter)
3039 if (sriov_enabled(adapter)) 3044 if (sriov_enabled(adapter))
3040 be_vf_clear(adapter); 3045 be_vf_clear(adapter);
3041 3046
3047#ifdef CONFIG_BE2NET_VXLAN
3042 be_disable_vxlan_offloads(adapter); 3048 be_disable_vxlan_offloads(adapter);
3043 3049#endif
3044 /* delete the primary mac along with the uc-mac list */ 3050 /* delete the primary mac along with the uc-mac list */
3045 be_mac_clear(adapter); 3051 be_mac_clear(adapter);
3046 3052
@@ -4165,6 +4171,7 @@ static int be_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
4165 BRIDGE_MODE_VEPA : BRIDGE_MODE_VEB); 4171 BRIDGE_MODE_VEPA : BRIDGE_MODE_VEB);
4166} 4172}
4167 4173
4174#ifdef CONFIG_BE2NET_VXLAN
4168static void be_add_vxlan_port(struct net_device *netdev, sa_family_t sa_family, 4175static void be_add_vxlan_port(struct net_device *netdev, sa_family_t sa_family,
4169 __be16 port) 4176 __be16 port)
4170{ 4177{
@@ -4223,6 +4230,7 @@ static void be_del_vxlan_port(struct net_device *netdev, sa_family_t sa_family,
4223 "Disabled VxLAN offloads for UDP port %d\n", 4230 "Disabled VxLAN offloads for UDP port %d\n",
4224 be16_to_cpu(port)); 4231 be16_to_cpu(port));
4225} 4232}
4233#endif
4226 4234
4227static const struct net_device_ops be_netdev_ops = { 4235static const struct net_device_ops be_netdev_ops = {
4228 .ndo_open = be_open, 4236 .ndo_open = be_open,
@@ -4248,8 +4256,10 @@ static const struct net_device_ops be_netdev_ops = {
4248#ifdef CONFIG_NET_RX_BUSY_POLL 4256#ifdef CONFIG_NET_RX_BUSY_POLL
4249 .ndo_busy_poll = be_busy_poll, 4257 .ndo_busy_poll = be_busy_poll,
4250#endif 4258#endif
4259#ifdef CONFIG_BE2NET_VXLAN
4251 .ndo_add_vxlan_port = be_add_vxlan_port, 4260 .ndo_add_vxlan_port = be_add_vxlan_port,
4252 .ndo_del_vxlan_port = be_del_vxlan_port, 4261 .ndo_del_vxlan_port = be_del_vxlan_port,
4262#endif
4253}; 4263};
4254 4264
4255static void be_netdev_init(struct net_device *netdev) 4265static void be_netdev_init(struct net_device *netdev)