Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2453/?format=api
https://patches.dpdk.org/api/patches/2453/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1421883395-27235-15-git-send-email-olivier.matz@6wind.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": "<1421883395-27235-15-git-send-email-olivier.matz@6wind.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1421883395-27235-15-git-send-email-olivier.matz@6wind.com", "date": "2015-01-21T23:36:33", "name": "[dpdk-dev,RFC,14/16] testpmd: introduce parse_vxlan in csum fwd engine", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "30cd3b17dc8f69215b70971efe241d632b46f26d", "submitter": { "id": 8, "url": "https://patches.dpdk.org/api/people/8/?format=api", "name": "Olivier Matz", "email": "olivier.matz@6wind.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1421883395-27235-15-git-send-email-olivier.matz@6wind.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/2453/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/2453/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 1AE965AD7;\n\tThu, 22 Jan 2015 00:37:15 +0100 (CET)", "from mail-wi0-f171.google.com (mail-wi0-f171.google.com\n\t[209.85.212.171]) by dpdk.org (Postfix) with ESMTP id 99D505A15\n\tfor <dev@dpdk.org>; Thu, 22 Jan 2015 00:36:59 +0100 (CET)", "by mail-wi0-f171.google.com with SMTP id l15so29986979wiw.4\n\tfor <dev@dpdk.org>; Wed, 21 Jan 2015 15:36:59 -0800 (PST)", "from glumotte.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net.\n\t[82.239.227.177]) by mx.google.com with ESMTPSA id\n\twa5sm1710761wjc.8.2015.01.21.15.36.58\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tWed, 21 Jan 2015 15:36:59 -0800 (PST)" ], "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=RHRccN9CfYRn8NJyG5RQxrxjbizJsHiBrzoQesj4884=;\n\tb=EY/Uw9lHw38HIIlpGFmxydmBRAG8Af1vSCMtlchUhRfAlqm8O3jf534wglXcZsSlVj\n\tERtn0EopzcapMLDX9HwnfLaRZOTbPQmP0X2hUfviCXSykLz8QrYLsIfFLWlh+hMTlb+b\n\tcaZ0wlrU8VeBTkIn541LrAyyvXtFFEG2+7G9XStXblWcfpXtlDLFzHngttlPmSA/P4MA\n\tn/Xw6jPvjNlTXWuvfsKppU50Orfo21/bQ5hevwlJg4gvhy8wAwVPfZyiXwPxIYImZrUh\n\trm6lP8foZjodhSyLcnlBNrMC0mT5sNPOF+Oe2mFTx80WLB5D/oS0raCZn1xZeLYtXp8k\n\tnsKw==", "X-Gm-Message-State": "ALoCoQm/qFR2krBYtLyAIbEBRaSs5l588Y+A9SHusTH6HyvS6BQiEgwytChknmupuO07eAuhly4D", "X-Received": "by 10.194.234.2 with SMTP id ua2mr27685670wjc.40.1421883419497; \n\tWed, 21 Jan 2015 15:36:59 -0800 (PST)", "From": "Olivier Matz <olivier.matz@6wind.com>", "To": "dev@dpdk.org", "Date": "Thu, 22 Jan 2015 00:36:33 +0100", "Message-Id": "<1421883395-27235-15-git-send-email-olivier.matz@6wind.com>", "X-Mailer": "git-send-email 2.1.3", "In-Reply-To": "<1421883395-27235-1-git-send-email-olivier.matz@6wind.com>", "References": "<1421883395-27235-1-git-send-email-olivier.matz@6wind.com>", "Subject": "[dpdk-dev] [RFC 14/16] testpmd: introduce parse_vxlan in csum fwd\n\tengine", "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": "Move code parsing vxlan into a function. It will ease the support\nof GRE tunnels and IPIP tunnels in next commits.\n\nSigned-off-by: Olivier Matz <olivier.matz@6wind.com>\n---\n app/test-pmd/csumonly.c | 68 +++++++++++++++++++++++++++----------------------\n 1 file changed, 37 insertions(+), 31 deletions(-)", "diff": "diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c\nindex 0b89d89..52af0e7 100644\n--- a/app/test-pmd/csumonly.c\n+++ b/app/test-pmd/csumonly.c\n@@ -93,7 +93,6 @@ struct testpmd_offload_info {\n \tuint16_t l3_len;\n \tuint16_t l4_len;\n \tuint8_t l4_proto;\n-\tuint8_t l4_tun_len;\n \tuint8_t is_tunnel;\n \tuint16_t outer_ethertype;\n \tuint16_t outer_l2_len;\n@@ -191,6 +190,34 @@ parse_ethernet(struct ether_hdr *eth_hdr, struct testpmd_offload_info *info)\n \t}\n }\n \n+/* Parse a vxlan header */\n+static void\n+parse_vxlan(struct udp_hdr *udp_hdr, struct testpmd_offload_info *info,\n+\tuint64_t mbuf_olflags)\n+{\n+\tstruct ether_hdr *eth_hdr;\n+\n+\t/* check udp destination port, 4789 is the default vxlan port\n+\t * (rfc7348) or that the rx offload flag is set (i40e only\n+\t * currently) */\n+\tif (udp_hdr->dst_port != _htons(4789) &&\n+\t\t(mbuf_olflags & (PKT_RX_TUNNEL_IPV4_HDR |\n+\t\t\tPKT_RX_TUNNEL_IPV6_HDR)) != 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+\n+\teth_hdr = (struct ether_hdr *)((char *)udp_hdr +\n+\t\tsizeof(struct udp_hdr) +\n+\t\tsizeof(struct vxlan_hdr));\n+\n+\tparse_ethernet(eth_hdr, info);\n+\tinfo->l2_len += ETHER_VXLAN_HLEN; /* add udp + vxlan */\n+}\n+\n /* modify the IPv4 or IPv4 source address of a packet */\n static void\n change_ip_addresses(void *l3_hdr, uint16_t ethertype)\n@@ -356,7 +383,6 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)\n \tstruct rte_mbuf *m;\n \tstruct ether_hdr *eth_hdr;\n \tvoid *l3_hdr = NULL, *outer_l3_hdr = NULL; /* can be IPv4 or IPv6 */\n-\tstruct udp_hdr *udp_hdr;\n \tuint16_t nb_rx;\n \tuint16_t nb_tx;\n \tuint16_t i;\n@@ -414,33 +440,15 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)\n \t\t/* check if it's a supported tunnel (only vxlan for now) */\n \t\tif ((testpmd_ol_flags & TESTPMD_TX_OFFLOAD_PARSE_TUNNEL) &&\n \t\t\tinfo.l4_proto == IPPROTO_UDP) {\n+\t\t\tstruct udp_hdr *udp_hdr;\n \t\t\tudp_hdr = (struct udp_hdr *)((char *)l3_hdr + info.l3_len);\n+\t\t\tparse_vxlan(udp_hdr, &info, m->ol_flags);\n+\t\t}\n \n-\t\t\t/* check udp destination port, 4789 is the default\n-\t\t\t * vxlan port (rfc7348) */\n-\t\t\tif (udp_hdr->dst_port == _htons(4789)) {\n-\t\t\t\tinfo.l4_tun_len = ETHER_VXLAN_HLEN;\n-\t\t\t\tinfo.is_tunnel = 1;\n-\n-\t\t\t/* currently, this flag is set by i40e only if the\n-\t\t\t * packet is vxlan */\n-\t\t\t} else if (m->ol_flags & (PKT_RX_TUNNEL_IPV4_HDR |\n-\t\t\t\t\tPKT_RX_TUNNEL_IPV6_HDR))\n-\t\t\t\tinfo.is_tunnel = 1;\n-\n-\t\t\tif (info.is_tunnel == 1) {\n-\t\t\t\tinfo.outer_ethertype = info.ethertype;\n-\t\t\t\tinfo.outer_l2_len = info.l2_len;\n-\t\t\t\tinfo.outer_l3_len = info.l3_len;\n-\t\t\t\touter_l3_hdr = l3_hdr;\n-\n-\t\t\t\teth_hdr = (struct ether_hdr *)((char *)udp_hdr +\n-\t\t\t\t\tsizeof(struct udp_hdr) +\n-\t\t\t\t\tsizeof(struct vxlan_hdr));\n-\n-\t\t\t\tparse_ethernet(eth_hdr, &info);\n-\t\t\t\tl3_hdr = (char *)eth_hdr + info.l2_len;\n-\t\t\t}\n+\t\t/* update l3_hdr and outer_l3_hdr if a tunnel was parsed */\n+\t\tif (info.is_tunnel) {\n+\t\t\touter_l3_hdr = l3_hdr;\n+\t\t\tl3_hdr = (char *)l3_hdr + info.outer_l3_len + info.l2_len;\n \t\t}\n \n \t\t/* step 2: change all source IPs (v4 or v6) so we need\n@@ -472,7 +480,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)\n \t\t\tif (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM) {\n \t\t\t\tm->outer_l2_len = info.outer_l2_len;\n \t\t\t\tm->outer_l3_len = info.outer_l3_len;\n-\t\t\t\tm->l2_len = info.l4_tun_len + info.l2_len;\n+\t\t\t\tm->l2_len = info.l2_len;\n \t\t\t\tm->l3_len = info.l3_len;\n \t\t\t}\n \t\t\telse {\n@@ -482,9 +490,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)\n \t\t\t\t the payload will be modified by the\n \t\t\t\t hardware */\n \t\t\t\tm->l2_len = info.outer_l2_len +\n-\t\t\t\t\tinfo.outer_l3_len +\n-\t\t\t\t\tsizeof(struct udp_hdr) +\n-\t\t\t\t\tsizeof(struct vxlan_hdr) + info.l2_len;\n+\t\t\t\t\tinfo.outer_l3_len + info.l2_len;\n \t\t\t\tm->l3_len = info.l3_len;\n \t\t\t\tm->l4_len = info.l4_len;\n \t\t\t}\n", "prefixes": [ "dpdk-dev", "RFC", "14/16" ] }{ "id": 2453, "url": "