Skip to contentSkip to conversation

net/ice: fix race condition for multi-cores

PATCH Applied Simei Su 2 participants 2 messages Jun 8, 2022 – Jun 9, 2022 Network drivers

lore
Share & tools
lore

Simei Su

author
#0 lore raw

PATCH 1/1 net/ice: fix race condition for multi-cores

In multi-cores cases for Rx timestamp offload, to avoid phc time being frequently overwritten, move related variables from ice_adapter to ice_rx_queue structure, and each queue will handle timestamp calculation by itself.

Fixes 953e74e6b73a ("net/ice: enable Rx timestamp on flex descriptor")
Fixes 5543827fc6df ("net/ice: improve performance of Rx timestamp offload")
---
 drivers/net/ice/ice_ethdev.h |  3 ---
 drivers/net/ice/ice_rxtx.c   | 48 ++++++++++++++++++++++----------------------
 drivers/net/ice/ice_rxtx.h   |  3 +++
 3 files changed, 27 insertions(+), 27 deletions(-)
drivers/net/ice/ice_ethdev.h +0 -3
index f9f4a1c..c257bb2 100644
@@ -606,9 +606,6 @@ struct ice_adapter {
 	struct rte_timecounter tx_tstamp_tc;
 	bool ptp_ena;
 	uint64_t time_hw;
-	uint32_t hw_time_high; /* high 32 bits of timestamp */
-	uint32_t hw_time_low; /* low 32 bits of timestamp */
-	uint64_t hw_time_update; /* SW time of HW record updating */
 	struct ice_fdir_prof_info fdir_prof_info[ICE_MAX_PTGS];
 	struct ice_rss_prof_info rss_prof_info[ICE_MAX_PTGS];
 	/* True if DCF state of the associated PF is on */
drivers/net/ice/ice_rxtx.c +24 -24

93 lines not on this page · raw message

drivers/net/ice/ice_rxtx.h +3 -0
index bb18a01..f5337d5 100644
@@ -95,6 +95,9 @@ struct ice_rx_queue {
 	uint32_t time_high;
 	uint32_t hw_register_set;
 	const struct rte_memzone *mz;
+	uint32_t hw_time_high; /* high 32 bits of timestamp */
+	uint32_t hw_time_low; /* low 32 bits of timestamp */
+	uint64_t hw_time_update; /* SW time of HW record updating */
 };
 
 struct ice_tx_entry {
Signature · 1 line
2.9.5
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 16 lines

-----Original Message-----
From: Su, Simei <[email protected]>
Sent: Wednesday, June 8, 2022 10:46 AM
To: Zhang, Qi Z <[email protected]>; Yang, Qiming <[email protected]>
Cc: [email protected]; Wu, Wenjun1 <[email protected]>; Su, Simei <[email protected]>; [email protected]
Subject: [PATCH] net/ice: fix race condition for multi-cores

In multi-cores cases for Rx timestamp offload, to avoid phc time being frequently overwritten, move related variables from ice_adapter to ice_rx_queue structure, and each queue will handle timestamp calculation by itself.

Quoted 6 lines
Fixes 953e74e6b73a ("net/ice: enable Rx timestamp on flex descriptor")
Fixes 5543827fc6df ("net/ice: improve performance of Rx timestamp

offload")
Cc: [email protected]

Applied to dpdk-next-net-intel.

Thanks
Qi