[PATCH 4/5] net/hns3: fix TM thread safety risk

Stephen Hemminger stephen at networkplumber.org
Sat Aug 5 17:58:25 CEST 2023


On Sat, 5 Aug 2023 16:36:26 +0800
Dongdong Liu <liudongdong3 at huawei.com> wrote:

> From: Chengwen Feng <fengchengwen at huawei.com>
> 
> The driver-related TM (traffic management) info is implemented through
> the linked list. The following threads are involved in the read and
> write of the TM info:
> 
> 1. main thread: invokes the rte_tm_xxx() API family to modify or read.
> 2. interrupt thread: will read TM info in reset recover process.
> 3. telemetry/proc-info thread: invoke rte_eth_dev_priv_dump() API to
>    read TM info.
> 
> Currently, thread safety protection of TM info is implemented only in
> the following operations:
> 1. some of the rte_tm_xxx() API's implementation.
> 2. reset recover process.
> 
> Thread safety risks may exist in other scenarios, so fix by:
> 1. make sure all the rte_tm_xxx() API's implementations protected by
>    hw.lock.
> 2. make sure rte_eth_dev_priv_dump() API's implementation protected
>    by hw.lock.
> 
> Fixes: c09c7847d892 ("net/hns3: support traffic management")
> Fixes: e4cfe6bb9114 ("net/hns3: dump TM configuration info")
> Cc: stable at dpdk.org

I hope no locking is necessary in the data path.


More information about the stable mailing list