get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/542188/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 542188,
    "url": "http://patchwork.ozlabs.org/api/patches/542188/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1447136740-77107-2-git-send-email-anjali.singhai@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1447136740-77107-2-git-send-email-anjali.singhai@intel.com>",
    "list_archive_url": null,
    "date": "2015-11-10T06:25:36",
    "name": "[v3,2/6] net: Generalize udp based tunnel offload",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "6fd7475f8ccaf242e6d7053bc4aa30ad92549ccd",
    "submitter": {
        "id": 65487,
        "url": "http://patchwork.ozlabs.org/api/people/65487/?format=api",
        "name": "Singhai, Anjali",
        "email": "anjali.singhai@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1447136740-77107-2-git-send-email-anjali.singhai@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/542188/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/542188/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Received": [
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ozlabs.org (Postfix) with ESMTP id 580FF1402B0\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 10 Nov 2015 17:09:04 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 8AD7A86E15;\n\tTue, 10 Nov 2015 06:09:03 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id rc6KDhgb5rgG; Tue, 10 Nov 2015 06:08:59 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 213EA86E34;\n\tTue, 10 Nov 2015 06:08:59 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 5BAAF1C105D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 10 Nov 2015 06:08:56 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 56C0C26F8E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 10 Nov 2015 06:08:56 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id mvFkxQhMgoC2 for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 10 Nov 2015 06:08:53 +0000 (UTC)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby silver.osuosl.org (Postfix) with ESMTP id CC72B2728E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 10 Nov 2015 06:08:53 +0000 (UTC)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga101.jf.intel.com with ESMTP; 09 Nov 2015 22:08:53 -0800",
            "from asinghai-cp.jf.intel.com ([134.134.3.84])\n\tby orsmga002.jf.intel.com with ESMTP; 09 Nov 2015 22:08:54 -0800"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,269,1444719600\"; d=\"scan'208\";a=\"846712968\"",
        "From": "Anjali Singhai Jain <anjali.singhai@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Mon,  9 Nov 2015 22:25:36 -0800",
        "Message-Id": "<1447136740-77107-2-git-send-email-anjali.singhai@intel.com>",
        "X-Mailer": "git-send-email 1.8.1.4",
        "In-Reply-To": "<1447136740-77107-1-git-send-email-anjali.singhai@intel.com>",
        "References": "<1447136740-77107-1-git-send-email-anjali.singhai@intel.com>",
        "Subject": "[Intel-wired-lan] [PATCH v3 2/6] net: Generalize udp based tunnel\n\toffload",
        "X-BeenThere": "intel-wired-lan@lists.osuosl.org",
        "X-Mailman-Version": "2.1.18-1",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>",
        "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>",
        "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>"
    },
    "content": "Replace add/del ndo ops for vxlan_port with tunnel_port so that all UDP\nbased tunnels can use the same ndo op. Add a parameter to pass tunnel\ntype to the ndo_op.\n\nChange all drivers to use the generalized udp tunnel offload\n\nPatch was compile tested with x86_64_defconfig.\n\nSigned-off-by: Kiran Patil <kiran.patil@intel.com>\nSigned-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>\n---\n drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 15 ++++++---\n drivers/net/ethernet/broadcom/bnxt/bnxt.c        | 15 ++++++---\n drivers/net/ethernet/emulex/benet/be_main.c      | 15 ++++++---\n drivers/net/ethernet/intel/fm10k/fm10k_netdev.c  | 27 ++++++++++++----\n drivers/net/ethernet/intel/i40e/i40e_main.c      | 41 +++++++++++++++++-------\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c    | 17 +++++++---\n drivers/net/ethernet/mellanox/mlx4/en_netdev.c   | 21 ++++++++----\n drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 17 +++++++---\n drivers/net/vxlan.c                              | 20 ++++++------\n include/linux/netdevice.h                        | 39 ++++++++++++----------\n include/net/udp_tunnel.h                         |  5 +++\n 11 files changed, 161 insertions(+), 71 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c\nindex f1d62d5..3a863dc 100644\n--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c\n+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c\n@@ -47,6 +47,7 @@\n #include <net/ip.h>\n #include <net/ipv6.h>\n #include <net/tcp.h>\n+#include <net/udp_tunnel.h>\n #include <net/vxlan.h>\n #include <net/checksum.h>\n #include <net/ip6_checksum.h>\n@@ -10124,11 +10125,14 @@ static void __bnx2x_add_vxlan_port(struct bnx2x *bp, u16 port)\n }\n \n static void bnx2x_add_vxlan_port(struct net_device *netdev,\n-\t\t\t\t sa_family_t sa_family, __be16 port)\n+\t\t\t\t sa_family_t sa_family, __be16 port,\n+\t\t\t\t u32 type)\n {\n \tstruct bnx2x *bp = netdev_priv(netdev);\n \tu16 t_port = ntohs(port);\n \n+\tif (type != UDP_TUNNEL_VXLAN)\n+\t\treturn;\n \t__bnx2x_add_vxlan_port(bp, t_port);\n }\n \n@@ -10152,11 +10156,14 @@ static void __bnx2x_del_vxlan_port(struct bnx2x *bp, u16 port)\n }\n \n static void bnx2x_del_vxlan_port(struct net_device *netdev,\n-\t\t\t\t sa_family_t sa_family, __be16 port)\n+\t\t\t\t sa_family_t sa_family, __be16 port,\n+\t\t\t\t u32 type)\n {\n \tstruct bnx2x *bp = netdev_priv(netdev);\n \tu16 t_port = ntohs(port);\n \n+\tif (type != UDP_TUNNEL_VXLAN)\n+\t\treturn;\n \t__bnx2x_del_vxlan_port(bp, t_port);\n }\n #endif\n@@ -13011,8 +13018,8 @@ static const struct net_device_ops bnx2x_netdev_ops = {\n \t.ndo_set_vf_link_state\t= bnx2x_set_vf_link_state,\n \t.ndo_features_check\t= bnx2x_features_check,\n #ifdef CONFIG_BNX2X_VXLAN\n-\t.ndo_add_vxlan_port\t= bnx2x_add_vxlan_port,\n-\t.ndo_del_vxlan_port\t= bnx2x_del_vxlan_port,\n+\t.ndo_add_udp_tunnel_port\t= bnx2x_add_vxlan_port,\n+\t.ndo_del_udp_tunnel_port\t= bnx2x_del_vxlan_port,\n #endif\n };\n \ndiff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c\nindex 6c2e0c6..af68428 100644\n--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c\n+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c\n@@ -39,6 +39,7 @@\n #include <net/ip6_checksum.h>\n #if defined(CONFIG_VXLAN) || defined(CONFIG_VXLAN_MODULE)\n #include <net/vxlan.h>\n+#include <net/udp_tunnel.h>\n #endif\n #ifdef CONFIG_NET_RX_BUSY_POLL\n #include <net/busy_poll.h>\n@@ -5409,7 +5410,7 @@ static void bnxt_cfg_ntp_filters(struct bnxt *bp)\n #endif /* CONFIG_RFS_ACCEL */\n \n static void bnxt_add_vxlan_port(struct net_device *dev, sa_family_t sa_family,\n-\t\t\t\t__be16 port)\n+\t\t\t\t__be16 port, u32 type)\n {\n \tstruct bnxt *bp = netdev_priv(dev);\n \n@@ -5419,6 +5420,9 @@ static void bnxt_add_vxlan_port(struct net_device *dev, sa_family_t sa_family,\n \tif (sa_family != AF_INET6 && sa_family != AF_INET)\n \t\treturn;\n \n+\tif (type != UDP_TUNNEL_VXLAN)\n+\t\treturn;\n+\n \tif (bp->vxlan_port_cnt && bp->vxlan_port != port)\n \t\treturn;\n \n@@ -5431,7 +5435,7 @@ static void bnxt_add_vxlan_port(struct net_device *dev, sa_family_t sa_family,\n }\n \n static void bnxt_del_vxlan_port(struct net_device *dev, sa_family_t sa_family,\n-\t\t\t\t__be16 port)\n+\t\t\t\t__be16 port, u32 type)\n {\n \tstruct bnxt *bp = netdev_priv(dev);\n \n@@ -5441,6 +5445,9 @@ static void bnxt_del_vxlan_port(struct net_device *dev, sa_family_t sa_family,\n \tif (sa_family != AF_INET6 && sa_family != AF_INET)\n \t\treturn;\n \n+\tif (type != UDP_TUNNEL_VXLAN)\n+\t\treturn;\n+\n \tif (bp->vxlan_port_cnt && bp->vxlan_port == port) {\n \t\tbp->vxlan_port_cnt--;\n \n@@ -5479,8 +5486,8 @@ static const struct net_device_ops bnxt_netdev_ops = {\n #ifdef CONFIG_RFS_ACCEL\n \t.ndo_rx_flow_steer\t= bnxt_rx_flow_steer,\n #endif\n-\t.ndo_add_vxlan_port\t= bnxt_add_vxlan_port,\n-\t.ndo_del_vxlan_port\t= bnxt_del_vxlan_port,\n+\t.ndo_add_udp_tunnel_port\t= bnxt_add_vxlan_port,\n+\t.ndo_del_udp_tunnel_port\t= bnxt_del_vxlan_port,\n #ifdef CONFIG_NET_RX_BUSY_POLL\n \t.ndo_busy_poll\t\t= bnxt_busy_poll,\n #endif\ndiff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c\nindex eb48a97..6af9f27 100644\n--- a/drivers/net/ethernet/emulex/benet/be_main.c\n+++ b/drivers/net/ethernet/emulex/benet/be_main.c\n@@ -23,6 +23,7 @@\n #include <linux/aer.h>\n #include <linux/if_bridge.h>\n #include <net/busy_poll.h>\n+#include <net/udp_tunnel.h>\n #include <net/vxlan.h>\n \n MODULE_VERSION(DRV_VER);\n@@ -5177,12 +5178,15 @@ static int be_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,\n  * until after all the tunnels are removed.\n  */\n static void be_add_vxlan_port(struct net_device *netdev, sa_family_t sa_family,\n-\t\t\t      __be16 port)\n+\t\t\t      __be16 port, u32 type)\n {\n \tstruct be_adapter *adapter = netdev_priv(netdev);\n \tstruct device *dev = &adapter->pdev->dev;\n \tint status;\n \n+\tif (type != UDP_TUNNEL_VXLAN)\n+\t\treturn;\n+\n \tif (lancer_chip(adapter) || BEx_chip(adapter) || be_is_mc(adapter))\n \t\treturn;\n \n@@ -5231,10 +5235,13 @@ err:\n }\n \n static void be_del_vxlan_port(struct net_device *netdev, sa_family_t sa_family,\n-\t\t\t      __be16 port)\n+\t\t\t      __be16 port, u32 type)\n {\n \tstruct be_adapter *adapter = netdev_priv(netdev);\n \n+\tif (type != UDP_TUNNEL_VXLAN)\n+\t\treturn;\n+\n \tif (lancer_chip(adapter) || BEx_chip(adapter) || be_is_mc(adapter))\n \t\treturn;\n \n@@ -5344,8 +5351,8 @@ static const struct net_device_ops be_netdev_ops = {\n \t.ndo_busy_poll\t\t= be_busy_poll,\n #endif\n #ifdef CONFIG_BE2NET_VXLAN\n-\t.ndo_add_vxlan_port\t= be_add_vxlan_port,\n-\t.ndo_del_vxlan_port\t= be_del_vxlan_port,\n+\t.ndo_add_udp_tunnel_port\t= be_add_vxlan_port,\n+\t.ndo_del_udp_tunnel_port\t= be_del_vxlan_port,\n \t.ndo_features_check\t= be_features_check,\n #endif\n \t.ndo_get_phys_port_id   = be_get_phys_port_id,\ndiff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c\nindex 722ac52..bf7af95 100644\n--- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c\n+++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c\n@@ -21,6 +21,7 @@\n #include \"fm10k.h\"\n #include <linux/vmalloc.h>\n #if IS_ENABLED(CONFIG_FM10K_VXLAN)\n+#include <net/udp_tunnel.h>\n #include <net/vxlan.h>\n #endif /* CONFIG_FM10K_VXLAN */\n \n@@ -439,18 +440,24 @@ static void fm10k_restore_vxlan_port(struct fm10k_intfc *interface)\n  * @netdev: network interface device structure\n  * @sa_family: Address family of new port\n  * @port: port number used for VXLAN\n+ * @type: Tunnel type\n  *\n- * This funciton is called when a new VXLAN interface has added a new port\n+ * This function is called when a new VXLAN interface has added a new port\n  * number to the range that is currently in use for VXLAN.  The new port\n  * number is always added to the tail so that the port number list should\n  * match the order in which the ports were allocated.  The head of the list\n  * is always used as the VXLAN port number for offloads.\n  **/\n static void fm10k_add_vxlan_port(struct net_device *dev,\n-\t\t\t\t sa_family_t sa_family, __be16 port) {\n+\t\t\t\t sa_family_t sa_family, __be16 port,\n+\t\t\t\t u32 type) {\n+#if IS_ENABLED(CONFIG_FM10K_VXLAN)\n \tstruct fm10k_intfc *interface = netdev_priv(dev);\n \tstruct fm10k_vxlan_port *vxlan_port;\n \n+\tif (type != UDP_TUNNEL_VXLAN)\n+\t\treturn;\n+\n \t/* only the PF supports configuring tunnels */\n \tif (interface->hw.mac.type != fm10k_mac_pf)\n \t\treturn;\n@@ -476,6 +483,7 @@ insert_tail:\n \tlist_add_tail(&vxlan_port->list, &interface->vxlan_port);\n \n \tfm10k_restore_vxlan_port(interface);\n+#endif\n }\n \n /**\n@@ -483,17 +491,23 @@ insert_tail:\n  * @netdev: network interface device structure\n  * @sa_family: Address family of freed port\n  * @port: port number used for VXLAN\n+ * @type: Tunnel type\n  *\n- * This funciton is called when a new VXLAN interface has freed a port\n+ * This function is called when a new VXLAN interface has freed a port\n  * number from the range that is currently in use for VXLAN.  The freed\n  * port is removed from the list and the new head is used to determine\n  * the port number for offloads.\n  **/\n static void fm10k_del_vxlan_port(struct net_device *dev,\n-\t\t\t\t sa_family_t sa_family, __be16 port) {\n+\t\t\t\t sa_family_t sa_family, __be16 port,\n+\t\t\t\t u32 type) {\n+#if IS_ENABLED(CONFIG_FM10K_VXLAN)\n \tstruct fm10k_intfc *interface = netdev_priv(dev);\n \tstruct fm10k_vxlan_port *vxlan_port;\n \n+\tif (type != UDP_TUNNEL_VXLAN)\n+\t\treturn;\n+\n \tif (interface->hw.mac.type != fm10k_mac_pf)\n \t\treturn;\n \n@@ -508,6 +522,7 @@ static void fm10k_del_vxlan_port(struct net_device *dev,\n \t}\n \n \tfm10k_restore_vxlan_port(interface);\n+#endif\n }\n \n /**\n@@ -1389,8 +1404,8 @@ static const struct net_device_ops fm10k_netdev_ops = {\n \t.ndo_set_vf_vlan\t= fm10k_ndo_set_vf_vlan,\n \t.ndo_set_vf_rate\t= fm10k_ndo_set_vf_bw,\n \t.ndo_get_vf_config\t= fm10k_ndo_get_vf_config,\n-\t.ndo_add_vxlan_port\t= fm10k_add_vxlan_port,\n-\t.ndo_del_vxlan_port\t= fm10k_del_vxlan_port,\n+\t.ndo_add_udp_tunnel_port\t= fm10k_add_vxlan_port,\n+\t.ndo_del_udp_tunnel_port\t= fm10k_del_vxlan_port,\n \t.ndo_do_ioctl\t\t= fm10k_ioctl,\n \t.ndo_dfwd_add_station\t= fm10k_dfwd_add_station,\n \t.ndo_dfwd_del_station\t= fm10k_dfwd_del_station,\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex 900cc57..9d45e40 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -28,6 +28,7 @@\n #include \"i40e.h\"\n #include \"i40e_diag.h\"\n #if IS_ENABLED(CONFIG_VXLAN)\n+#include <net/udp_tunnel.h>\n #include <net/vxlan.h>\n #endif\n \n@@ -8470,6 +8471,7 @@ static int i40e_set_features(struct net_device *netdev,\n \n \treturn 0;\n }\n+#if IS_ENABLED(CONFIG_VXLAN)\n \n /**\n  * i40e_get_vxlan_port_idx - Lookup a possibly offloaded for Rx UDP port\n@@ -8489,22 +8491,29 @@ static u8 i40e_get_vxlan_port_idx(struct i40e_pf *pf, __be16 port)\n \n \treturn i;\n }\n+#endif\n \n /**\n- * i40e_add_vxlan_port - Get notifications about VXLAN ports that come up\n+ * i40e_add_tunnel_port - Get notifications about UDP tunnel ports that come up\n  * @netdev: This physical port's netdev\n- * @sa_family: Socket Family that VXLAN is notifying us about\n- * @port: New UDP port number that VXLAN started listening to\n+ * @sa_family: Socket Family that tunnel netdev is  associated with\n+ * @port: New UDP port number that tunnel started listening to\n+ * @type: Tunnel Type\n  **/\n-static void i40e_add_vxlan_port(struct net_device *netdev,\n-\t\t\t\tsa_family_t sa_family, __be16 port)\n+static void i40e_add_tunnel_port(struct net_device *netdev,\n+\t\t\t\t sa_family_t sa_family, __be16 port,\n+\t\t\t\t u32 type)\n {\n+#if IS_ENABLED(CONFIG_VXLAN)\n \tstruct i40e_netdev_priv *np = netdev_priv(netdev);\n \tstruct i40e_vsi *vsi = np->vsi;\n \tstruct i40e_pf *pf = vsi->back;\n \tu8 next_idx;\n \tu8 idx;\n \n+\tif (type != UDP_TUNNEL_VXLAN)\n+\t\treturn;\n+\n \tif (sa_family == AF_INET6)\n \t\treturn;\n \n@@ -8530,22 +8539,29 @@ static void i40e_add_vxlan_port(struct net_device *netdev,\n \tpf->vxlan_ports[next_idx] = port;\n \tpf->pending_vxlan_bitmap |= BIT_ULL(next_idx);\n \tpf->flags |= I40E_FLAG_VXLAN_FILTER_SYNC;\n+#endif\n }\n \n /**\n- * i40e_del_vxlan_port - Get notifications about VXLAN ports that go away\n+ * i40e_del_tunnel_port - Get notifications about UDP tunnel ports that go away\n  * @netdev: This physical port's netdev\n- * @sa_family: Socket Family that VXLAN is notifying us about\n- * @port: UDP port number that VXLAN stopped listening to\n+ * @sa_family: Socket Family that tunnel netdev is associated with\n+ * @port: UDP port number that tunnel stopped listening to\n+ * @type: Tunnel Type\n  **/\n-static void i40e_del_vxlan_port(struct net_device *netdev,\n-\t\t\t\tsa_family_t sa_family, __be16 port)\n+static void i40e_del_tunnel_port(struct net_device *netdev,\n+\t\t\t\t sa_family_t sa_family, __be16 port,\n+\t\t\t\t u32 type)\n {\n+#if IS_ENABLED(CONFIG_VXLAN)\n \tstruct i40e_netdev_priv *np = netdev_priv(netdev);\n \tstruct i40e_vsi *vsi = np->vsi;\n \tstruct i40e_pf *pf = vsi->back;\n \tu8 idx;\n \n+\tif (type != UDP_TUNNEL_VXLAN)\n+\t\treturn;\n+\n \tif (sa_family == AF_INET6)\n \t\treturn;\n \n@@ -8563,6 +8579,7 @@ static void i40e_del_vxlan_port(struct net_device *netdev,\n \t\tnetdev_warn(netdev, \"vxlan port %d was not found, not deleting\\n\",\n \t\t\t    ntohs(port));\n \t}\n+#endif\n }\n \n static int i40e_get_phys_port_id(struct net_device *netdev,\n@@ -8789,8 +8806,8 @@ static const struct net_device_ops i40e_netdev_ops = {\n \t.ndo_get_vf_config\t= i40e_ndo_get_vf_config,\n \t.ndo_set_vf_link_state\t= i40e_ndo_set_vf_link_state,\n \t.ndo_set_vf_spoofchk\t= i40e_ndo_set_vf_spoofchk,\n-\t.ndo_add_vxlan_port\t= i40e_add_vxlan_port,\n-\t.ndo_del_vxlan_port\t= i40e_del_vxlan_port,\n+\t.ndo_add_udp_tunnel_port\t= i40e_add_tunnel_port,\n+\t.ndo_del_udp_tunnel_port\t= i40e_del_tunnel_port,\n \t.ndo_get_phys_port_id\t= i40e_get_phys_port_id,\n \t.ndo_fdb_add\t\t= i40e_ndo_fdb_add,\n \t.ndo_features_check\t= i40e_features_check,\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex f5730dd..d7ad9d9 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -50,6 +50,7 @@\n #include <linux/if_bridge.h>\n #include <linux/prefetch.h>\n #include <scsi/fc/fc_fcoe.h>\n+#include <net/udp_tunnel.h>\n #include <net/vxlan.h>\n \n #ifdef CONFIG_OF\n@@ -8312,14 +8313,18 @@ static int ixgbe_set_features(struct net_device *netdev,\n  * @dev: The port's netdev\n  * @sa_family: Socket Family that VXLAN is notifiying us about\n  * @port: New UDP port number that VXLAN started listening to\n+ * @type: Tunnel type\n  **/\n static void ixgbe_add_vxlan_port(struct net_device *dev, sa_family_t sa_family,\n-\t\t\t\t __be16 port)\n+\t\t\t\t __be16 port, u32 type)\n {\n \tstruct ixgbe_adapter *adapter = netdev_priv(dev);\n \tstruct ixgbe_hw *hw = &adapter->hw;\n \tu16 new_port = ntohs(port);\n \n+\tif (type != UDP_TUNNEL_VXLAN)\n+\t\treturn;\n+\n \tif (!(adapter->flags & IXGBE_FLAG_VXLAN_OFFLOAD_CAPABLE))\n \t\treturn;\n \n@@ -8345,13 +8350,17 @@ static void ixgbe_add_vxlan_port(struct net_device *dev, sa_family_t sa_family,\n  * @dev: The port's netdev\n  * @sa_family: Socket Family that VXLAN is notifying us about\n  * @port: UDP port number that VXLAN stopped listening to\n+ * @type: Tunnel type\n  **/\n static void ixgbe_del_vxlan_port(struct net_device *dev, sa_family_t sa_family,\n-\t\t\t\t __be16 port)\n+\t\t\t\t __be16 port, u32 type)\n {\n \tstruct ixgbe_adapter *adapter = netdev_priv(dev);\n \tu16 new_port = ntohs(port);\n \n+\tif (type != UDP_TUNNEL_VXLAN)\n+\t\treturn;\n+\n \tif (!(adapter->flags & IXGBE_FLAG_VXLAN_OFFLOAD_CAPABLE))\n \t\treturn;\n \n@@ -8663,8 +8672,8 @@ static const struct net_device_ops ixgbe_netdev_ops = {\n \t.ndo_dfwd_add_station\t= ixgbe_fwd_add,\n \t.ndo_dfwd_del_station\t= ixgbe_fwd_del,\n #ifdef CONFIG_IXGBE_VXLAN\n-\t.ndo_add_vxlan_port\t= ixgbe_add_vxlan_port,\n-\t.ndo_del_vxlan_port\t= ixgbe_del_vxlan_port,\n+\t.ndo_add_udp_tunnel_port\t= ixgbe_add_vxlan_port,\n+\t.ndo_del_udp_tunnel_port\t= ixgbe_del_vxlan_port,\n #endif /* CONFIG_IXGBE_VXLAN */\n \t.ndo_features_check\t= ixgbe_features_check,\n };\ndiff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c\nindex 886e1bc..bd8f240 100644\n--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c\n+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c\n@@ -39,6 +39,7 @@\n #include <linux/hash.h>\n #include <net/ip.h>\n #include <net/busy_poll.h>\n+#include <net/udp_tunnel.h>\n #include <net/vxlan.h>\n \n #include <linux/mlx4/driver.h>\n@@ -2402,11 +2403,15 @@ static void mlx4_en_del_vxlan_offloads(struct work_struct *work)\n }\n \n static void mlx4_en_add_vxlan_port(struct  net_device *dev,\n-\t\t\t\t   sa_family_t sa_family, __be16 port)\n+\t\t\t\t   sa_family_t sa_family, __be16 port,\n+\t\t\t\t   u32 type)\n {\n \tstruct mlx4_en_priv *priv = netdev_priv(dev);\n \t__be16 current_port;\n \n+\tif (type != UDP_TUNNEL_VXLAN)\n+\t\treturn;\n+\n \tif (priv->mdev->dev->caps.tunnel_offload_mode != MLX4_TUNNEL_OFFLOAD_MODE_VXLAN)\n \t\treturn;\n \n@@ -2425,11 +2430,15 @@ static void mlx4_en_add_vxlan_port(struct  net_device *dev,\n }\n \n static void mlx4_en_del_vxlan_port(struct  net_device *dev,\n-\t\t\t\t   sa_family_t sa_family, __be16 port)\n+\t\t\t\t   sa_family_t sa_family, __be16 port,\n+\t\t\t\t   u32 type)\n {\n \tstruct mlx4_en_priv *priv = netdev_priv(dev);\n \t__be16 current_port;\n \n+\tif (type != UDP_TUNNEL_VXLAN)\n+\t\treturn;\n+\n \tif (priv->mdev->dev->caps.tunnel_offload_mode != MLX4_TUNNEL_OFFLOAD_MODE_VXLAN)\n \t\treturn;\n \n@@ -2509,8 +2518,8 @@ static const struct net_device_ops mlx4_netdev_ops = {\n #endif\n \t.ndo_get_phys_port_id\t= mlx4_en_get_phys_port_id,\n #ifdef CONFIG_MLX4_EN_VXLAN\n-\t.ndo_add_vxlan_port\t= mlx4_en_add_vxlan_port,\n-\t.ndo_del_vxlan_port\t= mlx4_en_del_vxlan_port,\n+\t.ndo_add_udp_tunnel_port\t= mlx4_en_add_vxlan_port,\n+\t.ndo_del_udp_tunnel_port\t= mlx4_en_del_vxlan_port,\n \t.ndo_features_check\t= mlx4_en_features_check,\n #endif\n \t.ndo_set_tx_maxrate\t= mlx4_en_set_tx_maxrate,\n@@ -2547,8 +2556,8 @@ static const struct net_device_ops mlx4_netdev_ops_master = {\n #endif\n \t.ndo_get_phys_port_id\t= mlx4_en_get_phys_port_id,\n #ifdef CONFIG_MLX4_EN_VXLAN\n-\t.ndo_add_vxlan_port\t= mlx4_en_add_vxlan_port,\n-\t.ndo_del_vxlan_port\t= mlx4_en_del_vxlan_port,\n+\t.ndo_add_udp_tunnel_port\t= mlx4_en_add_vxlan_port,\n+\t.ndo_del_udp_tunnel_port\t= mlx4_en_del_vxlan_port,\n \t.ndo_features_check\t= mlx4_en_features_check,\n #endif\n \t.ndo_set_tx_maxrate\t= mlx4_en_set_tx_maxrate,\ndiff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c\nindex d448145..18d384f 100644\n--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c\n+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c\n@@ -17,6 +17,7 @@\n #include <linux/log2.h>\n #include <linux/pci.h>\n #ifdef CONFIG_QLCNIC_VXLAN\n+#include <net/udp_tunnel.h>\n #include <net/vxlan.h>\n #endif\n \n@@ -475,11 +476,15 @@ static int qlcnic_get_phys_port_id(struct net_device *netdev,\n \n #ifdef CONFIG_QLCNIC_VXLAN\n static void qlcnic_add_vxlan_port(struct net_device *netdev,\n-\t\t\t\t  sa_family_t sa_family, __be16 port)\n+\t\t\t\t  sa_family_t sa_family, __be16 port,\n+\t\t\t\t  u32 type)\n {\n \tstruct qlcnic_adapter *adapter = netdev_priv(netdev);\n \tstruct qlcnic_hardware_context *ahw = adapter->ahw;\n \n+\tif (type != UDP_TUNNEL_VXLAN)\n+\t\treturn;\n+\n \t/* Adapter supports only one VXLAN port. Use very first port\n \t * for enabling offload\n \t */\n@@ -497,11 +502,15 @@ static void qlcnic_add_vxlan_port(struct net_device *netdev,\n }\n \n static void qlcnic_del_vxlan_port(struct net_device *netdev,\n-\t\t\t\t  sa_family_t sa_family, __be16 port)\n+\t\t\t\t  sa_family_t sa_family, __be16 port,\n+\t\t\t\t  u32 type)\n {\n \tstruct qlcnic_adapter *adapter = netdev_priv(netdev);\n \tstruct qlcnic_hardware_context *ahw = adapter->ahw;\n \n+\tif (type != UDP_TUNNEL_VXLAN)\n+\t\treturn;\n+\n \tif (!qlcnic_encap_rx_offload(adapter) || !ahw->vxlan_port_count ||\n \t    (ahw->vxlan_port != ntohs(port)))\n \t\treturn;\n@@ -539,8 +548,8 @@ static const struct net_device_ops qlcnic_netdev_ops = {\n \t.ndo_fdb_dump\t\t= qlcnic_fdb_dump,\n \t.ndo_get_phys_port_id\t= qlcnic_get_phys_port_id,\n #ifdef CONFIG_QLCNIC_VXLAN\n-\t.ndo_add_vxlan_port\t= qlcnic_add_vxlan_port,\n-\t.ndo_del_vxlan_port\t= qlcnic_del_vxlan_port,\n+\t.ndo_add_udp_tunnel_port\t= qlcnic_add_vxlan_port,\n+\t.ndo_del_udp_tunnel_port\t= qlcnic_del_vxlan_port,\n \t.ndo_features_check\t= qlcnic_features_check,\n #endif\n #ifdef CONFIG_NET_POLL_CONTROLLER\ndiff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c\nindex 6369a57..463f41a 100644\n--- a/drivers/net/vxlan.c\n+++ b/drivers/net/vxlan.c\n@@ -628,9 +628,9 @@ static void vxlan_notify_add_rx_port(struct vxlan_sock *vs)\n \n \trcu_read_lock();\n \tfor_each_netdev_rcu(net, dev) {\n-\t\tif (dev->netdev_ops->ndo_add_vxlan_port)\n-\t\t\tdev->netdev_ops->ndo_add_vxlan_port(dev, sa_family,\n-\t\t\t\t\t\t\t    port);\n+\t\tif (dev->netdev_ops->ndo_add_udp_tunnel_port)\n+\t\t\tdev->netdev_ops->ndo_add_udp_tunnel_port(dev, sa_family,\n+\t\t\t\t\t\t\tport, UDP_TUNNEL_VXLAN);\n \t}\n \trcu_read_unlock();\n }\n@@ -646,9 +646,9 @@ static void vxlan_notify_del_rx_port(struct vxlan_sock *vs)\n \n \trcu_read_lock();\n \tfor_each_netdev_rcu(net, dev) {\n-\t\tif (dev->netdev_ops->ndo_del_vxlan_port)\n-\t\t\tdev->netdev_ops->ndo_del_vxlan_port(dev, sa_family,\n-\t\t\t\t\t\t\t    port);\n+\t\tif (dev->netdev_ops->ndo_del_udp_tunnel_port)\n+\t\t\tdev->netdev_ops->ndo_del_udp_tunnel_port(dev, sa_family,\n+\t\t\t\t\t\t\tport, UDP_TUNNEL_VXLAN);\n \t}\n \trcu_read_unlock();\n \n@@ -2422,9 +2422,9 @@ static struct device_type vxlan_type = {\n \t.name = \"vxlan\",\n };\n \n-/* Calls the ndo_add_vxlan_port of the caller in order to\n+/* Calls the ndo_add_udp_tunnel_port of the caller in order to\n  * supply the listening VXLAN udp ports. Callers are expected\n- * to implement the ndo_add_vxlan_port.\n+ * to implement the ndo_add_udp_tunnel_port.\n  */\n void vxlan_get_rx_port(struct net_device *dev)\n {\n@@ -2440,8 +2440,8 @@ void vxlan_get_rx_port(struct net_device *dev)\n \t\thlist_for_each_entry_rcu(vs, &vn->sock_list[i], hlist) {\n \t\t\tport = inet_sk(vs->sock->sk)->inet_sport;\n \t\t\tsa_family = vxlan_get_sk_family(vs);\n-\t\t\tdev->netdev_ops->ndo_add_vxlan_port(dev, sa_family,\n-\t\t\t\t\t\t\t    port);\n+\t\t\tdev->netdev_ops->ndo_add_udp_tunnel_port(dev, sa_family,\n+\t\t\t\t\t\t\tport, UDP_TUNNEL_VXLAN);\n \t\t}\n \t}\n \tspin_unlock(&vn->sock_lock);\ndiff --git a/include/linux/netdevice.h b/include/linux/netdevice.h\nindex 4ac653b..dbbab3b 100644\n--- a/include/linux/netdevice.h\n+++ b/include/linux/netdevice.h\n@@ -1004,18 +1004,24 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,\n  *\tnot implement this, it is assumed that the hw is not able to have\n  *\tmultiple net devices on single physical port.\n  *\n- * void (*ndo_add_vxlan_port)(struct  net_device *dev,\n- *\t\t\t      sa_family_t sa_family, __be16 port);\n- *\tCalled by vxlan to notiy a driver about the UDP port and socket\n- *\taddress family that vxlan is listnening to. It is called only when\n- *\ta new port starts listening. The operation is protected by the\n- *\tvxlan_net->sock_lock.\n- *\n- * void (*ndo_del_vxlan_port)(struct  net_device *dev,\n- *\t\t\t      sa_family_t sa_family, __be16 port);\n- *\tCalled by vxlan to notify the driver about a UDP port and socket\n- *\taddress family that vxlan is not listening to anymore. The operation\n- *\tis protected by the vxlan_net->sock_lock.\n+ * void (*ndo_add_udp_tunnel_port)(struct  net_device *dev,\n+ *\t\t\t      sa_family_t sa_family, __be16 port, u32 type);\n+ *\tCalled by UDP based tunnel modules to notify a driver about a UDP\n+ *\tport and socket address family that the tunnel is listening to. It is\n+ *\tcalled only when a new port starts listening. The operation is\n+ *\tprotected by tunnel socket sock_lock which is per tunnel type.\n+ *\tIf the driver implementation shares resources between different types\n+ *\tof tunnels, it should implement it's own locking to safeguard against\n+ *\tsimultaneous access.\n+ *\n+ * void (*ndo_del_udp_tunnel_port)(struct  net_device *dev,\n+ *\t\t\t      sa_family_t sa_family, __be16 port, u32 type);\n+ *\tCalled by UDP based tunnel modules to notify the driver about a UDP port\n+ *\tand socket address family that tunnel is not listening to anymore.\n+ *\tThe operation is protected protected by tunnel socket sock_lock which\n+ *\tis per tunnel type. If the driver implementation shares resources\n+ *\tbetween different types of tunnels, it should implement it's own locking\n+ *\tto safeguard against simultaneous access.\n  *\n  * void* (*ndo_dfwd_add_station)(struct net_device *pdev,\n  *\t\t\t\t struct net_device *dev)\n@@ -1209,13 +1215,12 @@ struct net_device_ops {\n \t\t\t\t\t\t\tstruct netdev_phys_item_id *ppid);\n \tint\t\t\t(*ndo_get_phys_port_name)(struct net_device *dev,\n \t\t\t\t\t\t\t  char *name, size_t len);\n-\tvoid\t\t\t(*ndo_add_vxlan_port)(struct  net_device *dev,\n+\tvoid\t\t\t(*ndo_add_udp_tunnel_port)(struct  net_device *dev,\n \t\t\t\t\t\t      sa_family_t sa_family,\n-\t\t\t\t\t\t      __be16 port);\n-\tvoid\t\t\t(*ndo_del_vxlan_port)(struct  net_device *dev,\n+\t\t\t\t\t\t      __be16 port, u32 type);\n+\tvoid\t\t\t(*ndo_del_udp_tunnel_port)(struct  net_device *dev,\n \t\t\t\t\t\t      sa_family_t sa_family,\n-\t\t\t\t\t\t      __be16 port);\n-\n+\t\t\t\t\t\t      __be16 port, u32 type);\n \tvoid*\t\t\t(*ndo_dfwd_add_station)(struct net_device *pdev,\n \t\t\t\t\t\t\tstruct net_device *dev);\n \tvoid\t\t\t(*ndo_dfwd_del_station)(struct net_device *pdev,\ndiff --git a/include/net/udp_tunnel.h b/include/net/udp_tunnel.h\nindex cb2f89f..eb44d5f 100644\n--- a/include/net/udp_tunnel.h\n+++ b/include/net/udp_tunnel.h\n@@ -9,6 +9,11 @@\n #include <net/addrconf.h>\n #endif\n \n+enum udp_tunnel_type {\n+\tUDP_TUNNEL_VXLAN,\n+\tUDP_TUNNEL_GENEVE,\n+};\n+\n struct udp_port_cfg {\n \tu8\t\t\tfamily;\n \n",
    "prefixes": [
        "v3",
        "2/6"
    ]
}