[PATCH 20.11] net/hns3: fix traffic management thread safety

Kevin Traynor ktraynor at redhat.com
Thu Nov 23 11:49:16 CET 2023


On 16/11/2023 12:34, Chengwen Feng wrote:
> [ upstream commit 69901040975bff8a38edfc47aee727cadc87d356 ]
> 
> 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.
> 
> 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 make sure
> all the rte_tm_xxx() API's implementations protected by hw.lock.
> 
> Fixes: c09c7847d892 ("net/hns3: support traffic management")
> 
> Signed-off-by: Chengwen Feng<fengchengwen at huawei.com>
> Signed-off-by: Dongdong Liu<liudongdong3 at huawei.com>
> ---
>   drivers/net/hns3/hns3_tm.c | 173 ++++++++++++++++++++++++++++++++-----
>   1 file changed, 150 insertions(+), 23 deletions(-)

Applied to 21.11 branch. Thanks for backporting.



More information about the stable mailing list