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 A5C8A4548D; Tue, 18 Jun 2024 15:15:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7AF4E4064A; Tue, 18 Jun 2024 15:15:33 +0200 (CEST) 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 2D6B9402B4 for ; Tue, 18 Jun 2024 15:15:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718716531; 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=tr/fsGNQrb4ZNglENHJzqV5+v5ZX6aNjzYeaAwnY7IY=; b=eFKJDcMbIhy9msThTGlzh+cqZnNinbrQKKVLexsudHjiJrpyRvbnjCKP8SoSYZB/37A0fj Znnl7wI6DK0ULdC2aW54psjb+auZRRb3nbdSFvt/qYfdpgABty9t3eyrYM9A4D07y2OTlG 3xqXOZeFPlDQxuhNLjB1Li75fvCYtDo= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-20-pd5dDhGsMxW7ROl_IT5jHQ-1; Tue, 18 Jun 2024 09:15:30 -0400 X-MC-Unique: pd5dDhGsMxW7ROl_IT5jHQ-1 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2ec39e4faa2so3851501fa.1 for ; Tue, 18 Jun 2024 06:15:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718716528; x=1719321328; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tr/fsGNQrb4ZNglENHJzqV5+v5ZX6aNjzYeaAwnY7IY=; b=qjge/2Jz/v6N0bjKNHUyE/qnvmNcyz9bdhx+ev/8oV4YPqUl9lv+4Gj2GNzevRU3Nu RBEUhmdchdOBYHj8mZv1RyT2gH6o6s31l3N4QB5pze4Irqrqacgt8BUA5IBCbujdLODe 9+wfJ+yamOMe9YznyIw3xW8wNr2q85lX2BHYNRMmm5Vttx1soe+8Npu4WYxtV3e3osG4 PYvXkP0EphjvaZGuAXBvmsq5UB7MHVAa7Sofp2ZV5W3HbchD8TVFtCmfWUF/B7/GLMd6 57h7kzWDfkRrbCnIx61imcmaUgZ8IU7p9FhgfzTPufxpVZ3tBDDO8SmzlAtAudnk/lkX Lo0A== X-Gm-Message-State: AOJu0YyyHvVPTbzFojhMEkMmucXbDn4SR1dqKIkzwbV8aEqqMXhYN1JM bzrZABpA9nLxW3Q7wrxbtwE4gmaePCG/v/K7kSi6nuPkqpgv6L6aLNbtVVS+MMVRhFd31SmC/IE 7hoXSJupRFzT8mz2f5nwHjd6ODHCgLpNMgJ9zsNfwkjwCpRDuLedLTdZpQO+gBBxj2LldvEONPk BUFhA+XddMBWQjcog= X-Received: by 2002:a2e:9b10:0:b0:2ea:e773:c4f with SMTP id 38308e7fff4ca-2ec0e6004damr95721561fa.33.1718716528580; Tue, 18 Jun 2024 06:15:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHnVDJJhO6vPgnz28RSY2FFDMZpggZmgjfAUc+HK9gXI9TjckdkVyHS9DPoPJMsuBhu9J7hHjeRmsbnWYOWiW8= X-Received: by 2002:a2e:9b10:0:b0:2ea:e773:c4f with SMTP id 38308e7fff4ca-2ec0e6004damr95721371fa.33.1718716528237; Tue, 18 Jun 2024 06:15:28 -0700 (PDT) MIME-Version: 1.0 References: <20240325155303.770468-2-rjarry@redhat.com> <20240401203647.1909165-3-rjarry@redhat.com> In-Reply-To: <20240401203647.1909165-3-rjarry@redhat.com> From: David Marchand Date: Tue, 18 Jun 2024 15:15:16 +0200 Message-ID: Subject: Re: [PATCH v2] graph: avoid accessing graph list when getting stats To: Robin Jarry Cc: dev@dpdk.org, Jerin Jacob , Kiran Kumar K , Nithin Dabilpuram , Zhirun Yan X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Mon, Apr 1, 2024 at 10:37=E2=80=AFPM Robin Jarry wro= te: > > In rte_graph_cluster_stats_get, the walk model of the first graph is > checked to determine if multi-core dispatch specific counters should be > updated or not. This global list is accessed without any locks. > > If the global list is modified by another thread while > rte_graph_cluster_stats_get is called, it can result in undefined > behaviour. > > Adding a lock would make it impossible to call > rte_graph_cluster_stats_get in packet processing code paths. Avoid > accessing the global list instead by storing a bool field in the private > rte_graph_cluster_stats structure. > > Also update the default callback to avoid accessing the global list and > use a different default callback depending on the graph model. Fixes: 358ff83fe88c ("graph: add stats for mcore dispatch model") Cc: stable@dpdk.org > > Signed-off-by: Robin Jarry Acked-by: Kiran Kumar Kokkilagadda Applied, thanks. This may be worth a unit test, though I don't think it is trivial. --=20 David Marchand