patch 'baseband/fpga_5gnr_fec: use a better random generator' has been queued to stable release 22.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Mar 14 01:09:53 CET 2024


Hi,

FYI, your patch has been queued to stable release 22.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/16/24. 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://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/bd47e113a2b12529ab0b8b46824980d9f90e1ad2

Thanks.

Luca Boccassi

---
>From bd47e113a2b12529ab0b8b46824980d9f90e1ad2 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Fri, 1 Mar 2024 09:57:11 -0800
Subject: [PATCH] baseband/fpga_5gnr_fec: use a better random generator

[ upstream commit dd329b2cc53dd61156b0227b0b858f9b17215574 ]

The function rand is very weak and should not be used.
Use the DPDK rte_rand() which is seeded from entropy instead.

Coverity issue: 414987
Fixes: b3d326e438f1 ("baseband/fpga_5gnr_fec: add FPGA mutex")

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Reviewed-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
Acked-by: Nicolas Chautru <nicolas.chautru at intel.com>
---
 drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c
index 0dfeba08e1..171aed4d86 100644
--- a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c
+++ b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c
@@ -16,6 +16,7 @@
 #ifdef RTE_BBDEV_OFFLOAD_COST
 #include <rte_cycles.h>
 #endif
+#include <rte_random.h>
 
 #include <rte_bbdev.h>
 #include <rte_bbdev_pmd.h>
@@ -1502,7 +1503,7 @@ fpga_mutex_acquisition(struct fpga_queue *q)
 {
 	uint32_t mutex_ctrl, mutex_read, cnt = 0;
 	/* Assign a unique id for the duration of the DDR access */
-	q->ddr_mutex_uuid = rand();
+	q->ddr_mutex_uuid = rte_rand();
 	/* Request and wait for acquisition of the mutex */
 	mutex_ctrl = (q->ddr_mutex_uuid << 16) + 1;
 	do {
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-14 00:09:23.273972879 +0000
+++ 0057-baseband-fpga_5gnr_fec-use-a-better-random-generator.patch	2024-03-14 00:09:20.713617206 +0000
@@ -1 +1 @@
-From dd329b2cc53dd61156b0227b0b858f9b17215574 Mon Sep 17 00:00:00 2001
+From bd47e113a2b12529ab0b8b46824980d9f90e1ad2 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit dd329b2cc53dd61156b0227b0b858f9b17215574 ]
+
@@ -20 +22 @@
-index efc1d3a772..9b253cde28 100644
+index 0dfeba08e1..171aed4d86 100644
@@ -23,3 +25,2 @@
-@@ -14,6 +14,7 @@
- #include <bus_pci_driver.h>
- #include <rte_byteorder.h>
+@@ -16,6 +16,7 @@
+ #ifdef RTE_BBDEV_OFFLOAD_COST
@@ -26,0 +28 @@
+ #endif
@@ -31 +33 @@
-@@ -1990,7 +1991,7 @@ fpga_5gnr_mutex_acquisition(struct fpga_5gnr_queue *q)
+@@ -1502,7 +1503,7 @@ fpga_mutex_acquisition(struct fpga_queue *q)


More information about the stable mailing list