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 v2 5/7] app/flow-perf: fix the incremental IPv6 src set
Date: Wed, 10 Mar 2021 15:48:56 +0200
Message-ID: <20210310134858.8104-6-wisamm@nvidia.com> (raw)
In-Reply-To: <20210310134858.8104-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:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210307091202.586-2-wisamm@nvidia.com>
     [not found] ` <20210310134554.7948-1-wisamm@nvidia.com>
2021-03-10 13:45   ` [dpdk-stable] [PATCH v2 4/7] app/flow-perf: fix report total stats for masked ports Wisam Jaddo
2021-03-10 13:45   ` [dpdk-stable] [PATCH v2 5/7] app/flow-perf: fix the incremental IPv6 src set Wisam Jaddo
     [not found] ` <20210310134858.8104-1-wisamm@nvidia.com>
2021-03-10 13:48   ` [dpdk-stable] [PATCH v2 4/7] app/flow-perf: fix report total stats for masked ports Wisam Jaddo
2021-03-10 13:48   ` Wisam Jaddo [this message]
2021-03-10 13:48   ` [dpdk-stable] [PATCH v2 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=20210310134858.8104-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

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git