From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 035D0A0518 for ; Fri, 24 Jul 2020 14:06:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EE92B1C0C6; Fri, 24 Jul 2020 14:06:15 +0200 (CEST) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 05ABA1C10B for ; Fri, 24 Jul 2020 14:06:15 +0200 (CEST) Received: by mail-wr1-f68.google.com with SMTP id b6so8073228wrs.11 for ; Fri, 24 Jul 2020 05:06:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=D48dl95Dkpsr/8tD7IpUOw1a66ES2vPLNlE5fTimCK0=; b=HAElT5rFOegtDsg6Qakqqy+cQQE68joAvzOLCpKCmwAanhwugP4zwWlMwZmdVzyZgY VO45epJVL1WaRlK6VID+FHcs0YRlEWqSR+6bYw1bEvXWxXriyxNEKf8b6zirw1BOHM+k YurONSy1dGJXsElENXWCGSf74cOMH0O6AskQGe0VctbVy0Xjp/kAN0S+M6EVQbcOloMX eRM/MfE0Svd101NdFc+RRK9OklhW0cVwXO/M5FS+G4g/KB064wUjirr3ssqrnZ255dST sESnc2L01HWQKxXs9iafpqbqWpqxXnC4fJYAWk5eAXd4jkxK49+6kxpcejL36EEOr2kI t97w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=D48dl95Dkpsr/8tD7IpUOw1a66ES2vPLNlE5fTimCK0=; b=GtqxvXpyB3EnCJJtt4qLoyEc0cCrxui32jI03CLSL3J+Y/NtomsGkKm0IXO2w0SrAn NT+vqobikUeJf1JmJiQCEVyr3iLeP4zMRguTca1V+Dn8OXPT4AaR9m+maVLzuHewbGeP e2FfGLkIosUQ/3aD+8mPbGb1WfD87T9Do77/Owrfa5kCwXb3EsjqGnIhGodfbt37gm1+ tYsldzAJJRC1kXE71r1qLU4e1HdUp5bkPwbE+/knm0O0OuWcxKYS2Efx/Uu5qkPONGW+ ZgLKbCDxS5xdg2xskwCEV8dt1R4icj/3OPrb6g5qlXJc7T3Ipo85ViSFkGzEzo1WuyJL /B6Q== X-Gm-Message-State: AOAM532XP751eANyzp2l2hQDMMIy2pTee5Tre/yeyqtRjK7B4itlIbBa F/oz5uBos6D2KFKSjTDiPxDzeuccIBZv6Q== X-Google-Smtp-Source: ABdhPJwDYFtEZB5PDrAz/4SFLsiJhoCeHCJGQHgyHCgrHV0C61oWSeFiJYRwx1XqM0ZzFyKq1lZLog== X-Received: by 2002:a05:6000:1cf:: with SMTP id t15mr9000864wrx.180.1595592374722; Fri, 24 Jul 2020 05:06:14 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id l18sm1168326wrm.52.2020.07.24.05.06.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 05:06:13 -0700 (PDT) From: luca.boccassi@gmail.com To: Stephen Hemminger Cc: David Marchand , dpdk stable Date: Fri, 24 Jul 2020 12:58:40 +0100 Message-Id: <20200724120030.1863487-82-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724120030.1863487-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'eal: fix lcore accessors for non-EAL threads' has been queued to stable release 19.11.4 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/26/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 9422d38844e14f7ba8b2ad329e5313e74c05d172 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 8 Apr 2020 13:24:19 -0700 Subject: [PATCH] eal: fix lcore accessors for non-EAL threads [ upstream commit 67ae5936c4fc36863d146acbddfe107e1ad00a13 ] If rte_lcore_index() is asked to give the index of the current lcore (argument -1) and is called from a non-EAL thread then it would invalid result. The result would come lcore_config[-1].core_index which is some other data in the per-thread area. The resolution is to return -1 which is what rte_lcore_index() returns if handed an invalid lcore. Same issue existed with rte_lcore_to_cpu_id(). Bugzilla ID: 446 Fixes: 26cc3bbe4dc0 ("eal: add lcore accessors") Signed-off-by: Stephen Hemminger Acked-by: David Marchand --- lib/librte_eal/common/eal_common_lcore.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/common/eal_common_lcore.c b/lib/librte_eal/common/eal_common_lcore.c index 39efadef1..3ecca3869 100644 --- a/lib/librte_eal/common/eal_common_lcore.c +++ b/lib/librte_eal/common/eal_common_lcore.c @@ -31,8 +31,12 @@ int rte_lcore_index(int lcore_id) if (unlikely(lcore_id >= RTE_MAX_LCORE)) return -1; - if (lcore_id < 0) + if (lcore_id < 0) { + if (rte_lcore_id() == LCORE_ID_ANY) + return -1; + lcore_id = (int)rte_lcore_id(); + } return lcore_config[lcore_id].core_index; } @@ -42,8 +46,12 @@ int rte_lcore_to_cpu_id(int lcore_id) if (unlikely(lcore_id >= RTE_MAX_LCORE)) return -1; - if (lcore_id < 0) + if (lcore_id < 0) { + if (rte_lcore_id() == LCORE_ID_ANY) + return -1; + lcore_id = (int)rte_lcore_id(); + } return lcore_config[lcore_id].core_id; } -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-07-24 12:53:51.724862485 +0100 +++ 0082-eal-fix-lcore-accessors-for-non-EAL-threads.patch 2020-07-24 12:53:48.307006832 +0100 @@ -1,8 +1,10 @@ -From 67ae5936c4fc36863d146acbddfe107e1ad00a13 Mon Sep 17 00:00:00 2001 +From 9422d38844e14f7ba8b2ad329e5313e74c05d172 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 8 Apr 2020 13:24:19 -0700 Subject: [PATCH] eal: fix lcore accessors for non-EAL threads +[ upstream commit 67ae5936c4fc36863d146acbddfe107e1ad00a13 ] + If rte_lcore_index() is asked to give the index of the current lcore (argument -1) and is called from a non-EAL thread then it would invalid result. The result would come @@ -24,7 +26,7 @@ 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/common/eal_common_lcore.c b/lib/librte_eal/common/eal_common_lcore.c -index 5404922a8..1d0523419 100644 +index 39efadef1..3ecca3869 100644 --- a/lib/librte_eal/common/eal_common_lcore.c +++ b/lib/librte_eal/common/eal_common_lcore.c @@ -31,8 +31,12 @@ int rte_lcore_index(int lcore_id)