]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bnxt: Update drivers to support unified UDP encapsulation offload functions
authorAlexander Duyck <aduyck@mirantis.com>
Tue, 13 Sep 2016 21:47:30 +0000 (17:47 -0400)
committerDhaval Giani <dhaval.giani@oracle.com>
Fri, 20 Jan 2017 17:56:02 +0000 (12:56 -0500)
Orabug: 24567991

This patch ends up doing several things.  First it updates the driver to
make use of the new unified UDP tunnel offload notifier functions.  In
addition I updated the code so that we can work around the bits that were
checking for if VXLAN was enabled since we are now using a notifier based
setup.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(backport of commit ad51b8e9f9f4f8172eb7a6219d3005861bfb9a57)

Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
drivers/net/ethernet/broadcom/Kconfig
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/kcompat.h

index f6e03c3940fde3f83174c7cc0200d09f9251221c..0c3eebbbce6076f44854031bdf34f1d32524e116 100644 (file)
@@ -174,7 +174,6 @@ config SYSTEMPORT
 config BNXT
        tristate "Broadcom NetXtreme-C/E support"
        depends on PCI
-       depends on VXLAN || VXLAN=n
        select FW_LOADER
        select LIBCRC32C
        ---help---
index bb94d6c92c00c43317f87e9bd40d19667abcabba..d7a8848c79db9015b6f72bd4a0edf44c38157d7e 100644 (file)
@@ -37,9 +37,7 @@
 #include <net/udp.h>
 #include <net/checksum.h>
 #include <net/ip6_checksum.h>
-#if defined(CONFIG_VXLAN) || defined(CONFIG_VXLAN_MODULE)
-#include <net/vxlan.h>
-#endif
+#include <net/udp_tunnel.h>
 #ifdef CONFIG_NET_RX_BUSY_POLL
 #include <net/busy_poll.h>
 #endif
@@ -58,6 +56,7 @@
 #include "bnxt.h"
 #include "bnxt_sriov.h"
 #include "bnxt_ethtool.h"
+#include "kcompat.h"
 
 #define BNXT_TX_TIMEOUT                (5 * HZ)
 
@@ -5275,9 +5274,7 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
        }
 
        if (irq_re_init) {
-#if defined(CONFIG_VXLAN) || defined(CONFIG_VXLAN_MODULE)
-               vxlan_get_rx_port(bp->dev);
-#endif
+               udp_tunnel_get_rx_info(bp->dev);
                if (!bnxt_hwrm_tunnel_dst_port_alloc(
                                bp, htons(0x17c1),
                                TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE))
@@ -6308,6 +6305,7 @@ static void bnxt_cfg_ntp_filters(struct bnxt *bp)
 
 #endif /* CONFIG_RFS_ACCEL */
 
+#ifdef HAVE_NDO_ADD_VXLAN
 static void bnxt_add_vxlan_port(struct net_device *dev, sa_family_t sa_family,
                                __be16 port)
 {
@@ -6350,6 +6348,25 @@ static void bnxt_del_vxlan_port(struct net_device *dev, sa_family_t sa_family,
                }
        }
 }
+#endif
+
+#ifdef OLD_VLAN
+static void bnxt_vlan_rx_register(struct net_device *dev,
+                                 struct vlan_group *vlgrp)
+{
+       struct bnxt *bp = netdev_priv(dev);
+
+       if (!netif_running(dev)) {
+               bp->vlgrp = vlgrp;
+               return;
+       }
+       bnxt_disable_napi(bp);
+       bnxt_disable_int_sync(bp);
+       bp->vlgrp = vlgrp;
+       bnxt_enable_napi(bp);
+       bnxt_enable_int(bp);
+}
+#endif
 
 static const struct net_device_ops bnxt_netdev_ops = {
        .ndo_open               = bnxt_open,
@@ -6379,8 +6396,10 @@ static const struct net_device_ops bnxt_netdev_ops = {
 #ifdef CONFIG_RFS_ACCEL
        .ndo_rx_flow_steer      = bnxt_rx_flow_steer,
 #endif
+#ifdef HAVE_NDO_ADD_VXLAN
        .ndo_add_vxlan_port     = bnxt_add_vxlan_port,
        .ndo_del_vxlan_port     = bnxt_del_vxlan_port,
+#endif
 #ifdef CONFIG_NET_RX_BUSY_POLL
        .ndo_busy_poll          = bnxt_busy_poll,
 #endif
index 7407a3d549a5ffbad0abe360a010cebfb315299a..c4a79f522f1187c67b1e63b5269078e9e2d498bb 100644 (file)
@@ -7,7 +7,10 @@
  * the Free Software Foundation.
  */
 
+#include <linux/rtnetlink.h>
+
 /* The forced speed, in units of 1Mb. All values 0 to INT_MAX are legal. */
+
 #define SPEED_10               10
 #define SPEED_100              100
 #define SPEED_1000             1000
 #define SPEED_100000           100000
 
 #define SPEED_UNKNOWN          -1
+
+#define NETDEV_UDP_TUNNEL_PUSH_INFO    0x001C
+
+static DEFINE_MUTEX(rtnl_mutex);
+
+static inline void udp_tunnel_get_rx_info(struct net_device *dev)
+{
+       ASSERT_RTNL();
+       call_netdevice_notifiers(NETDEV_UDP_TUNNEL_PUSH_INFO, dev);
+}