From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 61DA4A051C; Sun, 9 Feb 2020 18:02:46 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8615B1BF75; Sun, 9 Feb 2020 18:02:44 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 1F95E1BF54 for ; Sun, 9 Feb 2020 18:02:42 +0100 (CET) Received: from Internal Mail-Server by MTLPINE2 (envelope-from viacheslavo@mellanox.com) with ESMTPS (AES256-SHA encrypted); 9 Feb 2020 19:02:42 +0200 Received: from pegasus12.mtr.labs.mlnx (pegasus12.mtr.labs.mlnx [10.210.17.40]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 019H2gfs016170; Sun, 9 Feb 2020 19:02:42 +0200 Received: from pegasus12.mtr.labs.mlnx (localhost [127.0.0.1]) by pegasus12.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id 019H2gdJ000740; Sun, 9 Feb 2020 17:02:42 GMT Received: (from viacheslavo@localhost) by pegasus12.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id 019H2ewb000739; Sun, 9 Feb 2020 17:02:40 GMT X-Authentication-Warning: pegasus12.mtr.labs.mlnx: viacheslavo set sender to viacheslavo@mellanox.com using -f From: Viacheslav Ovsiienko To: dev@dpdk.org Cc: thomas@monjalon.net, bernard.iremonger@intel.com, ferruh.yigit@intel.com, stable@dpdk.org Date: Sun, 9 Feb 2020 17:02:39 +0000 Message-Id: <1581267759-698-1-git-send-email-viacheslavo@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] app/testpmd: fix txonly flow generation entropy X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The testpmd application in txonly forwarding mode has an option to generate the packet flows by varying the destination IP address. The patch increments the IP for each packet sent, this improves the entropy and RSS distibution on the peer receiving size is getting more uniform. Fixes: 82010ef55e7c ("app/testpmd: make txonly mode generate multiple flows") Cc: stable@dpdk.org Signed-off-by: Viacheslav Ovsiienko --- app/test-pmd/txonly.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c index 4b5bec4..8a1989f 100644 --- a/app/test-pmd/txonly.c +++ b/app/test-pmd/txonly.c @@ -153,7 +153,6 @@ const uint16_t vlan_tci_outer, const uint64_t ol_flags) { struct rte_mbuf *pkt_segs[RTE_MAX_SEGS_PER_PKT]; - uint8_t ip_var = RTE_PER_LCORE(_ip_var); struct rte_mbuf *pkt_seg; uint32_t nb_segs, pkt_len; uint8_t i; @@ -193,6 +192,7 @@ copy_buf_to_pkt(&pkt_ip_hdr, sizeof(pkt_ip_hdr), pkt, sizeof(struct rte_ether_hdr)); if (txonly_multi_flow) { + uint8_t ip_var = RTE_PER_LCORE(_ip_var); struct rte_ipv4_hdr *ip_hdr; uint32_t addr; @@ -208,6 +208,7 @@ */ addr = (tx_ip_dst_addr | (ip_var++ << 8)) + rte_lcore_id(); ip_hdr->src_addr = rte_cpu_to_be_32(addr); + RTE_PER_LCORE(_ip_var) = ip_var; } copy_buf_to_pkt(&pkt_udp_hdr, sizeof(pkt_udp_hdr), pkt, sizeof(struct rte_ether_hdr) + @@ -315,7 +316,7 @@ fs->tx_packets += nb_tx; if (txonly_multi_flow) - RTE_PER_LCORE(_ip_var) += nb_tx; + RTE_PER_LCORE(_ip_var) -= nb_pkt - nb_tx; #ifdef RTE_TEST_PMD_RECORD_BURST_STATS fs->tx_burst_stats.pkt_burst_spread[nb_tx]++; -- 1.8.3.1