DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Robin Jarry <rjarry@redhat.com>
Cc: dev@dpdk.org, Jerin Jacob <jerinj@marvell.com>,
	 Kiran Kumar K <kirankumark@marvell.com>,
	Nithin Dabilpuram <ndabilpuram@marvell.com>,
	 Zhirun Yan <yanzhirun_163@163.com>
Subject: Re: [PATCH v2] graph: avoid accessing graph list when getting stats
Date: Tue, 18 Jun 2024 15:15:16 +0200	[thread overview]
Message-ID: <CAJFAV8wJt6k_2EQVCcEg_sWj+rw5uu5O20V37J9GG+hKFVpaLw@mail.gmail.com> (raw)
In-Reply-To: <20240401203647.1909165-3-rjarry@redhat.com>

On Mon, Apr 1, 2024 at 10:37 PM Robin Jarry <rjarry@redhat.com> wrote:
>
> 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 <rjarry@redhat.com>

Acked-by: Kiran Kumar Kokkilagadda <kirankumark@marvell.com>

Applied, thanks.


This may be worth a unit test, though I don't think it is trivial.


-- 
David Marchand


      parent reply	other threads:[~2024-06-18 13:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25 15:53 [PATCH] " Robin Jarry
2024-03-29  7:44 ` [EXTERNAL] " Kiran Kumar Kokkilagadda
2024-03-29  9:32   ` Robin Jarry
2024-04-01 20:36 ` [PATCH v2] " Robin Jarry
2024-04-03  7:22   ` [EXTERNAL] " Kiran Kumar Kokkilagadda
2024-06-18 13:15   ` David Marchand [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJFAV8wJt6k_2EQVCcEg_sWj+rw5uu5O20V37J9GG+hKFVpaLw@mail.gmail.com \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=rjarry@redhat.com \
    --cc=yanzhirun_163@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).