get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 145,
    "url": "https://patches.dpdk.org/api/patches/145/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1407813127-10991-2-git-send-email-jijiang.liu@intel.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1407813127-10991-2-git-send-email-jijiang.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1407813127-10991-2-git-send-email-jijiang.liu@intel.com",
    "date": "2014-08-12T03:12:02",
    "name": "[dpdk-dev,1/6] i40e:vxlan packet identification",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "627e52c7dc45499e75841f41dbe2607b53dcac20",
    "submitter": {
        "id": 52,
        "url": "https://patches.dpdk.org/api/people/52/?format=api",
        "name": "Jijiang Liu",
        "email": "jijiang.liu@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1407813127-10991-2-git-send-email-jijiang.liu@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/145/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/145/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<jijiangl@shecgisg004.sh.intel.com>",
        "Received": [
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id 776A8B391\n\tfor <dev@dpdk.org>; Tue, 12 Aug 2014 05:09:31 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga102.jf.intel.com with ESMTP; 11 Aug 2014 20:06:33 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga001.jf.intel.com with ESMTP; 11 Aug 2014 20:12:22 -0700",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id s7C3CKQm012538;\n\tTue, 12 Aug 2014 11:12:20 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid s7C3CHMU011110; Tue, 12 Aug 2014 11:12:19 +0800",
            "(from jijiangl@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s7C3CHmr011106; \n\tTue, 12 Aug 2014 11:12:17 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.01,846,1400050800\"; d=\"scan'208\";a=\"557194076\"",
        "From": "Jijiang Liu <jijiang.liu@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Tue, 12 Aug 2014 11:12:02 +0800",
        "Message-Id": "<1407813127-10991-2-git-send-email-jijiang.liu@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": "<1407813127-10991-1-git-send-email-jijiang.liu@intel.com>",
        "References": "<1407813127-10991-1-git-send-email-jijiang.liu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 1/6]i40e:vxlan packet identification",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-List-Received-Date": "Tue, 12 Aug 2014 03:09:32 -0000"
    },
    "content": "VxLAN UDP port configuration on i40e, it includes\n -  VxLAN UDP port initialization\n -  Add VxLAN UDP port API \n\nSigned-off-by: jijiangl <jijiang.liu@intel.com>\nAcked-by: Helin Zhang <helin.zhang@intel.com>\nAcked-by: Jingjing Wu <jingjing.wu@intel.com>\nAcked-by: Jing Chen <jing.d.chen@intel.com>\n---\n lib/librte_ether/rte_ethdev.c     |   63 ++++++++++++\n lib/librte_ether/rte_ethdev.h     |   76 ++++++++++++++\n lib/librte_ether/rte_ether.h      |   10 ++\n lib/librte_pmd_i40e/i40e_ethdev.c |  199 ++++++++++++++++++++++++++++++++++++-\n lib/librte_pmd_i40e/i40e_ethdev.h |    5 +\n 5 files changed, 352 insertions(+), 1 deletions(-)",
    "diff": "diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex fd1010a..325edb1 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -1892,6 +1892,69 @@ rte_eth_dev_rss_hash_conf_get(uint8_t port_id,\n }\n \n int\n+rte_eth_dev_udp_tunnel_add(uint8_t port_id,\n+\t\t\t   struct rte_eth_udp_tunnel *udp_tunnel,\n+\t\t\t   uint8_t count)\n+{\n+\tuint8_t i;\n+\tstruct rte_eth_dev *dev;\n+\tstruct rte_eth_udp_tunnel *tunnel;\n+\n+\tif (port_id >= nb_ports) {\n+\t\tPMD_DEBUG_TRACE(\"Invalid port_id=%d\\n\", port_id);\n+\t\treturn -ENODEV;\n+\t}\n+\n+\tif (udp_tunnel == NULL) {\n+\t\tPMD_DEBUG_TRACE(\"Invalid udp_tunnel parameter\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\ttunnel = udp_tunnel;\n+\n+\tfor (i = 0; i < count; i++, tunnel++) {\n+\t\tif (tunnel->prot_type >= RTE_TUNNEL_TYPE_MAX) {\n+\t\t\tPMD_DEBUG_TRACE(\"Invalid tunnel type\\n\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\n+\tdev = &rte_eth_devices[port_id];\n+\tFUNC_PTR_OR_ERR_RET(*dev->dev_ops->udp_tunnel_add, -ENOTSUP);\n+\treturn (*dev->dev_ops->udp_tunnel_add)(dev, udp_tunnel, count);\n+}\n+\n+int\n+rte_eth_dev_udp_tunnel_delete(uint8_t port_id,\n+\t\t\t      struct rte_eth_udp_tunnel *udp_tunnel,\n+\t\t\t      uint8_t count)\n+{\n+\tuint8_t i;\n+\tstruct rte_eth_dev *dev;\n+\tstruct rte_eth_udp_tunnel *tunnel;\n+\n+\tif (port_id >= nb_ports) {\n+\t\tPMD_DEBUG_TRACE(\"Invalid port_id=%d\\n\", port_id);\n+\t\treturn -ENODEV;\n+\t}\n+\tdev = &rte_eth_devices[port_id];\n+\n+\tif (udp_tunnel == NULL) {\n+\t\tPMD_DEBUG_TRACE(\"Invalid udp_tunnel parametr\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\ttunnel = udp_tunnel;\n+\tfor (i = 0; i < count; i++, tunnel++) {\n+\t\tif (tunnel->prot_type >= RTE_TUNNEL_TYPE_MAX) {\n+\t\t\tPMD_DEBUG_TRACE(\"Invalid tunnel type\\n\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\n+\tFUNC_PTR_OR_ERR_RET(*dev->dev_ops->udp_tunnel_del, -ENOTSUP);\n+\treturn (*dev->dev_ops->udp_tunnel_del)(dev, udp_tunnel, count);\n+}\n+\n+int\n rte_eth_led_on(uint8_t port_id)\n {\n \tstruct rte_eth_dev *dev;\ndiff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h\nindex 50df654..d24907f 100644\n--- a/lib/librte_ether/rte_ethdev.h\n+++ b/lib/librte_ether/rte_ethdev.h\n@@ -708,6 +708,26 @@ struct rte_fdir_conf {\n };\n \n /**\n+ * Tunneled type.\n+ */\n+enum rte_eth_tunnel_type {\n+\tRTE_TUNNEL_TYPE_NONE = 0,\n+\tRTE_TUNNEL_TYPE_VXLAN,\n+\tRTE_TUNNEL_TYPE_GENEVE,\n+\tRTE_TUNNEL_TYPE_TEREDO,\n+\tRTE_TUNNEL_TYPE_NVGRE,\n+\tRTE_TUNNEL_TYPE_MAX,\n+};\n+\n+/**\n+ * UDP tunneling configuration.\n+ */\n+struct rte_eth_udp_tunnel {\n+\tuint16_t udp_port;\n+\tuint8_t prot_type;\n+};\n+\n+/**\n  *  Possible l4type of FDIR filters.\n  */\n enum rte_l4type {\n@@ -829,6 +849,7 @@ struct rte_intr_conf {\n  * configuration settings may be needed.\n  */\n struct rte_eth_conf {\n+\tenum rte_eth_tunnel_type tunnel_type;\n \tuint16_t link_speed;\n \t/**< ETH_LINK_SPEED_10[0|00|000], or 0 for autonegotation */\n \tuint16_t link_duplex;\n@@ -1240,6 +1261,17 @@ typedef int (*eth_mirror_rule_reset_t)(struct rte_eth_dev *dev,\n \t\t\t\t  uint8_t rule_id);\n /**< @internal Remove a traffic mirroring rule on an Ethernet device */\n \n+typedef int (*eth_udp_tunnel_add_t)(struct rte_eth_dev *dev,\n+\t\t\t\t    struct rte_eth_udp_tunnel *tunnel_udp,\n+\t\t\t\t    uint8_t count);\n+/**< @internal Add tunneling UDP info */\n+\n+typedef int (*eth_udp_tunnel_del_t)(struct rte_eth_dev *dev,\n+\t\t\t\t    struct rte_eth_udp_tunnel *tunnel_udp,\n+\t\t\t\t    uint8_t count);\n+/**< @internal Delete tunneling UDP info */\n+\n+\n #ifdef RTE_NIC_BYPASS\n \n enum {\n@@ -1412,6 +1444,8 @@ struct eth_dev_ops {\n \teth_set_vf_rx_t            set_vf_rx;  /**< enable/disable a VF receive */\n \teth_set_vf_tx_t            set_vf_tx;  /**< enable/disable a VF transmit */\n \teth_set_vf_vlan_filter_t   set_vf_vlan_filter;  /**< Set VF VLAN filter */\n+\teth_udp_tunnel_add_t       udp_tunnel_add;\n+\teth_udp_tunnel_del_t       udp_tunnel_del;\n \teth_set_queue_rate_limit_t set_queue_rate_limit;   /**< Set queue rate limit */\n \teth_set_vf_rate_limit_t    set_vf_rate_limit;   /**< Set VF rate limit */\n \n@@ -3268,6 +3302,48 @@ int\n rte_eth_dev_rss_hash_conf_get(uint8_t port_id,\n \t\t\t      struct rte_eth_rss_conf *rss_conf);\n \n+ /**\n+ * Add tunneling UDP port configuration of Ethernet device\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ * @param tunnel_udp\n+ *   Where to store the current Tunneling UDP configuration\n+ *   of the Ethernet device.\n+ * @param count\n+ *   How many configurations are going to added.\n+ *\n+ * @return\n+ *   - (0) if successful.\n+ *   - (-ENODEV) if port identifier is invalid.\n+ *   - (-ENOTSUP) if hardware doesn't support tunnel type.\n+ */\n+int\n+rte_eth_dev_udp_tunnel_add(uint8_t port_id,\n+\t\t\tstruct rte_eth_udp_tunnel *tunnel_udp,\n+\t\t\tuint8_t count);\n+\n+ /**\n+ * Detete tunneling UDP port configuration of Ethernet device\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ * @param tunnel_udp\n+ *   Where to store the current Tunneling UDP configuration\n+ *   of the Ethernet device.\n+ * @param count\n+ *   How many configurations are going to deleted.\n+ *\n+ * @return\n+ *   - (0) if successful.\n+ *   - (-ENODEV) if port identifier is invalid.\n+ *   - (-ENOTSUP) if hardware doesn't support tunnel type.\n+ */\n+int\n+rte_eth_dev_udp_tunnel_delete(uint8_t port_id,\n+\t\t\tstruct rte_eth_udp_tunnel *tunnel_udp,\n+\t\t\tuint8_t count);\n+\n /**\n  * add syn filter\n  *\ndiff --git a/lib/librte_ether/rte_ether.h b/lib/librte_ether/rte_ether.h\nindex 2e08f23..604712a 100644\n--- a/lib/librte_ether/rte_ether.h\n+++ b/lib/librte_ether/rte_ether.h\n@@ -69,6 +69,8 @@ extern \"C\" {\n \n #define ETHER_MIN_MTU 68 /**< Minimum MTU for IPv4 packets, see RFC 791. */\n \n+#define ETHER_VXLAN_UDP_PORT  4789 /** < default port assigned to VxLAN */\n+\n /**\n  * Ethernet address:\n  * A universally administered address is uniquely assigned to a device by its\n@@ -286,6 +288,12 @@ struct vlan_hdr {\n \tuint16_t eth_proto;/**< Ethernet type of encapsulated frame. */\n } __attribute__((__packed__));\n \n+/* VXLAN protocol header */\n+struct vxlan_hdr {\n+\tuint32_t vx_flags; /**< VxLAN flag. */\n+\tuint32_t vx_vni;   /**< VxLAN ID. */\n+} __attribute__((__packed__));\n+\n /* Ethernet frame types */\n #define ETHER_TYPE_IPv4 0x0800 /**< IPv4 Protocol. */\n #define ETHER_TYPE_IPv6 0x86DD /**< IPv6 Protocol. */\n@@ -294,6 +302,8 @@ struct vlan_hdr {\n #define ETHER_TYPE_VLAN 0x8100 /**< IEEE 802.1Q VLAN tagging. */\n #define ETHER_TYPE_1588 0x88F7 /**< IEEE 802.1AS 1588 Precise Time Protocol. */\n \n+#define ETHER_VXLAN_HLEN (sizeof(struct udp_hdr) + sizeof(struct vxlan_hdr))\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c\nindex 9ed31b5..bb3d39a 100644\n--- a/lib/librte_pmd_i40e/i40e_ethdev.c\n+++ b/lib/librte_pmd_i40e/i40e_ethdev.c\n@@ -187,7 +187,7 @@ static int i40e_res_pool_alloc(struct i40e_res_pool_info *pool,\n static int i40e_dev_init_vlan(struct rte_eth_dev *dev);\n static int i40e_veb_release(struct i40e_veb *veb);\n static struct i40e_veb *i40e_veb_setup(struct i40e_pf *pf,\n-\t\t\t\t\t\tstruct i40e_vsi *vsi);\n+\t\t\t\t\tstruct i40e_vsi *vsi);\n static int i40e_pf_config_mq_rx(struct i40e_pf *pf);\n static int i40e_vsi_config_double_vlan(struct i40e_vsi *vsi, int on);\n static inline int i40e_find_all_vlan_for_mac(struct i40e_vsi *vsi,\n@@ -203,6 +203,13 @@ static int i40e_dev_rss_hash_update(struct rte_eth_dev *dev,\n \t\t\t\t    struct rte_eth_rss_conf *rss_conf);\n static int i40e_dev_rss_hash_conf_get(struct rte_eth_dev *dev,\n \t\t\t\t      struct rte_eth_rss_conf *rss_conf);\n+static int i40e_dev_udp_tunnel_add(struct rte_eth_dev *dev,\n+\t\t\t\t   struct rte_eth_udp_tunnel *udp_tunnel,\n+\t\t\t\t   uint8_t count);\n+static int i40e_dev_udp_tunnel_del(struct rte_eth_dev *dev,\n+\t\t\t\t   struct rte_eth_udp_tunnel *udp_tunnel,\n+\t\t\t\t   uint8_t count);\n+static int i40e_pf_config_vxlan(struct i40e_pf *pf);\n \n /* Default hash key buffer for RSS */\n static uint32_t rss_key_default[I40E_PFQF_HKEY_MAX_INDEX + 1];\n@@ -248,6 +255,8 @@ static struct eth_dev_ops i40e_eth_dev_ops = {\n \t.reta_query                   = i40e_dev_rss_reta_query,\n \t.rss_hash_update              = i40e_dev_rss_hash_update,\n \t.rss_hash_conf_get            = i40e_dev_rss_hash_conf_get,\n+\t.udp_tunnel_add               = i40e_dev_udp_tunnel_add,\n+\t.udp_tunnel_del               = i40e_dev_udp_tunnel_del,\n };\n \n static struct eth_driver rte_i40e_pmd = {\n@@ -2365,6 +2374,34 @@ i40e_vsi_dump_bw_config(struct i40e_vsi *vsi)\n \treturn 0;\n }\n \n+static int\n+i40e_vxlan_filters_init(struct i40e_pf *pf)\n+{\n+\tuint8_t filter_index;\n+\tint ret = 0;\n+\tstruct i40e_hw *hw = I40E_PF_TO_HW(pf);\n+\n+\tif (!(pf->flags & I40E_FLAG_VXLAN))\n+\t\treturn 0;\n+\n+\t/* Init first entry in tunneling UDP table */\n+\tret = i40e_aq_add_udp_tunnel(hw, ETHER_VXLAN_UDP_PORT,\n+\t\t\t\tI40E_AQC_TUNNEL_TYPE_VXLAN,\n+\t\t\t\t&filter_index, NULL);\n+\tif (ret < 0) {\n+\t\tPMD_DRV_LOG(ERR, \"Failed to add UDP tunnel port %d \"\n+\t\t\t\"with index=%d\\n\", RTE_VXLAN_UDP_PORT,\n+\t\t\t filter_index);\n+\t} else {\n+\t\tpf->vxlan_bitmap |= 1;\n+\t\tpf->vxlan_ports[0] = ETHER_VXLAN_UDP_PORT;\n+\t\tPMD_DRV_LOG(INFO, \"Added UDP tunnel port %d with \"\n+\t\t\t\"index=%d\\n\", RTE_VXLAN_UDP_PORT, filter_index);\n+\t}\n+\n+\treturn ret;\n+}\n+\n /* Setup a VSI */\n struct i40e_vsi *\n i40e_vsi_setup(struct i40e_pf *pf,\n@@ -2988,6 +3025,12 @@ i40e_vsi_rx_init(struct i40e_vsi *vsi)\n \tuint16_t i;\n \n \ti40e_pf_config_mq_rx(pf);\n+\n+\tif (data->dev_conf.tunnel_type == RTE_TUNNEL_TYPE_VXLAN) {\n+\t\tpf->flags |= I40E_FLAG_VXLAN;\n+\t\ti40e_pf_config_vxlan(pf);\n+\t}\n+\n \tfor (i = 0; i < data->nb_rx_queues; i++) {\n \t\tret = i40e_rx_queue_init(data->rx_queues[i]);\n \t\tif (ret != I40E_SUCCESS) {\n@@ -3904,6 +3947,150 @@ i40e_dev_rss_hash_conf_get(struct rte_eth_dev *dev,\n \treturn 0;\n }\n \n+static int\n+i40e_get_vxlan_port_idx(struct i40e_pf *pf, uint16_t port)\n+{\n+\tuint8_t i;\n+\n+\tfor (i = 0; i < I40E_MAX_PF_UDP_OFFLOAD_PORTS; i++) {\n+\t\tif (pf->vxlan_ports[i] == port)\n+\t\t\treturn i;\n+\t}\n+\n+\treturn -1;\n+}\n+\n+static int\n+i40e_add_vxlan_port(struct i40e_pf *pf, uint16_t port)\n+{\n+\tint  idx, ret;\n+\tuint8_t filter_idx;\n+\tstruct i40e_hw *hw = I40E_PF_TO_HW(pf);\n+\n+\tif (!(pf->flags & I40E_FLAG_VXLAN)) {\n+\t\tPMD_DRV_LOG(ERR, \"VxLAN tunneling mode is not configured\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tidx = i40e_get_vxlan_port_idx(pf, port);\n+\n+\t/* Check if port already exists */\n+\tif (idx >= 0) {\n+\t\tPMD_DRV_LOG(ERR, \"Port %d already offloaded\\n\", port);\n+\t\treturn -1;\n+\t}\n+\n+\t/* Now check if there is space to add the new port */\n+\tidx = i40e_get_vxlan_port_idx(pf, 0);\n+\tif (idx < 0) {\n+\t\tPMD_DRV_LOG(ERR, \"Maximum number of UDP ports reached,\"\n+\t\t\t\"not adding port %d\\n\", port);\n+\t\treturn -ENOSPC;\n+\t}\n+\n+\tret =  i40e_aq_add_udp_tunnel(hw, port, I40E_AQC_TUNNEL_TYPE_VXLAN,\n+\t\t\t\t\t&filter_idx, NULL);\n+\tif (ret < 0) {\n+\t\tPMD_DRV_LOG(ERR, \"Failed to add VxLAN UDP port %d\\n\", port);\n+\t\treturn -1;\n+\t}\n+\n+\tPMD_DRV_LOG(INFO, \"Added %s port %d with AQ command with index %d\\n\",\n+\t\t\t port,  filter_index);\n+\n+\t/* New port: add it and mark its index in the bitmap */\n+\tpf->vxlan_ports[idx] = port;\n+\tpf->vxlan_bitmap |= (1 << idx);\n+\n+\treturn 0;\n+}\n+\n+static int\n+i40e_del_vxlan_port(struct i40e_pf *pf, uint16_t port)\n+{\n+\tint idx;\n+\tstruct i40e_hw *hw = I40E_PF_TO_HW(pf);\n+\n+\tidx = i40e_get_vxlan_port_idx(pf, port);\n+\n+\tif (idx < 0) {\n+\t\tPMD_DRV_LOG(ERR, \"Port %d doesn't exist\\n\", port);\n+\t\treturn -1;\n+\t}\n+\n+\tif (i40e_aq_del_udp_tunnel(hw, idx, NULL) < 0) {\n+\t\tPMD_DRV_LOG(ERR, \"Failed to delete VxLAN UDP port %d\\n\", port);\n+\t\treturn -1;\n+\t}\n+\n+\tPMD_DRV_LOG(INFO, \"Added port %d with AQ command with index %d\\n\",\n+\t\t\tport, idx);\n+\n+\tpf->vxlan_ports[idx] = 0;\n+\tpf->vxlan_bitmap &= ~(1 << idx);\n+\n+\treturn 0;\n+}\n+\n+/* configure port of UDP tunneling */\n+static int\n+i40e_dev_udp_tunnel_add(struct rte_eth_dev *dev,\n+\t\tstruct rte_eth_udp_tunnel *udp_tunnel, uint8_t count)\n+{\n+\tuint16_t i;\n+\tint ret = 0;\n+\tstruct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n+\n+\tfor (i = 0; i < count; i++, udp_tunnel++) {\n+\t\tswitch (udp_tunnel->prot_type) {\n+\t\tcase RTE_TUNNEL_TYPE_VXLAN:\n+\t\t\tret = i40e_add_vxlan_port(pf, udp_tunnel->udp_port);\n+\t\t\tbreak;\n+\n+\t\tcase RTE_TUNNEL_TYPE_GENEVE:\n+\t\tcase RTE_TUNNEL_TYPE_TEREDO:\n+\t\t\tPMD_DRV_LOG(ERR, \"Tunnel type is not supported now.\\n\");\n+\t\t\tret = -1;\n+\t\t\tbreak;\n+\n+\t\tdefault:\n+\t\t\tPMD_DRV_LOG(ERR, \"Invalid tunnel type\\n\");\n+\t\t\tret = -1;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\treturn ret;\n+}\n+\n+static int\n+i40e_dev_udp_tunnel_del(struct rte_eth_dev *dev,\n+\t\t\tstruct rte_eth_udp_tunnel *udp_tunnel, uint8_t count)\n+{\n+\tuint16_t i;\n+\tint ret = 0;\n+\tstruct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n+\n+\tfor (i = 0; i < count; i++, udp_tunnel++) {\n+\t\tswitch (udp_tunnel->prot_type) {\n+\t\tcase RTE_TUNNEL_TYPE_VXLAN:\n+\t\t\tret = i40e_del_vxlan_port(pf, udp_tunnel->udp_port);\n+\t\t\tbreak;\n+\t\tcase RTE_TUNNEL_TYPE_GENEVE:\n+\t\tcase RTE_TUNNEL_TYPE_TEREDO:\n+\t\t\tPMD_DRV_LOG(ERR, \"Tunnel type is not supported now.\\n\");\n+\t\t\tret = -1;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tPMD_DRV_LOG(ERR, \"Invalid tunnel type\\n\");\n+\t\t\tret = -1;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\treturn ret;\n+}\n+\n /* Configure RSS */\n static int\n i40e_pf_config_rss(struct i40e_pf *pf)\n@@ -3940,6 +4127,16 @@ i40e_pf_config_rss(struct i40e_pf *pf)\n \treturn i40e_hw_rss_hash_set(hw, &rss_conf);\n }\n \n+/* Configure VxLAN */\n+static int\n+i40e_pf_config_vxlan(struct i40e_pf *pf)\n+{\n+\tif (pf->flags & I40E_FLAG_VXLAN)\n+\t\ti40e_vxlan_filters_init(pf);\n+\n+\treturn 0;\n+}\n+\n static int\n i40e_pf_config_mq_rx(struct i40e_pf *pf)\n {\ndiff --git a/lib/librte_pmd_i40e/i40e_ethdev.h b/lib/librte_pmd_i40e/i40e_ethdev.h\nindex 64deef2..22d0628 100644\n--- a/lib/librte_pmd_i40e/i40e_ethdev.h\n+++ b/lib/librte_pmd_i40e/i40e_ethdev.h\n@@ -60,6 +60,7 @@\n #define I40E_FLAG_HEADER_SPLIT_DISABLED (1ULL << 4)\n #define I40E_FLAG_HEADER_SPLIT_ENABLED  (1ULL << 5)\n #define I40E_FLAG_FDIR                  (1ULL << 6)\n+#define I40E_FLAG_VXLAN                 (1ULL << 7)\n #define I40E_FLAG_ALL (I40E_FLAG_RSS | \\\n \t\t       I40E_FLAG_DCB | \\\n \t\t       I40E_FLAG_VMDQ | \\\n@@ -216,6 +217,10 @@ struct i40e_pf {\n \tuint16_t vmdq_nb_qps; /* The number of queue pairs of VMDq */\n \tuint16_t vf_nb_qps; /* The number of queue pairs of VF */\n \tuint16_t fdir_nb_qps; /* The number of queue pairs of Flow Director */\n+\n+\t/* store VxLAN UDP ports */\n+\tuint16_t vxlan_ports[I40E_MAX_PF_UDP_OFFLOAD_PORTS];\n+\tuint16_t vxlan_bitmap; /* Vxlan bit mask */\n };\n \n enum pending_msg {\n",
    "prefixes": [
        "dpdk-dev",
        "1/6"
    ]
}