Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/3567/?format=api
https://patches.dpdk.org/api/patches/3567/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1424451707-12342-5-git-send-email-declan.doherty@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": "<1424451707-12342-5-git-send-email-declan.doherty@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1424451707-12342-5-git-send-email-declan.doherty@intel.com", "date": "2015-02-20T17:01:47", "name": "[dpdk-dev,v3,4/4] app/testpmd:test NVGRE Tx checksum offload", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "d10bfdc7024df662aba4105f5eb3ecd75fb19c10", "submitter": { "id": 11, "url": "https://patches.dpdk.org/api/people/11/?format=api", "name": "Doherty, Declan", "email": "declan.doherty@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1424451707-12342-5-git-send-email-declan.doherty@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/3567/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/3567/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 185F9B791;\n\tFri, 20 Feb 2015 17:59:16 +0100 (CET)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id D7AAEB765\n\tfor <dev@dpdk.org>; Fri, 20 Feb 2015 17:59:09 +0100 (CET)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga102.jf.intel.com with ESMTP; 20 Feb 2015 08:55:00 -0800", "from dwdohert-dpdk-fedora-20.ir.intel.com ([163.33.213.98])\n\tby orsmga001.jf.intel.com with ESMTP; 20 Feb 2015 08:59:08 -0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.09,615,1418112000\"; d=\"scan'208\";a=\"654893488\"", "From": "Declan Doherty <declan.doherty@intel.com>", "To": "dev@dpdk.org", "Date": "Fri, 20 Feb 2015 17:01:47 +0000", "Message-Id": "<1424451707-12342-5-git-send-email-declan.doherty@intel.com>", "X-Mailer": "git-send-email 1.9.3", "In-Reply-To": "<1424451707-12342-4-git-send-email-declan.doherty@intel.com>", "References": "<1423701947-17996-1-git-send-email-jijiang.liu@intel.com>\n\t<1424451707-12342-1-git-send-email-declan.doherty@intel.com>\n\t<1424451707-12342-2-git-send-email-declan.doherty@intel.com>\n\t<1424451707-12342-3-git-send-email-declan.doherty@intel.com>\n\t<1424451707-12342-4-git-send-email-declan.doherty@intel.com>", "Subject": "[dpdk-dev] [PATCH v3 4/4] app/testpmd:test NVGRE Tx checksum offload", "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": "From: Jijiang Liu <jijiang.liu@intel.com>\n\nEnhance csum fwd engine based on current TX checksum framework in order\nto test TX Checksum offload for NVGRE packet.\n\nIt includes:\n - IPv4 and IPv6 packet\n - outer L3, inner L3 and L4 checksum offload for Tx side.\n\nSigned-off-by: Declan Doherty <declan.doherty@intel.com>\n---\n app/test-pmd/csumonly.c | 29 ++++++++++++++++++-----------\n 1 file changed, 18 insertions(+), 11 deletions(-)", "diff": "diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c\nindex 0a7af79..52cbd8a 100644\n--- a/app/test-pmd/csumonly.c\n+++ b/app/test-pmd/csumonly.c\n@@ -79,6 +79,10 @@\n #define IP_HDRLEN 0x05 /* default IP header length == five 32-bits words. */\n #define IP_VHL_DEF (IP_VERSION | IP_HDRLEN)\n \n+#define GRE_KEY_PRESENT 0x2000\n+#define GRE_KEY_LEN 4\n+#define GRE_SUPPORTED_FIELDS GRE_KEY_PRESENT\n+\n /* We cannot use rte_cpu_to_be_16() on a constant in a switch/case */\n #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN\n #define _htons(x) ((uint16_t)((((x) & 0x00ffU) << 8) | (((x) & 0xff00U) >> 8)))\n@@ -101,7 +105,7 @@ struct testpmd_offload_info {\n \tuint16_t tso_segsz;\n };\n \n-/* simplified GRE header (flags must be 0) */\n+/* simplified GRE header */\n struct simple_gre_hdr {\n \tuint16_t flags;\n \tuint16_t proto;\n@@ -233,11 +237,17 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)\n \tstruct ether_hdr *eth_hdr;\n \tstruct ipv4_hdr *ipv4_hdr;\n \tstruct ipv6_hdr *ipv6_hdr;\n+\tuint8_t gre_len = 0;\n \n-\t/* if flags != 0; it's not supported */\n-\tif (gre_hdr->flags != 0)\n+\t/* check which fields are supported */\n+\tif ((gre_hdr->flags & _htons(~GRE_SUPPORTED_FIELDS)) != 0)\n \t\treturn;\n \n+\tgre_len += sizeof(struct simple_gre_hdr);\n+\n+\tif (gre_hdr->flags & _htons(GRE_KEY_PRESENT))\n+\t\tgre_len += GRE_KEY_LEN;\n+\n \tif (gre_hdr->proto == _htons(ETHER_TYPE_IPv4)) {\n \t\tinfo->is_tunnel = 1;\n \t\tinfo->outer_ethertype = info->ethertype;\n@@ -245,8 +255,7 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)\n \t\tinfo->outer_l3_len = info->l3_len;\n \t\tinfo->outer_l4_proto = info->l4_proto;\n \n-\t\tipv4_hdr = (struct ipv4_hdr *)((char *)gre_hdr +\n-\t\t\tsizeof(struct simple_gre_hdr));\n+\t\tipv4_hdr = (struct ipv4_hdr *)((char *)gre_hdr + gre_len);\n \n \t\tparse_ipv4(ipv4_hdr, info);\n \t\tinfo->ethertype = _htons(ETHER_TYPE_IPv4);\n@@ -259,28 +268,26 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)\n \t\tinfo->outer_l3_len = info->l3_len;\n \t\tinfo->outer_l4_proto = info->l4_proto;\n \n-\t\tipv6_hdr = (struct ipv6_hdr *)((char *)gre_hdr +\n-\t\t\tsizeof(struct simple_gre_hdr));\n+\t\tipv6_hdr = (struct ipv6_hdr *)((char *)gre_hdr + gre_len);\n \n \t\tinfo->ethertype = _htons(ETHER_TYPE_IPv6);\n \t\tparse_ipv6(ipv6_hdr, info);\n \t\tinfo->l2_len = 0;\n \n-\t} else if (gre_hdr->proto == _htons(0x6558)) { /* ETH_P_TEB in linux */\n+\t} else if (gre_hdr->proto == _htons(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 \n-\t\teth_hdr = (struct ether_hdr *)((char *)gre_hdr +\n-\t\t\tsizeof(struct simple_gre_hdr));\n+\t\teth_hdr = (struct ether_hdr *)((char *)gre_hdr + gre_len);\n \n \t\tparse_ethernet(eth_hdr, info);\n \t} else\n \t\treturn;\n \n-\tinfo->l2_len += sizeof(struct simple_gre_hdr);\n+\tinfo->l2_len += gre_len;\n }\n \n \n", "prefixes": [ "dpdk-dev", "v3", "4/4" ] }{ "id": 3567, "url": "