> -----Original Message-----
> From: Naga Harish K, S V <s.v.naga.haris...@intel.com>
> Sent: Tuesday, July 26, 2022 9:52 AM
> To: Jayatheerthan, Jay <jay.jayatheert...@intel.com>; jer...@marvell.com
> Cc: dev@dpdk.org; sta...@dpdk.org
> Subject: [PATCH 1/2] eventdev/eth_tx: add spinlock for adapter start/stop
> 
> add spinlock protection for tx adapter stop and start APIs
> add null check for tx adapter service pointer in adapter start/stop apis.
> 
> Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation")
> Cc: sta...@dpdk.org
> 
> Signed-off-by: Naga Harish K S V <s.v.naga.haris...@intel.com>
> ---
>  lib/eventdev/rte_event_eth_tx_adapter.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c 
> b/lib/eventdev/rte_event_eth_tx_adapter.c
> index a237e8edba..3251dad61f 100644
> --- a/lib/eventdev/rte_event_eth_tx_adapter.c
> +++ b/lib/eventdev/rte_event_eth_tx_adapter.c
> @@ -44,7 +44,7 @@
>  #define RTE_EVENT_ETH_TX_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) \
>  do { \
>       if (!txa_valid_id(id)) { \
> -             RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d", id); \
> +             RTE_EDEV_LOG_ERR("Invalid eth Tx adapter id = %d", id); \
>               return retval; \
>       } \
>  } while (0)
> @@ -468,10 +468,13 @@ txa_service_ctrl(uint8_t id, int start)
>       struct txa_service_data *txa;
> 
>       txa = txa_service_id_to_data(id);
> -     if (txa->service_id == TXA_INVALID_SERVICE_ID)
> +     if (txa == NULL || txa->service_id == TXA_INVALID_SERVICE_ID)
>               return 0;
> 
> +     rte_spinlock_lock(&txa->tx_lock);
>       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();
> --
> 2.23.0

There are three different changes in this patch. But since they are quite 
small, it should be ok.

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

Reply via email to