From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 16C9542FFE for ; Mon, 7 Aug 2023 12:50:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A24143255; Mon, 7 Aug 2023 12:50:21 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 86ED740A8B; Mon, 7 Aug 2023 12:50:17 +0200 (CEST) Received: from kwepemi500017.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RKCjs09k7zfbn1; Mon, 7 Aug 2023 18:49:05 +0800 (CST) Received: from [10.67.103.235] (10.67.103.235) by kwepemi500017.china.huawei.com (7.221.188.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 7 Aug 2023 18:50:13 +0800 Subject: Re: [PATCH 4/5] net/hns3: fix TM thread safety risk To: Stephen Hemminger References: <20230805083627.8681-1-liudongdong3@huawei.com> <20230805083627.8681-5-liudongdong3@huawei.com> <20230805085825.0d6caf26@hermes.local> CC: , , , , From: Dongdong Liu Message-ID: <6e0e2ea2-10ef-51da-8759-c77c2cb9fcf3@huawei.com> Date: Mon, 7 Aug 2023 18:50:13 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20230805085825.0d6caf26@hermes.local> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.103.235] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemi500017.china.huawei.com (7.221.188.110) X-CFilter-Loop: Reflected X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi Stephen On 2023/8/5 23:58, Stephen Hemminger wrote: > On Sat, 5 Aug 2023 16:36:26 +0800 > Dongdong Liu wrote: > >> From: Chengwen Feng >> >> 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@dpdk.org > > I hope no locking is necessary in the data path. Yes, these are control plane APIs. Thanks, Dongdong > . >