[2/2] eventdev/eth_tx: fix adapter stop

Message ID 20220726042211.1018326-2-s.v.naga.harish.k@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series [1/2] eventdev/eth_tx: add spinlock for adapter start/stop |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS

Commit Message

Naga Harish K, S V July 26, 2022, 4:22 a.m. UTC
  adapter_stop function is stopping the adapter service using
rte_service_runstate_set() api and waiting until
rte_service_may_be_active() api returns stopped state in an
infinite loop.

This results in hang issues if application calls
rte_service_lcore_stop() before adapter stop.

remove the state check after setting the service state which
avoids running into hang issues. This also makes tx adapter stop
inline with remaining adapters.

Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation")
Cc: stable@dpdk.org

Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
---
 lib/eventdev/rte_event_eth_tx_adapter.c | 4 ----
 1 file changed, 4 deletions(-)
  

Comments

Jayatheerthan, Jay Aug. 1, 2022, 6:54 a.m. UTC | #1
> -----Original Message-----
> From: Naga Harish K, S V <s.v.naga.harish.k@intel.com>
> Sent: Tuesday, July 26, 2022 9:52 AM
> To: Jayatheerthan, Jay <jay.jayatheerthan@intel.com>; jerinj@marvell.com
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH 2/2] eventdev/eth_tx: fix adapter stop
> 
> adapter_stop function is stopping the adapter service using
> rte_service_runstate_set() api and waiting until
> rte_service_may_be_active() api returns stopped state in an
> infinite loop.
> 
> This results in hang issues if application calls
> rte_service_lcore_stop() before adapter stop.
> 
> remove the state check after setting the service state which
> avoids running into hang issues. This also makes tx adapter stop
> inline with remaining adapters.
> 
> Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
> ---
>  lib/eventdev/rte_event_eth_tx_adapter.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_event_eth_tx_adapter.c
> index 3251dad61f..41509ba750 100644
> --- a/lib/eventdev/rte_event_eth_tx_adapter.c
> +++ b/lib/eventdev/rte_event_eth_tx_adapter.c
> @@ -475,10 +475,6 @@ txa_service_ctrl(uint8_t id, int start)
>  	ret = rte_service_runstate_set(txa->service_id, start);
>  	rte_spinlock_unlock(&txa->tx_lock);
> 
> -	if (ret == 0 && !start) {
> -		while (rte_service_may_be_active(txa->service_id))
> -			rte_pause();
> -	}
>  	return ret;
>  }
> 
> --
> 2.23.0

Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
  

Patch

diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_event_eth_tx_adapter.c
index 3251dad61f..41509ba750 100644
--- a/lib/eventdev/rte_event_eth_tx_adapter.c
+++ b/lib/eventdev/rte_event_eth_tx_adapter.c
@@ -475,10 +475,6 @@  txa_service_ctrl(uint8_t id, int start)
 	ret = rte_service_runstate_set(txa->service_id, start);
 	rte_spinlock_unlock(&txa->tx_lock);
 
-	if (ret == 0 && !start) {
-		while (rte_service_may_be_active(txa->service_id))
-			rte_pause();
-	}
 	return ret;
 }