aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorShahed Shaikh <shahed.shaikh@qlogic.com>2014-04-01 16:29:32 -0400
committerDavid S. Miller <davem@davemloft.net>2014-04-01 17:38:05 -0400
commit7f1f6056f2f7293d5108eda905af42df58b78370 (patch)
treed068839ba32e1f17839f02d0c688761d1d097f17 /drivers/net
parent408eccce32044ee3285a7f6a812723ba3540c3e7 (diff)
qlcnic: Fix build failure due to undefined reference to `vxlan_get_rx_port'
Commit 2b3d7b758c687("qlcnic: Add VXLAN Rx offload support") uses vxlan_get_rx_port() which caused build failure when VXLAN=m. This patch fixes the build failure by adding dependency on VXLAN in Kconfig of qlcnic module and use vxlan_get_rx_port() and support code accordingly. Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/qlogic/Kconfig10
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic.h3
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c8
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c8
4 files changed, 26 insertions, 3 deletions
diff --git a/drivers/net/ethernet/qlogic/Kconfig b/drivers/net/ethernet/qlogic/Kconfig
index f59e6be4a66e..c14bd3116e45 100644
--- a/drivers/net/ethernet/qlogic/Kconfig
+++ b/drivers/net/ethernet/qlogic/Kconfig
@@ -56,6 +56,16 @@ config QLCNIC_DCB
56 mode of DCB is supported. PG and PFC values are related only 56 mode of DCB is supported. PG and PFC values are related only
57 to Tx. 57 to Tx.
58 58
59config QLCNIC_VXLAN
60 bool "Virtual eXtensible Local Area Network (VXLAN) offload support"
61 default n
62 depends on QLCNIC && VXLAN && !(QLCNIC=y && VXLAN=m)
63 ---help---
64 This enables hardware offload support for VXLAN protocol over QLogic's
65 84XX series adapters.
66 Say Y here if you want to enable hardware offload support for
67 Virtual eXtensible Local Area Network (VXLAN) in the driver.
68
59config QLGE 69config QLGE
60 tristate "QLogic QLGE 10Gb Ethernet Driver Support" 70 tristate "QLogic QLGE 10Gb Ethernet Driver Support"
61 depends on PCI 71 depends on PCI
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index b9039b569beb..f31bb5e9d8a9 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -1011,8 +1011,11 @@ struct qlcnic_ipaddr {
1011#define QLCNIC_APP_CHANGED_FLAGS 0x20000 1011#define QLCNIC_APP_CHANGED_FLAGS 0x20000
1012#define QLCNIC_HAS_PHYS_PORT_ID 0x40000 1012#define QLCNIC_HAS_PHYS_PORT_ID 0x40000
1013#define QLCNIC_TSS_RSS 0x80000 1013#define QLCNIC_TSS_RSS 0x80000
1014
1015#ifdef CONFIG_QLCNIC_VXLAN
1014#define QLCNIC_ADD_VXLAN_PORT 0x100000 1016#define QLCNIC_ADD_VXLAN_PORT 0x100000
1015#define QLCNIC_DEL_VXLAN_PORT 0x200000 1017#define QLCNIC_DEL_VXLAN_PORT 0x200000
1018#endif
1016 1019
1017#define QLCNIC_IS_MSI_FAMILY(adapter) \ 1020#define QLCNIC_IS_MSI_FAMILY(adapter) \
1018 ((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED)) 1021 ((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED))
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
index 2d91975d21f7..b48737dcd3c5 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
@@ -1020,6 +1020,7 @@ static int qlcnic_83xx_idc_check_state_validity(struct qlcnic_adapter *adapter,
1020 return 0; 1020 return 0;
1021} 1021}
1022 1022
1023#ifdef CONFIG_QLCNIC_VXLAN
1023#define QLC_83XX_ENCAP_TYPE_VXLAN BIT_1 1024#define QLC_83XX_ENCAP_TYPE_VXLAN BIT_1
1024#define QLC_83XX_MATCH_ENCAP_ID BIT_2 1025#define QLC_83XX_MATCH_ENCAP_ID BIT_2
1025#define QLC_83XX_SET_VXLAN_UDP_DPORT BIT_3 1026#define QLC_83XX_SET_VXLAN_UDP_DPORT BIT_3
@@ -1088,14 +1089,14 @@ static int qlcnic_set_vxlan_parsing(struct qlcnic_adapter *adapter,
1088 1089
1089 return ret; 1090 return ret;
1090} 1091}
1092#endif
1091 1093
1092static void qlcnic_83xx_periodic_tasks(struct qlcnic_adapter *adapter) 1094static void qlcnic_83xx_periodic_tasks(struct qlcnic_adapter *adapter)
1093{ 1095{
1094 struct qlcnic_hardware_context *ahw = adapter->ahw;
1095
1096 if (adapter->fhash.fnum) 1096 if (adapter->fhash.fnum)
1097 qlcnic_prune_lb_filters(adapter); 1097 qlcnic_prune_lb_filters(adapter);
1098 1098
1099#ifdef CONFIG_QLCNIC_VXLAN
1099 if (adapter->flags & QLCNIC_ADD_VXLAN_PORT) { 1100 if (adapter->flags & QLCNIC_ADD_VXLAN_PORT) {
1100 if (qlcnic_set_vxlan_port(adapter)) 1101 if (qlcnic_set_vxlan_port(adapter))
1101 return; 1102 return;
@@ -1108,9 +1109,10 @@ static void qlcnic_83xx_periodic_tasks(struct qlcnic_adapter *adapter)
1108 if (qlcnic_set_vxlan_parsing(adapter, false)) 1109 if (qlcnic_set_vxlan_parsing(adapter, false))
1109 return; 1110 return;
1110 1111
1111 ahw->vxlan_port = 0; 1112 adapter->ahw->vxlan_port = 0;
1112 adapter->flags &= ~QLCNIC_DEL_VXLAN_PORT; 1113 adapter->flags &= ~QLCNIC_DEL_VXLAN_PORT;
1113 } 1114 }
1115#endif
1114} 1116}
1115 1117
1116/** 1118/**
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 79be451a3ffc..309d05640883 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -21,7 +21,9 @@
21#include <linux/aer.h> 21#include <linux/aer.h>
22#include <linux/log2.h> 22#include <linux/log2.h>
23#include <linux/pci.h> 23#include <linux/pci.h>
24#ifdef CONFIG_QLCNIC_VXLAN
24#include <net/vxlan.h> 25#include <net/vxlan.h>
26#endif
25 27
26MODULE_DESCRIPTION("QLogic 1/10 GbE Converged/Intelligent Ethernet Driver"); 28MODULE_DESCRIPTION("QLogic 1/10 GbE Converged/Intelligent Ethernet Driver");
27MODULE_LICENSE("GPL"); 29MODULE_LICENSE("GPL");
@@ -462,6 +464,7 @@ static int qlcnic_get_phys_port_id(struct net_device *netdev,
462 return 0; 464 return 0;
463} 465}
464 466
467#ifdef CONFIG_QLCNIC_VXLAN
465static void qlcnic_add_vxlan_port(struct net_device *netdev, 468static void qlcnic_add_vxlan_port(struct net_device *netdev,
466 sa_family_t sa_family, __be16 port) 469 sa_family_t sa_family, __be16 port)
467{ 470{
@@ -490,6 +493,7 @@ static void qlcnic_del_vxlan_port(struct net_device *netdev,
490 493
491 adapter->flags |= QLCNIC_DEL_VXLAN_PORT; 494 adapter->flags |= QLCNIC_DEL_VXLAN_PORT;
492} 495}
496#endif
493 497
494static const struct net_device_ops qlcnic_netdev_ops = { 498static const struct net_device_ops qlcnic_netdev_ops = {
495 .ndo_open = qlcnic_open, 499 .ndo_open = qlcnic_open,
@@ -509,8 +513,10 @@ static const struct net_device_ops qlcnic_netdev_ops = {
509 .ndo_fdb_del = qlcnic_fdb_del, 513 .ndo_fdb_del = qlcnic_fdb_del,
510 .ndo_fdb_dump = qlcnic_fdb_dump, 514 .ndo_fdb_dump = qlcnic_fdb_dump,
511 .ndo_get_phys_port_id = qlcnic_get_phys_port_id, 515 .ndo_get_phys_port_id = qlcnic_get_phys_port_id,
516#ifdef CONFIG_QLCNIC_VXLAN
512 .ndo_add_vxlan_port = qlcnic_add_vxlan_port, 517 .ndo_add_vxlan_port = qlcnic_add_vxlan_port,
513 .ndo_del_vxlan_port = qlcnic_del_vxlan_port, 518 .ndo_del_vxlan_port = qlcnic_del_vxlan_port,
519#endif
514#ifdef CONFIG_NET_POLL_CONTROLLER 520#ifdef CONFIG_NET_POLL_CONTROLLER
515 .ndo_poll_controller = qlcnic_poll_controller, 521 .ndo_poll_controller = qlcnic_poll_controller,
516#endif 522#endif
@@ -1975,8 +1981,10 @@ qlcnic_attach(struct qlcnic_adapter *adapter)
1975 1981
1976 qlcnic_create_sysfs_entries(adapter); 1982 qlcnic_create_sysfs_entries(adapter);
1977 1983
1984#ifdef CONFIG_QLCNIC_VXLAN
1978 if (qlcnic_encap_rx_offload(adapter)) 1985 if (qlcnic_encap_rx_offload(adapter))
1979 vxlan_get_rx_port(netdev); 1986 vxlan_get_rx_port(netdev);
1987#endif
1980 1988
1981 adapter->is_up = QLCNIC_ADAPTER_UP_MAGIC; 1989 adapter->is_up = QLCNIC_ADAPTER_UP_MAGIC;
1982 return 0; 1990 return 0;