get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2828,
    "url": "https://patches.dpdk.org/api/patches/2828/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1422623775-8050-12-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": "<1422623775-8050-12-git-send-email-olivier.matz@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1422623775-8050-12-git-send-email-olivier.matz@6wind.com",
    "date": "2015-01-30T13:16:06",
    "name": "[dpdk-dev,11/20] testpmd: use a structure to store offload info in csum fwd engine",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "fb2a61043016963491da97f585f7a0ad05398e79",
    "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/1422623775-8050-12-git-send-email-olivier.matz@6wind.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/2828/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/2828/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 D24C85AC8;\n\tFri, 30 Jan 2015 14:17:03 +0100 (CET)",
            "from mail-wi0-f174.google.com (mail-wi0-f174.google.com\n\t[209.85.212.174]) by dpdk.org (Postfix) with ESMTP id C7B1058CB\n\tfor <dev@dpdk.org>; Fri, 30 Jan 2015 14:16:39 +0100 (CET)",
            "by mail-wi0-f174.google.com with SMTP id n3so2980077wiv.1\n\tfor <dev@dpdk.org>; Fri, 30 Jan 2015 05:16:39 -0800 (PST)",
            "from glumotte.dev.6wind.com (6wind.net2.nerim.net.\n\t[213.41.180.237]) by mx.google.com with ESMTPSA id\n\tli7sm6911300wic.4.2015.01.30.05.16.38\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tFri, 30 Jan 2015 05:16:39 -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=ClgeT8QaY/vuyhOoTTLAKbS4KBwpz0jRcNFu9mmH0fE=;\n\tb=kbBRuUhtBBonGjRllp/UwkfFyLDiHGl+3vTNbXiudFUabUsow2T2r08rgmNqIgRkM1\n\tuQmIq+RB6Q+s7cHBAZ7bJ9pBdJyte5LOJzXHZpp41cckY6G0+O2SkmNDr92/lH3CKikP\n\tXZRMWE+y7MEtq2/oLg5qcxE5ML0ODeNBV7jltPg3+dnUn/NsZ9AzeT/jI2EVwL0WyXMo\n\tu4ng+Aa1WQknMZ70c+90xxyJY4KEMbVsLIVm1eyHKVAcnskQmWwiAhvUqgLHJ6RtMepE\n\tVQYcICwndJjlGkkOblIrAuJXKxVZtOLP/xGjO3wVUPauhCVF4ynWat07f5P96HgkoqAy\n\ty1Ow==",
        "X-Gm-Message-State": "ALoCoQnXY6v2PfHvvXAv/mQZfIPeeavICx4zKNas/7GaxBUoCBVznfnMP0JSR5N8eQIJyHrvGnm0",
        "X-Received": "by 10.180.160.194 with SMTP id xm2mr4655946wib.77.1422623799619; \n\tFri, 30 Jan 2015 05:16:39 -0800 (PST)",
        "From": "Olivier Matz <olivier.matz@6wind.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 30 Jan 2015 14:16:06 +0100",
        "Message-Id": "<1422623775-8050-12-git-send-email-olivier.matz@6wind.com>",
        "X-Mailer": "git-send-email 2.1.4",
        "In-Reply-To": "<1422623775-8050-1-git-send-email-olivier.matz@6wind.com>",
        "References": "<1421883395-27235-1-git-send-email-olivier.matz@6wind.com>\n\t<1422623775-8050-1-git-send-email-olivier.matz@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH 11/20] testpmd: use a structure to store offload\n\tinfo in csum fwd engine",
        "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": "To simplify the API of parse_* functions, store all the offload\ninformation for the current packet in a structure.\n\nNo functional change.\n\nSigned-off-by: Olivier Matz <olivier.matz@6wind.com>\n---\n app/test-pmd/csumonly.c | 222 +++++++++++++++++++++++++-----------------------\n 1 file changed, 115 insertions(+), 107 deletions(-)",
    "diff": "diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c\nindex b023f12..0b89d89 100644\n--- a/app/test-pmd/csumonly.c\n+++ b/app/test-pmd/csumonly.c\n@@ -86,6 +86,21 @@\n #define _htons(x) (x)\n #endif\n \n+/* structure that caches offload info for the current packet */\n+struct testpmd_offload_info {\n+\tuint16_t ethertype;\n+\tuint16_t l2_len;\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+\tuint16_t outer_l3_len;\n+\tuint16_t tso_segsz;\n+};\n+\n static uint16_t\n get_psd_sum(void *l3_hdr, uint16_t ethertype, uint64_t ol_flags)\n {\n@@ -106,38 +121,36 @@ get_udptcp_checksum(void *l3_hdr, void *l4_hdr, uint16_t ethertype)\n \n /* Parse an IPv4 header to fill l3_len, l4_len, and l4_proto */\n static void\n-parse_ipv4(struct ipv4_hdr *ipv4_hdr, uint16_t *l3_len, uint8_t *l4_proto,\n-\tuint16_t *l4_len)\n+parse_ipv4(struct ipv4_hdr *ipv4_hdr, struct testpmd_offload_info *info)\n {\n \tstruct tcp_hdr *tcp_hdr;\n \n-\t*l3_len = (ipv4_hdr->version_ihl & 0x0f) * 4;\n-\t*l4_proto = ipv4_hdr->next_proto_id;\n+\tinfo->l3_len = (ipv4_hdr->version_ihl & 0x0f) * 4;\n+\tinfo->l4_proto = ipv4_hdr->next_proto_id;\n \n \t/* only fill l4_len for TCP, it's useful for TSO */\n-\tif (*l4_proto == IPPROTO_TCP) {\n-\t\ttcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr + *l3_len);\n-\t\t*l4_len = (tcp_hdr->data_off & 0xf0) >> 2;\n+\tif (info->l4_proto == IPPROTO_TCP) {\n+\t\ttcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr + info->l3_len);\n+\t\tinfo->l4_len = (tcp_hdr->data_off & 0xf0) >> 2;\n \t} else\n-\t\t*l4_len = 0;\n+\t\tinfo->l4_len = 0;\n }\n \n /* Parse an IPv6 header to fill l3_len, l4_len, and l4_proto */\n static void\n-parse_ipv6(struct ipv6_hdr *ipv6_hdr, uint16_t *l3_len, uint8_t *l4_proto,\n-\tuint16_t *l4_len)\n+parse_ipv6(struct ipv6_hdr *ipv6_hdr, struct testpmd_offload_info *info)\n {\n \tstruct tcp_hdr *tcp_hdr;\n \n-\t*l3_len = sizeof(struct ipv6_hdr);\n-\t*l4_proto = ipv6_hdr->proto;\n+\tinfo->l3_len = sizeof(struct ipv6_hdr);\n+\tinfo->l4_proto = ipv6_hdr->proto;\n \n \t/* only fill l4_len for TCP, it's useful for TSO */\n-\tif (*l4_proto == IPPROTO_TCP) {\n-\t\ttcp_hdr = (struct tcp_hdr *)((char *)ipv6_hdr + *l3_len);\n-\t\t*l4_len = (tcp_hdr->data_off & 0xf0) >> 2;\n+\tif (info->l4_proto == IPPROTO_TCP) {\n+\t\ttcp_hdr = (struct tcp_hdr *)((char *)ipv6_hdr + info->l3_len);\n+\t\tinfo->l4_len = (tcp_hdr->data_off & 0xf0) >> 2;\n \t} else\n-\t\t*l4_len = 0;\n+\t\tinfo->l4_len = 0;\n }\n \n /*\n@@ -146,35 +159,34 @@ parse_ipv6(struct ipv6_hdr *ipv6_hdr, uint16_t *l3_len, uint8_t *l4_proto,\n  * header. The l4_len argument is only set in case of TCP (useful for TSO).\n  */\n static void\n-parse_ethernet(struct ether_hdr *eth_hdr, uint16_t *ethertype, uint16_t *l2_len,\n-\tuint16_t *l3_len, uint8_t *l4_proto, uint16_t *l4_len)\n+parse_ethernet(struct ether_hdr *eth_hdr, struct testpmd_offload_info *info)\n {\n \tstruct ipv4_hdr *ipv4_hdr;\n \tstruct ipv6_hdr *ipv6_hdr;\n \n-\t*l2_len = sizeof(struct ether_hdr);\n-\t*ethertype = eth_hdr->ether_type;\n+\tinfo->l2_len = sizeof(struct ether_hdr);\n+\tinfo->ethertype = eth_hdr->ether_type;\n \n-\tif (*ethertype == _htons(ETHER_TYPE_VLAN)) {\n+\tif (info->ethertype == _htons(ETHER_TYPE_VLAN)) {\n \t\tstruct vlan_hdr *vlan_hdr = (struct vlan_hdr *)(eth_hdr + 1);\n \n-\t\t*l2_len  += sizeof(struct vlan_hdr);\n-\t\t*ethertype = vlan_hdr->eth_proto;\n+\t\tinfo->l2_len  += sizeof(struct vlan_hdr);\n+\t\tinfo->ethertype = vlan_hdr->eth_proto;\n \t}\n \n-\tswitch (*ethertype) {\n+\tswitch (info->ethertype) {\n \tcase _htons(ETHER_TYPE_IPv4):\n-\t\tipv4_hdr = (struct ipv4_hdr *) ((char *)eth_hdr + *l2_len);\n-\t\tparse_ipv4(ipv4_hdr, l3_len, l4_proto, l4_len);\n+\t\tipv4_hdr = (struct ipv4_hdr *) ((char *)eth_hdr + info->l2_len);\n+\t\tparse_ipv4(ipv4_hdr, info);\n \t\tbreak;\n \tcase _htons(ETHER_TYPE_IPv6):\n-\t\tipv6_hdr = (struct ipv6_hdr *) ((char *)eth_hdr + *l2_len);\n-\t\tparse_ipv6(ipv6_hdr, l3_len, l4_proto, l4_len);\n+\t\tipv6_hdr = (struct ipv6_hdr *) ((char *)eth_hdr + info->l2_len);\n+\t\tparse_ipv6(ipv6_hdr, info);\n \t\tbreak;\n \tdefault:\n-\t\t*l4_len = 0;\n-\t\t*l3_len = 0;\n-\t\t*l4_proto = 0;\n+\t\tinfo->l4_len = 0;\n+\t\tinfo->l3_len = 0;\n+\t\tinfo->l4_proto = 0;\n \t\tbreak;\n \t}\n }\n@@ -197,8 +209,8 @@ change_ip_addresses(void *l3_hdr, uint16_t ethertype)\n /* if possible, calculate the checksum of a packet in hw or sw,\n  * depending on the testpmd command line configuration */\n static uint64_t\n-process_inner_cksums(void *l3_hdr, uint16_t ethertype, uint16_t l3_len,\n-\tuint8_t l4_proto, uint16_t tso_segsz, uint16_t testpmd_ol_flags)\n+process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,\n+\tuint16_t testpmd_ol_flags)\n {\n \tstruct ipv4_hdr *ipv4_hdr = l3_hdr;\n \tstruct udp_hdr *udp_hdr;\n@@ -206,12 +218,12 @@ process_inner_cksums(void *l3_hdr, uint16_t ethertype, uint16_t l3_len,\n \tstruct sctp_hdr *sctp_hdr;\n \tuint64_t ol_flags = 0;\n \n-\tif (ethertype == _htons(ETHER_TYPE_IPv4)) {\n+\tif (info->ethertype == _htons(ETHER_TYPE_IPv4)) {\n \t\tipv4_hdr = l3_hdr;\n \t\tipv4_hdr->hdr_checksum = 0;\n \n \t\tol_flags |= PKT_TX_IPV4;\n-\t\tif (tso_segsz != 0 && l4_proto == IPPROTO_TCP) {\n+\t\tif (info->tso_segsz != 0 && info->l4_proto == IPPROTO_TCP) {\n \t\t\tol_flags |= PKT_TX_IP_CKSUM;\n \t\t} else {\n \t\t\tif (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_IP_CKSUM)\n@@ -220,41 +232,44 @@ process_inner_cksums(void *l3_hdr, uint16_t ethertype, uint16_t l3_len,\n \t\t\t\tipv4_hdr->hdr_checksum =\n \t\t\t\t\trte_ipv4_cksum(ipv4_hdr);\n \t\t}\n-\t} else if (ethertype == _htons(ETHER_TYPE_IPv6))\n+\t} else if (info->ethertype == _htons(ETHER_TYPE_IPv6))\n \t\tol_flags |= PKT_TX_IPV6;\n \telse\n \t\treturn 0; /* packet type not supported, nothing to do */\n \n-\tif (l4_proto == IPPROTO_UDP) {\n-\t\tudp_hdr = (struct udp_hdr *)((char *)l3_hdr + l3_len);\n+\tif (info->l4_proto == IPPROTO_UDP) {\n+\t\tudp_hdr = (struct udp_hdr *)((char *)l3_hdr + info->l3_len);\n \t\t/* do not recalculate udp cksum if it was 0 */\n \t\tif (udp_hdr->dgram_cksum != 0) {\n \t\t\tudp_hdr->dgram_cksum = 0;\n \t\t\tif (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_UDP_CKSUM) {\n \t\t\t\tol_flags |= PKT_TX_UDP_CKSUM;\n \t\t\t\tudp_hdr->dgram_cksum = get_psd_sum(l3_hdr,\n-\t\t\t\t\tethertype, ol_flags);\n+\t\t\t\t\tinfo->ethertype, ol_flags);\n \t\t\t} else {\n \t\t\t\tudp_hdr->dgram_cksum =\n \t\t\t\t\tget_udptcp_checksum(l3_hdr, udp_hdr,\n-\t\t\t\t\t\tethertype);\n+\t\t\t\t\t\tinfo->ethertype);\n \t\t\t}\n \t\t}\n-\t} else if (l4_proto == IPPROTO_TCP) {\n-\t\ttcp_hdr = (struct tcp_hdr *)((char *)l3_hdr + l3_len);\n+\t} else if (info->l4_proto == IPPROTO_TCP) {\n+\t\ttcp_hdr = (struct tcp_hdr *)((char *)l3_hdr + info->l3_len);\n \t\ttcp_hdr->cksum = 0;\n-\t\tif (tso_segsz != 0) {\n+\t\tif (info->tso_segsz != 0) {\n \t\t\tol_flags |= PKT_TX_TCP_SEG;\n-\t\t\ttcp_hdr->cksum = get_psd_sum(l3_hdr, ethertype, ol_flags);\n+\t\t\ttcp_hdr->cksum = get_psd_sum(l3_hdr, info->ethertype,\n+\t\t\t\tol_flags);\n \t\t} else if (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_TCP_CKSUM) {\n \t\t\tol_flags |= PKT_TX_TCP_CKSUM;\n-\t\t\ttcp_hdr->cksum = get_psd_sum(l3_hdr, ethertype, ol_flags);\n+\t\t\ttcp_hdr->cksum = get_psd_sum(l3_hdr, info->ethertype,\n+\t\t\t\tol_flags);\n \t\t} else {\n \t\t\ttcp_hdr->cksum =\n-\t\t\t\tget_udptcp_checksum(l3_hdr, tcp_hdr, ethertype);\n+\t\t\t\tget_udptcp_checksum(l3_hdr, tcp_hdr,\n+\t\t\t\t\tinfo->ethertype);\n \t\t}\n-\t} else if (l4_proto == IPPROTO_SCTP) {\n-\t\tsctp_hdr = (struct sctp_hdr *)((char *)l3_hdr + l3_len);\n+\t} else if (info->l4_proto == IPPROTO_SCTP) {\n+\t\tsctp_hdr = (struct sctp_hdr *)((char *)l3_hdr + info->l3_len);\n \t\tsctp_hdr->cksum = 0;\n \t\t/* sctp payload must be a multiple of 4 to be\n \t\t * offloaded */\n@@ -274,15 +289,15 @@ process_inner_cksums(void *l3_hdr, uint16_t ethertype, uint16_t l3_len,\n  * meaning IP + UDP). The caller already checked that it's a vxlan\n  * packet */\n static uint64_t\n-process_outer_cksums(void *outer_l3_hdr, uint16_t outer_ethertype,\n-\tuint16_t outer_l3_len, uint16_t testpmd_ol_flags)\n+process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,\n+uint16_t testpmd_ol_flags)\n {\n \tstruct ipv4_hdr *ipv4_hdr = outer_l3_hdr;\n \tstruct ipv6_hdr *ipv6_hdr = outer_l3_hdr;\n \tstruct udp_hdr *udp_hdr;\n \tuint64_t ol_flags = 0;\n \n-\tif (outer_ethertype == _htons(ETHER_TYPE_IPv4)) {\n+\tif (info->outer_ethertype == _htons(ETHER_TYPE_IPv4)) {\n \t\tipv4_hdr->hdr_checksum = 0;\n \t\tol_flags |= PKT_TX_OUTER_IPV4;\n \n@@ -296,11 +311,11 @@ process_outer_cksums(void *outer_l3_hdr, uint16_t outer_ethertype,\n \t/* outer UDP checksum is always done in software as we have no\n \t * hardware supporting it today, and no API for it. */\n \n-\tudp_hdr = (struct udp_hdr *)((char *)outer_l3_hdr + outer_l3_len);\n+\tudp_hdr = (struct udp_hdr *)((char *)outer_l3_hdr + info->outer_l3_len);\n \t/* do not recalculate udp cksum if it was 0 */\n \tif (udp_hdr->dgram_cksum != 0) {\n \t\tudp_hdr->dgram_cksum = 0;\n-\t\tif (outer_ethertype == _htons(ETHER_TYPE_IPv4))\n+\t\tif (info->outer_ethertype == _htons(ETHER_TYPE_IPv4))\n \t\t\tudp_hdr->dgram_cksum =\n \t\t\t\trte_ipv4_udptcp_cksum(ipv4_hdr, udp_hdr);\n \t\telse\n@@ -347,14 +362,9 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)\n \tuint16_t i;\n \tuint64_t ol_flags;\n \tuint16_t testpmd_ol_flags;\n-\tuint8_t l4_proto, l4_tun_len = 0;\n-\tuint16_t ethertype = 0, outer_ethertype = 0;\n-\tuint16_t l2_len = 0, l3_len = 0, l4_len = 0;\n-\tuint16_t outer_l2_len = 0, outer_l3_len = 0;\n-\tuint16_t tso_segsz;\n-\tint tunnel = 0;\n \tuint32_t rx_bad_ip_csum;\n \tuint32_t rx_bad_l4_csum;\n+\tstruct testpmd_offload_info info;\n \n #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES\n \tuint64_t start_tsc;\n@@ -381,13 +391,13 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)\n \n \ttxp = &ports[fs->tx_port];\n \ttestpmd_ol_flags = txp->tx_ol_flags;\n-\ttso_segsz = txp->tso_segsz;\n+\tmemset(&info, 0, sizeof(info));\n+\tinfo.tso_segsz = txp->tso_segsz;\n \n \tfor (i = 0; i < nb_rx; i++) {\n \n \t\tol_flags = 0;\n-\t\ttunnel = 0;\n-\t\tl4_tun_len = 0;\n+\t\tinfo.is_tunnel = 0;\n \t\tm = pkts_burst[i];\n \n \t\t/* Update the L3/L4 checksum error packet statistics */\n@@ -398,49 +408,47 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)\n \t\t * and inner headers */\n \n \t\teth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);\n-\t\tparse_ethernet(eth_hdr, &ethertype, &l2_len, &l3_len,\n-\t\t\t&l4_proto, &l4_len);\n-\t\tl3_hdr = (char *)eth_hdr + l2_len;\n+\t\tparse_ethernet(eth_hdr, &info);\n+\t\tl3_hdr = (char *)eth_hdr + info.l2_len;\n \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\tl4_proto == IPPROTO_UDP) {\n-\t\t\tudp_hdr = (struct udp_hdr *)((char *)l3_hdr + l3_len);\n+\t\t\tinfo.l4_proto == IPPROTO_UDP) {\n+\t\t\tudp_hdr = (struct udp_hdr *)((char *)l3_hdr + info.l3_len);\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\tl4_tun_len = ETHER_VXLAN_HLEN;\n-\t\t\t\ttunnel = 1;\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\ttunnel = 1;\n+\t\t\t\tinfo.is_tunnel = 1;\n \n-\t\t\tif (tunnel == 1) {\n-\t\t\t\touter_ethertype = ethertype;\n-\t\t\t\touter_l2_len = l2_len;\n-\t\t\t\touter_l3_len = l3_len;\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, &ethertype, &l2_len,\n-\t\t\t\t\t&l3_len, &l4_proto, &l4_len);\n-\t\t\t\tl3_hdr = (char *)eth_hdr + l2_len;\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}\n \n \t\t/* step 2: change all source IPs (v4 or v6) so we need\n \t\t * to recompute the chksums even if they were correct */\n \n-\t\tchange_ip_addresses(l3_hdr, ethertype);\n-\t\tif (tunnel == 1)\n-\t\t\tchange_ip_addresses(outer_l3_hdr, outer_ethertype);\n+\t\tchange_ip_addresses(l3_hdr, info.ethertype);\n+\t\tif (info.is_tunnel == 1)\n+\t\t\tchange_ip_addresses(outer_l3_hdr, info.outer_ethertype);\n \n \t\t/* step 3: depending on user command line configuration,\n \t\t * recompute checksum either in software or flag the\n@@ -448,25 +456,24 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)\n \t\t * is configured, prepare the mbuf for TCP segmentation. */\n \n \t\t/* process checksums of inner headers first */\n-\t\tol_flags |= process_inner_cksums(l3_hdr, ethertype,\n-\t\t\tl3_len, l4_proto, tso_segsz, testpmd_ol_flags);\n+\t\tol_flags |= process_inner_cksums(l3_hdr, &info, testpmd_ol_flags);\n \n \t\t/* Then process outer headers if any. Note that the software\n \t\t * checksum will be wrong if one of the inner checksums is\n \t\t * processed in hardware. */\n-\t\tif (tunnel == 1) {\n-\t\t\tol_flags |= process_outer_cksums(outer_l3_hdr,\n-\t\t\t\touter_ethertype, outer_l3_len, testpmd_ol_flags);\n+\t\tif (info.is_tunnel == 1) {\n+\t\t\tol_flags |= process_outer_cksums(outer_l3_hdr, &info,\n+\t\t\t\ttestpmd_ol_flags);\n \t\t}\n \n \t\t/* step 4: fill the mbuf meta data (flags and header lengths) */\n \n-\t\tif (tunnel == 1) {\n+\t\tif (info.is_tunnel == 1) {\n \t\t\tif (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM) {\n-\t\t\t\tm->outer_l2_len = outer_l2_len;\n-\t\t\t\tm->outer_l3_len = outer_l3_len;\n-\t\t\t\tm->l2_len = l4_tun_len + l2_len;\n-\t\t\t\tm->l3_len = l3_len;\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->l3_len = info.l3_len;\n \t\t\t}\n \t\t\telse {\n \t\t\t\t/* if there is a outer UDP cksum\n@@ -474,21 +481,22 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)\n \t\t\t\t   the outer checksum will be wrong as\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 = outer_l2_len + outer_l3_len +\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) + l2_len;\n-\t\t\t\tm->l3_len = l3_len;\n-\t\t\t\tm->l4_len = l4_len;\n+\t\t\t\t\tsizeof(struct vxlan_hdr) + 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 \t\t} else {\n \t\t\t/* this is only useful if an offload flag is\n \t\t\t * set, but it does not hurt to fill it in any\n \t\t\t * case */\n-\t\t\tm->l2_len = l2_len;\n-\t\t\tm->l3_len = l3_len;\n-\t\t\tm->l4_len = l4_len;\n+\t\t\tm->l2_len = info.l2_len;\n+\t\t\tm->l3_len = info.l3_len;\n+\t\t\tm->l4_len = info.l4_len;\n \t\t}\n-\t\tm->tso_segsz = tso_segsz;\n+\t\tm->tso_segsz = info.tso_segsz;\n \t\tm->ol_flags = ol_flags;\n \n \t\t/* if verbose mode is enabled, dump debug info */\n@@ -515,27 +523,27 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)\n \t\t\t/* dump rx parsed packet info */\n \t\t\tprintf(\"rx: l2_len=%d ethertype=%x l3_len=%d \"\n \t\t\t\t\"l4_proto=%d l4_len=%d\\n\",\n-\t\t\t\tl2_len, rte_be_to_cpu_16(ethertype),\n-\t\t\t\tl3_len, l4_proto, l4_len);\n-\t\t\tif (tunnel == 1)\n+\t\t\t\tinfo.l2_len, rte_be_to_cpu_16(info.ethertype),\n+\t\t\t\tinfo.l3_len, info.l4_proto, info.l4_len);\n+\t\t\tif (info.is_tunnel == 1)\n \t\t\t\tprintf(\"rx: outer_l2_len=%d outer_ethertype=%x \"\n-\t\t\t\t\t\"outer_l3_len=%d\\n\", outer_l2_len,\n-\t\t\t\t\trte_be_to_cpu_16(outer_ethertype),\n-\t\t\t\t\touter_l3_len);\n+\t\t\t\t\t\"outer_l3_len=%d\\n\", info.outer_l2_len,\n+\t\t\t\t\trte_be_to_cpu_16(info.outer_ethertype),\n+\t\t\t\t\tinfo.outer_l3_len);\n \t\t\t/* dump tx packet info */\n \t\t\tif ((testpmd_ol_flags & (TESTPMD_TX_OFFLOAD_IP_CKSUM |\n \t\t\t\t\t\tTESTPMD_TX_OFFLOAD_UDP_CKSUM |\n \t\t\t\t\t\tTESTPMD_TX_OFFLOAD_TCP_CKSUM |\n \t\t\t\t\t\tTESTPMD_TX_OFFLOAD_SCTP_CKSUM)) ||\n-\t\t\t\ttso_segsz != 0)\n+\t\t\t\tinfo.tso_segsz != 0)\n \t\t\t\tprintf(\"tx: m->l2_len=%d m->l3_len=%d \"\n \t\t\t\t\t\"m->l4_len=%d\\n\",\n \t\t\t\t\tm->l2_len, m->l3_len, m->l4_len);\n-\t\t\tif ((tunnel == 1) &&\n+\t\t\tif ((info.is_tunnel == 1) &&\n \t\t\t\t(testpmd_ol_flags & TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM))\n \t\t\t\tprintf(\"tx: m->outer_l2_len=%d m->outer_l3_len=%d\\n\",\n \t\t\t\t\tm->outer_l2_len, m->outer_l3_len);\n-\t\t\tif (tso_segsz != 0)\n+\t\t\tif (info.tso_segsz != 0)\n \t\t\t\tprintf(\"tx: m->tso_segsz=%d\\n\", m->tso_segsz);\n \t\t\tprintf(\"tx: flags=\");\n \t\t\tfor (j = 0; j < sizeof(tx_flags)/sizeof(*tx_flags); j++) {\n",
    "prefixes": [
        "dpdk-dev",
        "11/20"
    ]
}