patch 'net/dpaa2: fix bitmask truncation' has been queued to stable release 22.11.8
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Mon Feb 17 18:04:46 CET 2025
Hi,
FYI, your patch has been queued to stable release 22.11.8
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/19/25. 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/ef323a819f075cdd4b679dd683d4399278371f98
Thanks.
Luca Boccassi
---
>From ef323a819f075cdd4b679dd683d4399278371f98 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Wed, 5 Feb 2025 08:23:17 -0800
Subject: [PATCH] net/dpaa2: fix bitmask truncation
[ upstream commit e4591c38b50e23fc6ac6b73803e78d49142ecf57 ]
The dqrr_held mask is 64 bit but updates were getting truncated
because 1 is of type int (32 bit) and the result shift of int is of
type int (32 bit); therefore any value >= 32 would get truncated.
Link: https://pvs-studio.com/en/blog/posts/cpp/1183/
Fixes: 2d3788631862 ("net/dpaa2: support atomic queues")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal at nxp.com>
---
drivers/net/dpaa2/dpaa2_rxtx.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index 85910bbd8f..a9de1c9f99 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -924,7 +924,7 @@ dpaa2_dev_process_atomic_event(struct qbman_swp *swp __rte_unused,
dqrr_index = qbman_get_dqrr_idx(dq);
*dpaa2_seqn(ev->mbuf) = dqrr_index + 1;
DPAA2_PER_LCORE_DQRR_SIZE++;
- DPAA2_PER_LCORE_DQRR_HELD |= 1 << dqrr_index;
+ DPAA2_PER_LCORE_DQRR_HELD |= UINT64_C(1) << dqrr_index;
DPAA2_PER_LCORE_DQRR_MBUF(dqrr_index) = ev->mbuf;
}
@@ -1305,7 +1305,7 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
flags[loop] = QBMAN_ENQUEUE_FLAG_DCA |
dqrr_index;
DPAA2_PER_LCORE_DQRR_SIZE--;
- DPAA2_PER_LCORE_DQRR_HELD &= ~(1 << dqrr_index);
+ DPAA2_PER_LCORE_DQRR_HELD &= ~(UINT64_C(1) << dqrr_index);
*dpaa2_seqn(*bufs) = DPAA2_INVALID_MBUF_SEQN;
}
@@ -1544,7 +1544,7 @@ dpaa2_set_enqueue_descriptor(struct dpaa2_queue *dpaa2_q,
dq_idx = *dpaa2_seqn(m) - 1;
qbman_eq_desc_set_dca(eqdesc, 1, dq_idx, 0);
DPAA2_PER_LCORE_DQRR_SIZE--;
- DPAA2_PER_LCORE_DQRR_HELD &= ~(1 << dq_idx);
+ DPAA2_PER_LCORE_DQRR_HELD &= ~(UINT64_C(1) << dq_idx);
}
*dpaa2_seqn(m) = DPAA2_INVALID_MBUF_SEQN;
}
--
2.47.2
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-02-17 16:13:19.400175541 +0000
+++ 0073-net-dpaa2-fix-bitmask-truncation.patch 2025-02-17 16:13:16.870441592 +0000
@@ -1 +1 @@
-From e4591c38b50e23fc6ac6b73803e78d49142ecf57 Mon Sep 17 00:00:00 2001
+From ef323a819f075cdd4b679dd683d4399278371f98 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e4591c38b50e23fc6ac6b73803e78d49142ecf57 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -22 +23 @@
-index bfb5542bbc..cad15d8f75 100644
+index 85910bbd8f..a9de1c9f99 100644
@@ -25 +26 @@
-@@ -933,7 +933,7 @@ dpaa2_dev_process_atomic_event(struct qbman_swp *swp __rte_unused,
+@@ -924,7 +924,7 @@ dpaa2_dev_process_atomic_event(struct qbman_swp *swp __rte_unused,
@@ -34 +35 @@
-@@ -1317,7 +1317,7 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
+@@ -1305,7 +1305,7 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
@@ -43 +44 @@
-@@ -1575,7 +1575,7 @@ dpaa2_set_enqueue_descriptor(struct dpaa2_queue *dpaa2_q,
+@@ -1544,7 +1544,7 @@ dpaa2_set_enqueue_descriptor(struct dpaa2_queue *dpaa2_q,
More information about the stable
mailing list