Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/362/?format=api
http://patches.dpdk.org/api/patches/362/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1410503639-10753-2-git-send-email-jijiang.liu@intel.com/", "project": { "id": 1, "url": "http://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": "<1410503639-10753-2-git-send-email-jijiang.liu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1410503639-10753-2-git-send-email-jijiang.liu@intel.com", "date": "2014-09-12T06:33:52", "name": "[dpdk-dev,v3,1/8] i40e:support VxLAN packet identification in librte_ether", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "40ed74ee4aa6acb77db5131001608895d221e6d9", "submitter": { "id": 52, "url": "http://patches.dpdk.org/api/people/52/?format=api", "name": "Jijiang Liu", "email": "jijiang.liu@intel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1410503639-10753-2-git-send-email-jijiang.liu@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/362/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/362/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 2FD80B398;\n\tFri, 12 Sep 2014 08:28:54 +0200 (CEST)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 35D84B396\n\tfor <dev@dpdk.org>; Fri, 12 Sep 2014 08:28:52 +0200 (CEST)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga101.fm.intel.com with ESMTP; 11 Sep 2014 23:34:08 -0700", "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby fmsmga002.fm.intel.com with ESMTP; 11 Sep 2014 23:34:07 -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 s8C6Y5bV005968;\n\tFri, 12 Sep 2014 14:34:05 +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 s8C6Y3jC010795; Fri, 12 Sep 2014 14:34:05 +0800", "(from jijiangl@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s8C6Y3gP010791; \n\tFri, 12 Sep 2014 14:34:03 +0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.04,511,1406617200\"; d=\"scan'208\";a=\"598478035\"", "From": "Jijiang Liu <jijiang.liu@intel.com>", "To": "dev@dpdk.org", "Date": "Fri, 12 Sep 2014 14:33:52 +0800", "Message-Id": "<1410503639-10753-2-git-send-email-jijiang.liu@intel.com>", "X-Mailer": "git-send-email 1.7.4.1", "In-Reply-To": "<1410503639-10753-1-git-send-email-jijiang.liu@intel.com>", "References": "<1410503639-10753-1-git-send-email-jijiang.liu@intel.com>", "Subject": "[dpdk-dev] [PATCH v3 1/8]i40e:support VxLAN packet identification\n\tin librte_ether", "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>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Add data structures and APIs in librte_ether for supporting tunneling UDP port configuration on i40e,\nCurrently, only VxLAN is implemented, which include\n - VxLAN UDP port initialization\n - Add APIs to configure VxLAN UDP port\n\nSigned-off-by: Jijiang Liu <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---\n lib/librte_ether/rte_ethdev.c | 63 ++++++++++++++++++++++++++++++++++\n lib/librte_ether/rte_ethdev.h | 76 +++++++++++++++++++++++++++++++++++++++++\n lib/librte_ether/rte_ether.h | 8 ++++\n 3 files changed, 147 insertions(+), 0 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..74ac313 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+ * UDP tunneling configuration.\n+ */\n+struct rte_eth_udp_tunnel {\n+\tuint16_t udp_port;\n+\tuint8_t prot_type;\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 * 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..ddbdbb3 100644\n--- a/lib/librte_ether/rte_ether.h\n+++ b/lib/librte_ether/rte_ether.h\n@@ -286,6 +286,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 +300,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\n", "prefixes": [ "dpdk-dev", "v3", "1/8" ] }{ "id": 362, "url": "