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 1847142FE1 for ; Sat, 5 Aug 2023 17:58:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C1BC43247; Sat, 5 Aug 2023 17:58:31 +0200 (CEST) Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by mails.dpdk.org (Postfix) with ESMTP id DC793410EE for ; Sat, 5 Aug 2023 17:58:28 +0200 (CEST) Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-686b879f605so2122601b3a.1 for ; Sat, 05 Aug 2023 08:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1691251108; x=1691855908; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=oRQolcw6Lwfd2KrtSlgCOpO8fmkY5qlNXjeyWWSU5BE=; b=VnIHqR3cXUbB/TfB3dFIf70Mqa52ggBoS2P/DA93dheB2SGup6UsXuNJoxm5I3/s5N BWE5NHHH84zkPpPh0/kHpuHkE/i/uTg5B3Sb4ctN1SSx+cIM3D9R32VZ4f0dS+GnaZTu FYBborBNXx1NM+IN75UTErl0UokOHySxuA+8/Fk7RgpfB4e/NCxkRt4nQ7Wc86TPQ8Lg qhosiPHZoMaUvLs2rjsFjmZ6EJm3KLx0mVQ5qA0JLdp+m2crn14SgRd0M8WduqhRiGzE LANyTN4oPrMrOJ13CxQ7XyyZk8GAOlRCOxFb3oLw0nH4JvOBpPVB0ggmtGdh8JzNPWNU vIxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691251108; x=1691855908; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oRQolcw6Lwfd2KrtSlgCOpO8fmkY5qlNXjeyWWSU5BE=; b=TtE9CBZFmQmUZeBkOeVoYAmBPx/KHT74rmiQx4fj6KAdYIoiNaU81Rz7zCEVXNDyt7 tIkzqf1K0ZK1EIilA6OOQj+mQyif9gpcCw9gsytLIeyNRbujA5MVvRBa98kRHm5eIuvl XEJ+kTYevG3zI/ntB/LJDZOoelBLzjwP2/bQsxTRqkqIZPjokyC2efVb56B8i1b/ksZS xRBlpOIh5MyQwV874IMS3x4XNDg9O2U3wW2dGldx2GM9QhWA6iAvrr3aChWcAopU3oyZ q0/km1XgQfpmKMs4yISKITkhwZjyAHYay0L8StwvH+Wr7PLuCQeOrztAm2ZebKH3TLC7 uXhg== X-Gm-Message-State: AOJu0YyYArfE4eh2lIvbyeHFQFxvnh0/ECHTDT76k+LDvCmUWQ/8GL4L TcWusCEDzj0vmHAnxvcM092F6w== X-Google-Smtp-Source: AGHT+IHZ26b0CZdVkIJCHi5BFYLolZsfTdAWTrdj3RMqOfjGKt0L/hcrXY0/Vj9Ace/jzuNgchtObQ== X-Received: by 2002:a05:6a20:3d22:b0:140:a0dc:c834 with SMTP id y34-20020a056a203d2200b00140a0dcc834mr480830pzi.24.1691251107793; Sat, 05 Aug 2023 08:58:27 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id c21-20020a62e815000000b0066f37665a6asm3301815pfi.117.2023.08.05.08.58.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Aug 2023 08:58:27 -0700 (PDT) Date: Sat, 5 Aug 2023 08:58:25 -0700 From: Stephen Hemminger To: Dongdong Liu Cc: , , , , Subject: Re: [PATCH 4/5] net/hns3: fix TM thread safety risk Message-ID: <20230805085825.0d6caf26@hermes.local> In-Reply-To: <20230805083627.8681-5-liudongdong3@huawei.com> References: <20230805083627.8681-1-liudongdong3@huawei.com> <20230805083627.8681-5-liudongdong3@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 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.