patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 23.11] net/hns3: fix atomic API usage for LTS compatibility
@ 2025-12-16 11:54 Shani Peretz
  2025-12-16 12:54 ` Kevin Traynor
  0 siblings, 1 reply; 2+ messages in thread
From: Shani Peretz @ 2025-12-16 11:54 UTC (permalink / raw)
  To: stable; +Cc: ktraynor, Shani Peretz, huangdengdui, Jie Hai, Yisen Zhuang

The rte_atomic_load_explicit() API requires the variable to be
declared with RTE_ATOMIC() type. However, hw->reset.resetting is
declared as plain uint16_t, causing a compilation error with clang.

Revert to using __atomic_load_n() which is consistent with all other
atomic operations on the resetting field in this driver.

Fixes: 280d641cf8d8 ("net/hns3: fix resources release on reset")
Cc: huangdengdui@huawei.com

Signed-off-by: Shani Peretz <shperetz@nvidia.com>
---
 drivers/net/hns3/hns3_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index c82d7d84cb..c20a65ca8e 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -5230,7 +5230,7 @@ hns3_dev_stop(struct rte_eth_dev *dev)
 	struct hns3_hw *hw = &hns->hw;
 
 	PMD_INIT_FUNC_TRACE();
-	if (rte_atomic_load_explicit(&hw->reset.resetting, rte_memory_order_relaxed) != 0) {
+	if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) != 0) {
 		hns3_warn(hw, "device is resetting, stop operation is not allowed.");
 		return -EBUSY;
 	}
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 23.11] net/hns3: fix atomic API usage for LTS compatibility
  2025-12-16 11:54 [PATCH 23.11] net/hns3: fix atomic API usage for LTS compatibility Shani Peretz
@ 2025-12-16 12:54 ` Kevin Traynor
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Traynor @ 2025-12-16 12:54 UTC (permalink / raw)
  To: Shani Peretz, stable; +Cc: huangdengdui, Jie Hai, Yisen Zhuang

On 16/12/2025 11:54, Shani Peretz wrote:
> The rte_atomic_load_explicit() API requires the variable to be
> declared with RTE_ATOMIC() type. However, hw->reset.resetting is
> declared as plain uint16_t, causing a compilation error with clang.
> 
> Revert to using __atomic_load_n() which is consistent with all other
> atomic operations on the resetting field in this driver.
> 
> Fixes: 280d641cf8d8 ("net/hns3: fix resources release on reset")
> Cc: huangdengdui@huawei.com
> 
> Signed-off-by: Shani Peretz <shperetz@nvidia.com>
> ---
>  drivers/net/hns3/hns3_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
> index c82d7d84cb..c20a65ca8e 100644
> --- a/drivers/net/hns3/hns3_ethdev.c
> +++ b/drivers/net/hns3/hns3_ethdev.c
> @@ -5230,7 +5230,7 @@ hns3_dev_stop(struct rte_eth_dev *dev)
>  	struct hns3_hw *hw = &hns->hw;
>  
>  	PMD_INIT_FUNC_TRACE();
> -	if (rte_atomic_load_explicit(&hw->reset.resetting, rte_memory_order_relaxed) != 0) {
> +	if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) != 0) {
>  		hns3_warn(hw, "device is resetting, stop operation is not allowed.");
>  		return -EBUSY;
>  	}

Acked-by: Kevin Traynor <ktraynor@redhat.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-12-16 12:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-16 11:54 [PATCH 23.11] net/hns3: fix atomic API usage for LTS compatibility Shani Peretz
2025-12-16 12:54 ` Kevin Traynor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).