patch 'member: fix PRNG seed reset in NitroSketch mode' has been queued to stable release 22.11.3

Xueming Li xuemingl at nvidia.com
Thu Aug 10 01:58:37 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=d5309394d17fc695506b4bb44b9d5dbe1263ac0b

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From d5309394d17fc695506b4bb44b9d5dbe1263ac0b Mon Sep 17 00:00:00 2001
From: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
Date: Wed, 21 Jun 2023 00:17:20 +0300
Subject: [PATCH] member: fix PRNG seed reset in NitroSketch mode
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit ed9e8206e19648028774fcd16b9ceadb8ab79f04 ]

Sketch creation seeded the global PRNG
using the supplied seed for hashing.
The use of this seed by SKETCH set summary was not documented.
SKETCH set summary does not require two independent hash seeds,
unlike other set summary types.
Seeding the global PRNG at sketch creation
does not make the sketch operation deterministic:
it uses rte_rand() later, the PRNG may be seeded again by that point.
On the other hand, seeding the global PRNG with a hash seed,
is likely undesired, because it may be low-entropy or even constant.
Deterministic operation can be achieved by seeding the PRNG externally.

Remove the call to rte_srand() at sketch creation.
Document that hash seeds are not used by SKETCH set summary type.

Fixes: db354bd2e1f8 ("member: add NitroSketch mode")

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
Acked-by: Stephen Hemminger <stephen at networkplumber.org>
---
 lib/member/rte_member.h        | 1 +
 lib/member/rte_member_sketch.c | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/member/rte_member.h b/lib/member/rte_member.h
index 072a253c89..d08b143e51 100644
--- a/lib/member/rte_member.h
+++ b/lib/member/rte_member.h
@@ -314,6 +314,7 @@ struct rte_member_parameters {
 	 * for bucket location.
 	 * For vBF type, these two hashes and their combinations are used as
 	 * hash locations to index the bit array.
+	 * For Sketch type, these seeds are not used.
 	 */
 	uint32_t prim_hash_seed;
 
diff --git a/lib/member/rte_member_sketch.c b/lib/member/rte_member_sketch.c
index 524ba77620..d5f35aabe9 100644
--- a/lib/member/rte_member_sketch.c
+++ b/lib/member/rte_member_sketch.c
@@ -227,7 +227,6 @@ rte_member_create_sketch(struct rte_member_setsum *ss,
 		goto error_runtime;
 	}
 
-	rte_srand(ss->prim_hash_seed);
 	for (i = 0; i < ss->num_row; i++)
 		ss->hash_seeds[i] = rte_rand();
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-08-09 21:51:19.670244300 +0800
+++ 0058-member-fix-PRNG-seed-reset-in-NitroSketch-mode.patch	2023-08-09 21:51:18.204352000 +0800
@@ -1 +1 @@
-From ed9e8206e19648028774fcd16b9ceadb8ab79f04 Mon Sep 17 00:00:00 2001
+From d5309394d17fc695506b4bb44b9d5dbe1263ac0b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit ed9e8206e19648028774fcd16b9ceadb8ab79f04 ]
@@ -22 +24,0 @@
-Cc: stable at dpdk.org
@@ -32 +34 @@
-index 237d403714..a15e0d69e6 100644
+index 072a253c89..d08b143e51 100644
@@ -35 +37 @@
-@@ -313,6 +313,7 @@ struct rte_member_parameters {
+@@ -314,6 +314,7 @@ struct rte_member_parameters {


More information about the stable mailing list