patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Wisam Jaddo <wisamm@nvidia.com>
To: <arybchenko@solarflare.com>, <thomas@monjalon.net>,
	<akozyrev@nvidia.com>,  <rasland@nvidia.com>, <dev@dpdk.org>
Cc: <wisamm@mellanox.com>, <stable@dpdk.org>
Subject: [dpdk-stable] [PATCH v3 5/7] app/flow-perf: fix the incremental IPv6 src set
Date: Wed, 10 Mar 2021 15:55:44 +0200	[thread overview]
Message-ID: <20210310135546.8680-6-wisamm@nvidia.com> (raw)
In-Reply-To: <20210310135546.8680-1-wisamm@nvidia.com>

Currently the memset() will not set a correct src ip that represent
the incremental value of the counter.

This commit will fix this and each flow will have correct IPv6.src
that it's incremental from previous flow and equal to the decimal
values.

Fixes: bf3688f1e816 ("app/flow-perf: add insertion rate calculation")
Cc: wisamm@mellanox.com
Cc: stable@dpdk.org

Signed-off-by: Wisam Jaddo <wisamm@nvidia.com>
---
 app/test-flow-perf/items_gen.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/app/test-flow-perf/items_gen.c b/app/test-flow-perf/items_gen.c
index ccebc08b39..a73de9031f 100644
--- a/app/test-flow-perf/items_gen.c
+++ b/app/test-flow-perf/items_gen.c
@@ -72,14 +72,15 @@ add_ipv6(struct rte_flow_item *items,
 	static struct rte_flow_item_ipv6 ipv6_specs[RTE_MAX_LCORE] __rte_cache_aligned;
 	static struct rte_flow_item_ipv6 ipv6_masks[RTE_MAX_LCORE] __rte_cache_aligned;
 	uint8_t ti = para.core_idx;
+	uint8_t i;
 
 	/** Set ipv6 src **/
-	memset(&ipv6_specs[ti].hdr.src_addr, para.src_ip,
-		sizeof(ipv6_specs->hdr.src_addr) / 2);
-
-	/** Full mask **/
-	memset(&ipv6_masks[ti].hdr.src_addr, 0xff,
-		sizeof(ipv6_specs->hdr.src_addr));
+	for (i = 0; i < 16; i++) {
+		/* Currently src_ip is limited to 32 bit */
+		if (i < 4)
+			ipv6_specs[ti].hdr.src_addr[15 - i] = para.src_ip >> (i * 8);
+		ipv6_masks[ti].hdr.src_addr[15 - i] = 0xff;
+	}
 
 	items[items_counter].type = RTE_FLOW_ITEM_TYPE_IPV6;
 	items[items_counter].spec = &ipv6_specs[ti];
-- 
2.17.1


  parent reply	other threads:[~2021-03-10 13:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210310134858.8104-2-wisamm@nvidia.com>
     [not found] ` <20210310135353.8429-1-wisamm@nvidia.com>
2021-03-10 13:53   ` [dpdk-stable] [PATCH v3 4/7] app/flow-perf: fix report total stats for masked ports Wisam Jaddo
2021-03-10 13:53   ` [dpdk-stable] [PATCH v3 5/7] app/flow-perf: fix the incremental IPv6 src set Wisam Jaddo
     [not found] ` <20210310135546.8680-1-wisamm@nvidia.com>
2021-03-10 13:55   ` [dpdk-stable] [PATCH v3 4/7] app/flow-perf: fix report total stats for masked ports Wisam Jaddo
2021-03-10 13:55   ` Wisam Jaddo [this message]
2021-03-10 13:55   ` [dpdk-stable] [PATCH v3 7/7] app/flow-perf: fix setting decap data for decap actions Wisam Jaddo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210310135546.8680-6-wisamm@nvidia.com \
    --to=wisamm@nvidia.com \
    --cc=akozyrev@nvidia.com \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=wisamm@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).