patch 'net/i40e: fix risk in descriptor read in scalar Rx' has been queued to stable release 20.11.4
Xueming Li
xuemingl at nvidia.com
Sun Nov 28 15:53:16 CET 2021
Hi,
FYI, your patch has been queued to stable release 20.11.4
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/30/21. 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/steevenlee/dpdk
This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/2f5b7df1e4ce4f3c2d1bc5e41408d5df80401fba
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 2f5b7df1e4ce4f3c2d1bc5e41408d5df80401fba Mon Sep 17 00:00:00 2001
From: Ruifeng Wang <ruifeng.wang at arm.com>
Date: Wed, 15 Sep 2021 16:33:39 +0800
Subject: [PATCH] net/i40e: fix risk in descriptor read in scalar Rx
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit c4d3e8fbe485f244391797f7610512de377675e0 ]
Rx descriptor is 16B/32B in size. If the DD bit is set, it indicates
that the rest of the descriptor words have valid values. Hence, the
word containing DD bit must be read first before reading the rest of
the descriptor words.
Since the entire descriptor is not read atomically, on relaxed memory
ordered systems like Aarch64, read of the word containing DD field
could be reordered after read of other words.
Read barrier is inserted between read of the word with DD field
and read of other words. The barrier ensures that the fetched data
is correct.
Testpmd single core test showed no performance drop on x86 or N1SDP.
On ThunderX2, 22% performance regression was observed.
Fixes: 7b0cf70135d1 ("net/i40e: support ARM platform")
Signed-off-by: Ruifeng Wang <ruifeng.wang at arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli at arm.com>
---
drivers/net/i40e/i40e_rxtx.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 02389905ce..b26bd0640d 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -704,6 +704,12 @@ i40e_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
break;
}
+ /**
+ * Use acquire fence to ensure that qword1 which includes DD
+ * bit is loaded before loading of other descriptor words.
+ */
+ rte_atomic_thread_fence(__ATOMIC_ACQUIRE);
+
rxd = *rxdp;
nb_hold++;
rxe = &sw_ring[rx_id];
@@ -820,6 +826,12 @@ i40e_recv_scattered_pkts(void *rx_queue,
break;
}
+ /**
+ * Use acquire fence to ensure that qword1 which includes DD
+ * bit is loaded before loading of other descriptor words.
+ */
+ rte_atomic_thread_fence(__ATOMIC_ACQUIRE);
+
rxd = *rxdp;
nb_hold++;
rxe = &sw_ring[rx_id];
--
2.34.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2021-11-28 22:41:04.164049443 +0800
+++ 0012-net-i40e-fix-risk-in-descriptor-read-in-scalar-Rx.patch 2021-11-28 22:41:03.220209457 +0800
@@ -1 +1 @@
-From c4d3e8fbe485f244391797f7610512de377675e0 Mon Sep 17 00:00:00 2001
+From 2f5b7df1e4ce4f3c2d1bc5e41408d5df80401fba Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit c4d3e8fbe485f244391797f7610512de377675e0 ]
@@ -23 +25,0 @@
-Cc: stable at dpdk.org
@@ -32 +34 @@
-index 41fe3bf481..e4cb33dc3c 100644
+index 02389905ce..b26bd0640d 100644
@@ -35 +37 @@
-@@ -744,6 +744,12 @@ i40e_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
+@@ -704,6 +704,12 @@ i40e_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
@@ -48 +50 @@
-@@ -860,6 +866,12 @@ i40e_recv_scattered_pkts(void *rx_queue,
+@@ -820,6 +826,12 @@ i40e_recv_scattered_pkts(void *rx_queue,
More information about the stable
mailing list