Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/76061/?format=api
http://patches.dpdk.org/api/patches/76061/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200827070244.32392-4-ophirmu@nvidia.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": "<20200827070244.32392-4-ophirmu@nvidia.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200827070244.32392-4-ophirmu@nvidia.com", "date": "2020-08-27T07:02:44", "name": "[v2,3/3] app/testpmd: reduce tunnel parsing code duplication", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "1738a87c59bd466f030f8f7ff7e3bc87a0ee7393", "submitter": { "id": 1908, "url": "http://patches.dpdk.org/api/people/1908/?format=api", "name": "Ophir Munk", "email": "ophirmu@nvidia.com" }, "delegate": { "id": 319, "url": "http://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200827070244.32392-4-ophirmu@nvidia.com/mbox/", "series": [ { "id": 11817, "url": "http://patches.dpdk.org/api/series/11817/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11817", "date": "2020-08-27T07:02:44", "name": "Add GENEVE protocol parsing to testpmd", "version": 2, "mbox": "http://patches.dpdk.org/series/11817/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/76061/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/76061/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 41473A04B1;\n\tThu, 27 Aug 2020 09:03:00 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 95B9E1BF5A;\n\tThu, 27 Aug 2020 09:02:59 +0200 (CEST)", "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 425261BFD7\n for <dev@dpdk.org>; Thu, 27 Aug 2020 09:02:58 +0200 (CEST)", "from Internal Mail-Server by MTLPINE1 (envelope-from\n ophirmu@nvidia.com) with SMTP; 27 Aug 2020 10:02:52 +0300", "from nvidia.com (pegasus05.mtr.labs.mlnx [10.210.16.100])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 07R72qrY020045;\n Thu, 27 Aug 2020 10:02:52 +0300" ], "From": "Ophir Munk <ophirmu@nvidia.com>", "To": "dev@dpdk.org, Wenzhuo Lu <wenzhuo.lu@intel.com>,\n Beilei Xing <beilei.xing@intel.com>,\n Bernard Iremonger <bernard.iremonger@intel.com>", "Cc": "Ophir Munk <ophirmu@mellanox.com>", "Date": "Thu, 27 Aug 2020 07:02:44 +0000", "Message-Id": "<20200827070244.32392-4-ophirmu@nvidia.com>", "X-Mailer": "git-send-email 2.8.4", "In-Reply-To": "<20200827070244.32392-1-ophirmu@nvidia.com>", "References": "<20200729082905.19499-4-ophirmu@mellanox.com>\n <20200827070244.32392-1-ophirmu@nvidia.com>", "Subject": "[dpdk-dev] [PATCH v2 3/3] app/testpmd: reduce tunnel parsing code\n\tduplication", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "From: Ophir Munk <ophirmu@mellanox.com>\n\nThis is a cleanup commit. It assembles all tunnel outer updates into one\nfunction call to avoid code duplications.\nIt defines RTE_VXLAN_GPE_DEFAULT_PORT (4790) in accordance with all\nother tunnel protocol definitions.\n\nSigned-off-by: Ophir Munk <ophirmu@mellanox.com>\n---\n app/test-pmd/csumonly.c | 72 +++++++++++++---------------------------------\n lib/librte_net/rte_vxlan.h | 1 +\n 2 files changed, 21 insertions(+), 52 deletions(-)", "diff": "diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c\nindex 5f29868..3a0e46e 100644\n--- a/app/test-pmd/csumonly.c\n+++ b/app/test-pmd/csumonly.c\n@@ -63,7 +63,7 @@\n #define _htons(x) (x)\n #endif\n \n-uint16_t vxlan_gpe_udp_port = 4790;\n+uint16_t vxlan_gpe_udp_port = RTE_VXLAN_GPE_DEFAULT_PORT;\n uint16_t geneve_udp_port = RTE_GENEVE_DEFAULT_PORT;\n \n /* structure that caches offload info for the current packet */\n@@ -181,6 +181,17 @@ parse_ethernet(struct rte_ether_hdr *eth_hdr, struct testpmd_offload_info *info)\n \t}\n }\n \n+/* Fill in outer layers length */\n+static void\n+update_tunnel_outer(struct testpmd_offload_info *info)\n+{\n+\tinfo->is_tunnel = 1;\n+\tinfo->outer_ethertype = info->ethertype;\n+\tinfo->outer_l2_len = info->l2_len;\n+\tinfo->outer_l3_len = info->l3_len;\n+\tinfo->outer_l4_proto = info->l4_proto;\n+}\n+\n /*\n * Parse a GTP protocol header.\n * No optional fields and next extension header type.\n@@ -201,11 +212,7 @@ parse_gtp(struct rte_udp_hdr *udp_hdr,\n \t udp_hdr->dst_port != _htons(RTE_GTPU_UDP_PORT))\n \t\treturn;\n \n-\tinfo->is_tunnel = 1;\n-\tinfo->outer_ethertype = info->ethertype;\n-\tinfo->outer_l2_len = info->l2_len;\n-\tinfo->outer_l3_len = info->l3_len;\n-\tinfo->outer_l4_proto = info->l4_proto;\n+\tupdate_tunnel_outer(info);\n \tinfo->l2_len = 0;\n \n \tgtp_hdr = (struct rte_gtp_hdr *)((char *)udp_hdr +\n@@ -257,11 +264,7 @@ parse_vxlan(struct rte_udp_hdr *udp_hdr,\n \t\tRTE_ETH_IS_TUNNEL_PKT(pkt_type) == 0)\n \t\treturn;\n \n-\tinfo->is_tunnel = 1;\n-\tinfo->outer_ethertype = info->ethertype;\n-\tinfo->outer_l2_len = info->l2_len;\n-\tinfo->outer_l3_len = info->l3_len;\n-\tinfo->outer_l4_proto = info->l4_proto;\n+\tupdate_tunnel_outer(info);\n \n \teth_hdr = (struct rte_ether_hdr *)((char *)udp_hdr +\n \t\tsizeof(struct rte_udp_hdr) +\n@@ -291,11 +294,7 @@ parse_vxlan_gpe(struct rte_udp_hdr *udp_hdr,\n \n \tif (!vxlan_gpe_hdr->proto || vxlan_gpe_hdr->proto ==\n \t RTE_VXLAN_GPE_TYPE_IPV4) {\n-\t\tinfo->is_tunnel = 1;\n-\t\tinfo->outer_ethertype = info->ethertype;\n-\t\tinfo->outer_l2_len = info->l2_len;\n-\t\tinfo->outer_l3_len = info->l3_len;\n-\t\tinfo->outer_l4_proto = info->l4_proto;\n+\t\tupdate_tunnel_outer(info);\n \n \t\tipv4_hdr = (struct rte_ipv4_hdr *)((char *)vxlan_gpe_hdr +\n \t\t\t vxlan_gpe_len);\n@@ -305,11 +304,7 @@ parse_vxlan_gpe(struct rte_udp_hdr *udp_hdr,\n \t\tinfo->l2_len = 0;\n \n \t} else if (vxlan_gpe_hdr->proto == RTE_VXLAN_GPE_TYPE_IPV6) {\n-\t\tinfo->is_tunnel = 1;\n-\t\tinfo->outer_ethertype = info->ethertype;\n-\t\tinfo->outer_l2_len = info->l2_len;\n-\t\tinfo->outer_l3_len = info->l3_len;\n-\t\tinfo->outer_l4_proto = info->l4_proto;\n+\t\tupdate_tunnel_outer(info);\n \n \t\tipv6_hdr = (struct rte_ipv6_hdr *)((char *)vxlan_gpe_hdr +\n \t\t\t vxlan_gpe_len);\n@@ -319,11 +314,7 @@ parse_vxlan_gpe(struct rte_udp_hdr *udp_hdr,\n \t\tinfo->l2_len = 0;\n \n \t} else if (vxlan_gpe_hdr->proto == RTE_VXLAN_GPE_TYPE_ETH) {\n-\t\tinfo->is_tunnel = 1;\n-\t\tinfo->outer_ethertype = info->ethertype;\n-\t\tinfo->outer_l2_len = info->l2_len;\n-\t\tinfo->outer_l3_len = info->l3_len;\n-\t\tinfo->outer_l4_proto = info->l4_proto;\n+\t\tupdate_tunnel_outer(info);\n \n \t\teth_hdr = (struct rte_ether_hdr *)((char *)vxlan_gpe_hdr +\n \t\t\t vxlan_gpe_len);\n@@ -335,17 +326,6 @@ parse_vxlan_gpe(struct rte_udp_hdr *udp_hdr,\n \tinfo->l2_len += RTE_ETHER_VXLAN_GPE_HLEN;\n }\n \n-/* Fill in outer layers length */\n-static void\n-update_tunnel_outer(struct testpmd_offload_info *info)\n-{\n-\tinfo->is_tunnel = 1;\n-\tinfo->outer_ethertype = info->ethertype;\n-\tinfo->outer_l2_len = info->l2_len;\n-\tinfo->outer_l3_len = info->l3_len;\n-\tinfo->outer_l4_proto = info->l4_proto;\n-}\n-\n /* Parse a geneve header */\n static void\n parse_geneve(struct rte_udp_hdr *udp_hdr,\n@@ -412,11 +392,7 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)\n \t\tgre_len += GRE_EXT_LEN;\n \n \tif (gre_hdr->proto == _htons(RTE_ETHER_TYPE_IPV4)) {\n-\t\tinfo->is_tunnel = 1;\n-\t\tinfo->outer_ethertype = info->ethertype;\n-\t\tinfo->outer_l2_len = info->l2_len;\n-\t\tinfo->outer_l3_len = info->l3_len;\n-\t\tinfo->outer_l4_proto = info->l4_proto;\n+\t\tupdate_tunnel_outer(info);\n \n \t\tipv4_hdr = (struct rte_ipv4_hdr *)((char *)gre_hdr + gre_len);\n \n@@ -425,11 +401,7 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)\n \t\tinfo->l2_len = 0;\n \n \t} else if (gre_hdr->proto == _htons(RTE_ETHER_TYPE_IPV6)) {\n-\t\tinfo->is_tunnel = 1;\n-\t\tinfo->outer_ethertype = info->ethertype;\n-\t\tinfo->outer_l2_len = info->l2_len;\n-\t\tinfo->outer_l3_len = info->l3_len;\n-\t\tinfo->outer_l4_proto = info->l4_proto;\n+\t\tupdate_tunnel_outer(info);\n \n \t\tipv6_hdr = (struct rte_ipv6_hdr *)((char *)gre_hdr + gre_len);\n \n@@ -438,11 +410,7 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)\n \t\tinfo->l2_len = 0;\n \n \t} else if (gre_hdr->proto == _htons(RTE_ETHER_TYPE_TEB)) {\n-\t\tinfo->is_tunnel = 1;\n-\t\tinfo->outer_ethertype = info->ethertype;\n-\t\tinfo->outer_l2_len = info->l2_len;\n-\t\tinfo->outer_l3_len = info->l3_len;\n-\t\tinfo->outer_l4_proto = info->l4_proto;\n+\t\tupdate_tunnel_outer(info);\n \n \t\teth_hdr = (struct rte_ether_hdr *)((char *)gre_hdr + gre_len);\n \ndiff --git a/lib/librte_net/rte_vxlan.h b/lib/librte_net/rte_vxlan.h\nindex c23c10c..2ad6061 100644\n--- a/lib/librte_net/rte_vxlan.h\n+++ b/lib/librte_net/rte_vxlan.h\n@@ -22,6 +22,7 @@ extern \"C\" {\n \n /** VXLAN default port. */\n #define RTE_VXLAN_DEFAULT_PORT 4789\n+#define RTE_VXLAN_GPE_DEFAULT_PORT 4790\n \n /**\n * VXLAN protocol header.\n", "prefixes": [ "v2", "3/3" ] }{ "id": 76061, "url": "