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 16008433A7 for ; Thu, 23 Nov 2023 11:49:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0FD4B402A6; Thu, 23 Nov 2023 11:49:23 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 3B0FB4026B for ; Thu, 23 Nov 2023 11:49:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700736560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=15P8KLD8NxEMDH/kt6dQeNxSE1Vmxmk5A178Hdua10c=; b=jJSkl4AVfdR69qEdXYjupWqMlqRZWhJdUbx9M5zm/LFj13FBC4XhR9N1VpeCGiudHjpFb8 FyUicB7jEEYPSbWxpSWL6DQdhxCg8GH9i0vTFuRsQkChHwKd9LiVbq+1bLoK3G0QzDEoKX efkQCHC+qwO9PwAjKlQxTKOL9reqDLo= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-10-qdUoxnorNPaN9rvlBTaUlQ-1; Thu, 23 Nov 2023 05:49:18 -0500 X-MC-Unique: qdUoxnorNPaN9rvlBTaUlQ-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-40b2c0df444so3614645e9.2 for ; Thu, 23 Nov 2023 02:49:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700736557; x=1701341357; h=content-transfer-encoding:in-reply-to:subject:from:references:cc:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=15P8KLD8NxEMDH/kt6dQeNxSE1Vmxmk5A178Hdua10c=; b=g73hYPQBpM3wEK8JaFAw24W0weDmRSyBrqm0fl0/oIsbA+fObfCIreo1oOL0Rl/has 4fCYZdsWIF1FKa1EbHSBc6fai5+KNNf+JnkCOxwWEzur+DVZDOg6GVvM1wmqp845QgD4 pHnuYbSLhOHUOPbEohTl4Bb6S1w6yufIfpGF267SikA2LlBli8PS3IFS9ugop7tzmoCd Mpk/2BaOqpIJV/rc53GBD4XwlnGcTk9jgVYStM9fNHQhKdTnLJSIGcCFqhlzQE6Z7zAw sajWOsA8KW0BYAqtiteAMuHOq99f+UQLSPCPC5xn96XodrlIOVWBXnfqTsZYAeqxTbdX 9Utw== X-Gm-Message-State: AOJu0YzYQa9X2gCvEHN06BBSVqEsY8KBk1JuWmiKcnl6d/RV86krRGNB jL1UNEbZpqOn4sdkeKDL8nQa2eoQwO5xTqipv45tYuA/VryaVNbSLsucG/vkYpcmo7fTgBn9QR6 ufYkW4wEBgt8batI= X-Received: by 2002:a05:600c:474f:b0:40b:3809:38d0 with SMTP id w15-20020a05600c474f00b0040b380938d0mr125967wmo.18.1700736557559; Thu, 23 Nov 2023 02:49:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IHXFC+95uBOxNT2wjmaRSCCHGfnKRZx1bkoR0jk37B7ryi8UiTWKFdRlRAPG/Va0sM0j48lUQ== X-Received: by 2002:a05:600c:474f:b0:40b:3809:38d0 with SMTP id w15-20020a05600c474f00b0040b380938d0mr125954wmo.18.1700736557233; Thu, 23 Nov 2023 02:49:17 -0800 (PST) Received: from [192.168.0.36] ([78.16.130.39]) by smtp.gmail.com with ESMTPSA id o7-20020a05600c510700b0040b36ad5413sm1416434wms.46.2023.11.23.02.49.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Nov 2023 02:49:16 -0800 (PST) Message-ID: <56aa5dde-140a-b8d7-e49a-3693e22983a5@redhat.com> Date: Thu, 23 Nov 2023 10:49:16 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 To: Chengwen Feng , stable@dpdk.org Cc: lihuisong@huawei.com, haijie1@huawei.com References: <20231116123455.36816-1-fengchengwen@huawei.com> From: Kevin Traynor Subject: Re: [PATCH 20.11] net/hns3: fix traffic management thread safety In-Reply-To: <20231116123455.36816-1-fengchengwen@huawei.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 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 > Signed-off-by: Dongdong Liu > --- > drivers/net/hns3/hns3_tm.c | 173 ++++++++++++++++++++++++++++++++----- > 1 file changed, 150 insertions(+), 23 deletions(-) Applied to 21.11 branch. Thanks for backporting.