Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/75618/?format=api
http://patches.dpdk.org/api/patches/75618/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200818120254.72792-4-huwei013@chinasoftinc.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": "<20200818120254.72792-4-huwei013@chinasoftinc.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200818120254.72792-4-huwei013@chinasoftinc.com", "date": "2020-08-18T12:02:53", "name": "[3/4] app/testpmd: fix packet header in txonly mode", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "88104f50daec66d75baa8c372126ffbff992d4e3", "submitter": { "id": 1537, "url": "http://patches.dpdk.org/api/people/1537/?format=api", "name": "Wei Hu (Xavier)", "email": "huwei013@chinasoftinc.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/20200818120254.72792-4-huwei013@chinasoftinc.com/mbox/", "series": [ { "id": 11684, "url": "http://patches.dpdk.org/api/series/11684/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11684", "date": "2020-08-18T12:02:50", "name": "minor fixes for testpmd", "version": 1, "mbox": "http://patches.dpdk.org/series/11684/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/75618/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/75618/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 698A0A034C;\n\tTue, 18 Aug 2020 14:03:44 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id A1FA71C0BD;\n\tTue, 18 Aug 2020 14:03:30 +0200 (CEST)", "from mail.chinasoftinc.com (unknown [114.113.233.8])\n by dpdk.org (Postfix) with ESMTP id E727E1C014\n for <dev@dpdk.org>; Tue, 18 Aug 2020 14:03:14 +0200 (CEST)", "from localhost.localdomain (120.133.139.157) by INCCAS001.ito.icss\n (10.168.0.60) with Microsoft SMTP Server id 14.3.487.0; Tue, 18 Aug 2020\n 20:03:02 +0800" ], "From": "\"Wei Hu (Xavier)\" <huwei013@chinasoftinc.com>", "To": "Wenzhuo Lu <wenzhuo.lu@intel.com>, Beilei Xing <beilei.xing@intel.com>,\n Bernard Iremonger <bernard.iremonger@intel.com>, Yongseok Koh\n <yskoh@mellanox.com>, Pablo de Lara <pablo.de.lara.guarch@intel.com>,\n Konstantin Ananyev <konstantin.ananyev@intel.com>", "CC": "<dev@dpdk.org>, <xavier.huwei@huawei.com>", "Date": "Tue, 18 Aug 2020 20:02:53 +0800", "Message-ID": "<20200818120254.72792-4-huwei013@chinasoftinc.com>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20200818120254.72792-1-huwei013@chinasoftinc.com>", "References": "<20200818120254.72792-1-huwei013@chinasoftinc.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Originating-IP": "[120.133.139.157]", "Subject": "[dpdk-dev] [PATCH 3/4] app/testpmd: fix packet header in txonly mode", "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: Chengchang Tang <tangchengchang@huawei.com>\n\nIn txonly forward mode, the packet header is fixed by the initial\nsetting, including the packet length and checksum. So when the packets\nvaries, this may cause a packet header error. Currently, there are two\nmethods in txonly mode to randomly change the packets.\n1. Set txsplit random and txpkts (x[,y]*), the number of segments\n each packets will be a random value between 1 and total number of\n segments determined by txpkts settings.\n The step as follows:\n a) ./testpmd -w xxx -l xx -n 4 -- -i --rxd xxxx --txd xxxx\n b) set fwd txonly\n c) set txsplit rand\n d) set txpkts 2048,2048,2048,2048\n e) start\nThe nb_segs of the packets sent by testpmd will be 1~4. The real packet\nlength will be 2048, 4096, 6144 and 8192. But in fact the packet length\nin ip header and udp header will be fixed by 8178 and 8158.\n\n2. Set txonly-multi-flow. the ip address will be varied to generate\n multiple flow.\n The step as follows:\n a) ./testpmd -w xxx -l xx -n 4 -- -i --txonly-multi-flow\n b) set fwd txonly\n c) start\nThe ip address of each pkts will change randomly, but since the header\nis fixed, the checksum may be a error value.\n\nTherefore, this patch adds a funciton to update the packet length and\ncheck sum in the pkts header when the txsplit mode is setted to rand or\nmulti-flow is setted.\n\nFixes: 82010ef55e7c (\"app/testpmd: make txonly mode generate multiple flows\")\nFixes: 79bec05b32b7 (\"app/testpmd: add ability to split outgoing packets\")\nCc: stable@dpdk.org\n\nSigned-off-by: Chengchang Tang <tangchengchang@huawei.com>\nSigned-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>\n---\n app/test-pmd/txonly.c | 32 ++++++++++++++++++++++++++++++++\n 1 file changed, 32 insertions(+)", "diff": "diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c\nindex 3bae367ee..ad3b0a765 100644\n--- a/app/test-pmd/txonly.c\n+++ b/app/test-pmd/txonly.c\n@@ -156,6 +156,34 @@ setup_pkt_udp_ip_headers(struct rte_ipv4_hdr *ip_hdr,\n \tip_hdr->hdr_checksum = (uint16_t) ip_cksum;\n }\n \n+static inline void\n+update_pkt_header(struct rte_mbuf *pkt, uint32_t total_pkt_len)\n+{\n+\tstruct rte_ipv4_hdr *ip_hdr;\n+\tstruct rte_udp_hdr *udp_hdr;\n+\tuint16_t pkt_data_len;\n+\tuint16_t pkt_len;\n+\n+\tpkt_data_len = (uint16_t) (total_pkt_len - (\n+\t\t\t\t\tsizeof(struct rte_ether_hdr) +\n+\t\t\t\t\tsizeof(struct rte_ipv4_hdr) +\n+\t\t\t\t\tsizeof(struct rte_udp_hdr)));\n+\t/* updata udp pkt length */\n+\tudp_hdr = rte_pktmbuf_mtod_offset(pkt, struct rte_udp_hdr *,\n+\t\t\t\tsizeof(struct rte_ether_hdr) +\n+\t\t\t\tsizeof(struct rte_ipv4_hdr));\n+\tpkt_len = (uint16_t) (pkt_data_len + sizeof(struct rte_udp_hdr));\n+\tudp_hdr->dgram_len = RTE_CPU_TO_BE_16(pkt_len);\n+\n+\t/* updata ip pkt length and csum */\n+\tip_hdr = rte_pktmbuf_mtod_offset(pkt, struct rte_ipv4_hdr *,\n+\t\t\t\tsizeof(struct rte_ether_hdr));\n+\tip_hdr->hdr_checksum = 0;\n+\tpkt_len = (uint16_t) (pkt_len + sizeof(struct rte_ipv4_hdr));\n+\tip_hdr->total_length = RTE_CPU_TO_BE_16(pkt_len);\n+\tip_hdr->hdr_checksum = rte_ipv4_cksum(ip_hdr);\n+}\n+\n static inline bool\n pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp,\n \t\tstruct rte_ether_hdr *eth_hdr, const uint16_t vlan_tci,\n@@ -223,6 +251,10 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp,\n \tcopy_buf_to_pkt(&pkt_udp_hdr, sizeof(pkt_udp_hdr), pkt,\n \t\t\tsizeof(struct rte_ether_hdr) +\n \t\t\tsizeof(struct rte_ipv4_hdr));\n+\n+\tif (unlikely(tx_pkt_split == TX_PKT_SPLIT_RND) || txonly_multi_flow)\n+\t\tupdate_pkt_header(pkt, pkt_len);\n+\n \tif (unlikely(timestamp_enable)) {\n \t\tuint64_t skew = RTE_PER_LCORE(timestamp_qskew);\n \t\tstruct {\n", "prefixes": [ "3/4" ] }{ "id": 75618, "url": "