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 4F3264246A; Mon, 23 Jan 2023 14:53:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E2CDF400EF; Mon, 23 Jan 2023 14:53:28 +0100 (CET) Received: from mail-vk1-f180.google.com (mail-vk1-f180.google.com [209.85.221.180]) by mails.dpdk.org (Postfix) with ESMTP id BDB08400D4; Mon, 23 Jan 2023 14:53:27 +0100 (CET) Received: by mail-vk1-f180.google.com with SMTP id v81so5976595vkv.5; Mon, 23 Jan 2023 05:53:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=WLgf3NJw1e1Aej3DOX4F3NnT+aZiCgVj0XjODANJoFc=; b=A0WzHuezSq11HJYnpehEKnTkGy0wGz4GSFJOOPjymr49FGb7pOViBgC5H09ZC0zZpF X/N80E7Fual3zvE67RL6wJToUuIZEXHMrjppBwg6WJpE4IND8+FF7LXNTha6822j1J3j ubGinqToCMn3l4HHMXb1JerfDH2v/k47VUA9MFbG1zvABguebPG5yaXwc5BxXslYTYgd 3yoZKeUZP/zh6ppKz4nqK+taSFFBm+UATTT6hLQ00uvrVYOISZWEBaxu3gSvLkzjRh97 dD5mAcZOI/Xo0Dm1SsSwMZGqfKiC4Z/V3PcZObXOAggpkW6pokd8pDgZlJcepI02w+EO lGXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=WLgf3NJw1e1Aej3DOX4F3NnT+aZiCgVj0XjODANJoFc=; b=D2LWls/+t35VfucaXjNvX+nO4ocoI0YVLlBWTrwUMNc6HSOevVxfGBShTlT9j/kOLJ JHkfF6/tGnB5rRQdRftFjBM0l0M7Czxwz8TNKNf/ldrQm1vhAJMQG2WUUGVAQ94WBUwp GmlF1A7J6/ztfuQY+GMFe3JBgfzAevug3PH1K1HOTfJdkrz9LDcV22byMm/cXvlLyo7P QHByEK19Qklg2u4JtDflKGa0v6BiDcBIn8ve9i1hPj7c4e/V4WOjcDXtG0RT0V11HvWF 5EtJm6PkUdJWz0XaWax6nrUucjdx16xXhL4k2cm5bX/ZDmETzEtPcCxxiN62l5ObbNW9 AMdg== X-Gm-Message-State: AFqh2kqN4ltiDAGoU/mEaEu6h8C0tiXSGi4aq0WJypuDFvdxpBHZkQAi PElDiCUNj/QAAOU7ygaGVihw7ZTlp7kYs2Y826sCN61kliAUIg== X-Google-Smtp-Source: AMrXdXtNjjEdo9++OnbUCf0bBZhzuhJBE5wV4Y9prlXLpXUIK1ogUr0GVGXmaK0/0UktwgcbQXXam1i52rdAff56EDY= X-Received: by 2002:a1f:a002:0:b0:3d5:d30f:81c2 with SMTP id j2-20020a1fa002000000b003d5d30f81c2mr3125423vke.14.1674482007093; Mon, 23 Jan 2023 05:53:27 -0800 (PST) MIME-Version: 1.0 References: <20230119103234.841173-1-david.marchand@redhat.com> In-Reply-To: From: Jerin Jacob Date: Mon, 23 Jan 2023 19:23:00 +0530 Message-ID: Subject: Re: [PATCH] graph: fix node shrink To: David Marchand Cc: dev@dpdk.org, stable@dpdk.org, Jerin Jacob , Kiran Kumar K , Nithin Dabilpuram , Pavan Nikhilesh Content-Type: text/plain; charset="UTF-8" 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, Jan 23, 2023 at 7:21 PM David Marchand wrote: > > On Mon, Jan 23, 2023 at 2:33 PM Jerin Jacob wrote: > > > > On Thu, Jan 19, 2023 at 4:02 PM David Marchand > > wrote: > > > > > > If the node id check failed, graph_lock was not taken before releasing. > > > > Thanks for the fix. > > > > > > Why not this oneline fix? > > > > [main][dpdk.org] $ git diff > > diff --git a/lib/graph/node.c b/lib/graph/node.c > > index fc6345de07..89cdcf0207 100644 > > --- a/lib/graph/node.c > > +++ b/lib/graph/node.c > > @@ -293,8 +293,8 @@ rte_node_edge_shrink(rte_node_t id, rte_edge_t size) > > rte_edge_t rc = RTE_EDGE_ID_INVALID; > > struct node *node; > > > > - NODE_ID_CHECK(id); > > graph_spinlock_lock(); > > + NODE_ID_CHECK(id); > > > > STAILQ_FOREACH(node, &node_list, next) { > > if (node->id == id) { > > Other calls to NODE_ID_CHECK input check are done out of the lock. > And to keep consistency with the rest of this library code. Acked-by: Jerin Jacob > > -- > David Marchand >