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 CB006A0C45; Tue, 21 Sep 2021 18:17:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5837740151; Tue, 21 Sep 2021 18:17:33 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00107.outbound.protection.outlook.com [40.107.0.107]) by mails.dpdk.org (Postfix) with ESMTP id 1621C4003C; Tue, 21 Sep 2021 18:17:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RchRlgTZJiZdkJ6j6UJeZ29yKVCM998LldzpTM26g0IJoI1Gj+mP5ZNT/97pRQ0HJs8uYkGS9jTw9Xh1r5eG4lfrSO/huDuQbcJFffwB2RKYBDH4LS+ojEDxCeFm79Doa6N00hxEYbuPSF4NT/43bnDBJ6g9qNlabkf0lHA5IMvzGzE0w6Ki3RCJ8RFxC+y27nizC9mlqyOGr+nJI4Wz+ES9DHq01PLODW31mqBDdGnORWw7Hyix8PlnlHaUoi8/UxDsMeiHA+3+HQVnUKkgQK2olbiP6xU5ZYDQ69TwuFEAgCtuAzTlNFy6aKCbMUT5jGySPbKYkbn3bm/bIqum7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=EkC9sS2crVZ+VdgkTPpcHgloc3f/iHRAbanJsCot3IY=; b=HLNU8nwC5RpAljMKqogb/Yz4flcwES2QD5drbphXmN5ENQMm7PUpgzHH0TNhKGcDDt5bsnOQADZfp/KMi/zmDM2KxeeF5sT0N6FLNkrqhCnfT+EGkPKdsnPl4k5LaarWojo+klsrohVnudIRBYV5M7TSfBOdht/cOAOUkRSyoAct1YOdBNj8hHT8+B2rE1j4FJmkP+Gcr0WMjtV5n0vlmzUnaR0FT0DkowR4/QpLfIOumU9FWcWryTvNNXYRMNcW9GQ51Z8fhfqgjLixpol6gKtUjvMTeiAuDM3Rw+8/ki/Y8EBHHjDrOM5PClsWPZ+nvX7iPGF22ZMYgMdr87fc+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nokia.com; dmarc=pass action=none header.from=nokia.com; dkim=pass header.d=nokia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EkC9sS2crVZ+VdgkTPpcHgloc3f/iHRAbanJsCot3IY=; b=LJE9jZPGt0a2eTU5HNq1VyQkViTkP4oSK8Sov+MKMP4NFgx50c3/+pq5QnClHPh9LmXzl3I1ZKvkyNF77iqBmvgij+WTElbKFjdjxWF8wuf1G+pVmWh36NWI87X9XooL2YoF8e5+ZTGBrsc/SPx0PyQEeYXydX5wRogJCdGrDfI= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nokia.com; Received: from PA4PR07MB7600.eurprd07.prod.outlook.com (2603:10a6:102:c5::12) by PR1PR07MB5018.eurprd07.prod.outlook.com (2603:10a6:102:4::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.6; Tue, 21 Sep 2021 16:17:29 +0000 Received: from PA4PR07MB7600.eurprd07.prod.outlook.com ([fe80::2dc9:3fc1:3047:aa1d]) by PA4PR07MB7600.eurprd07.prod.outlook.com ([fe80::2dc9:3fc1:3047:aa1d%6]) with mapi id 15.20.4544.013; Tue, 21 Sep 2021 16:17:29 +0000 From: Julien Meunier To: dev@dpdk.org Cc: stable@dpdk.org, Olivier Matz Date: Tue, 21 Sep 2021 18:17:24 +0200 Message-Id: <20210921161724.20860-1-julien.meunier@nokia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210819093915.5227-1-julien.meunier@nokia.com> References: <20210819093915.5227-1-julien.meunier@nokia.com> Content-Type: text/plain X-ClientProxiedBy: PR0P264CA0198.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1f::18) To PA4PR07MB7600.eurprd07.prod.outlook.com (2603:10a6:102:c5::12) MIME-Version: 1.0 Received: from localhost (86.242.117.254) by PR0P264CA0198.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Tue, 21 Sep 2021 16:17:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: debb402b-0ac6-4809-224a-08d97d1b4eb3 X-MS-TrafficTypeDiagnostic: PR1PR07MB5018: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:166; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OVOqATKBUDhyfcHBfGR8goTwG0PkffJ74Oz4r1HKPuPN6h+/+lP5WPyG3mgZdMJVhBhc/Jo4BGKZ7Uad60PrRjo+dy+OhM8R6VC5JE6AJhVDgqfDcKyvqgxIN2Q7hKtMA6+MmszyFkAxwl2tklUyuEnDJQxG+2SVzqSRA6hyebBUzNtiH//oW5S68w1BhMXHa7Wpx0qbPBk2G1iOSlrdmvmcTeEli0O+40InehrG7Cd/9legpcnGRWMtfOw88lYyXpq3rl42QFgdJHX0T/uq/fn5wOhTuuVeyk1YYFJH8dn+wh7+uAtrf6SKLi5lqtrSr9EisJnMFxbFNNHJsdeLemsH7QsJB0y5/B4lMPKfGM6T3qiJJLxvXJsq1H922JJ09d/xg9kyZcAjFlJtW9NdU9sgwZZK7fbGX+D4F72qZMU57uWMdTWHl9CKAexDZ+V9U8QUr6u4Fzw5wEBLx1YF4pvtkWOEFWVGwd273MwOm0JBD6SiGrdHophxy3Wzq7fmdgOuAXPZZvqMK8BjsJklhJFtySU1udh2Lza9TN2gE7OrW0qT7/soZtQi/LOd7IrgAdz4OMBKCIm8zkvWmIHqFBPrtDOD4NKT6Tx+rDDdtJu1OxaF+Y1AFsEDYPrQ8DxtyL2RyHx4iWg/KCLSuLxg0g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR07MB7600.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(6916009)(1076003)(8936002)(44832011)(2616005)(66556008)(6666004)(38100700002)(66476007)(508600001)(6486002)(5660300002)(956004)(36756003)(316002)(186003)(6496006)(86362001)(66946007)(8676002)(83380400001)(2906002)(4326008)(26005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?P9Di3FD1cPwT5k1VXD/T4iOsHHdeGuINtbO1ZAjHHjyjC7Bdmo9cFrhFigEn?= =?us-ascii?Q?zjknc1KFhWuIzbPmNUpyhdmYOHpYjQJC2KNZrDVj01AUofHCzQm5sgLCjAYO?= =?us-ascii?Q?MNCzaZz81lie5+xRV6+C0NCfGRHaDnH1HXtp90khnU8hAmN0TE2HSKridfv3?= =?us-ascii?Q?SDvmNoNFcqgxQHcCXEeUTGqAGh6G3erVifIxp6qKe+URnZi/EcSohpm61nfL?= =?us-ascii?Q?f8UQqU209b6JfmbzT/HMIbRyrdlT2d8CUd91YlyvjMZIwkQAsWU9ixk+xWdc?= =?us-ascii?Q?AjDh31cm4a8ZKhgA9l0EgpnjiPALBk7uu4a/RUTm56kTGh0KonUpcSbL1j7k?= =?us-ascii?Q?Zy2PV3WGuGD+dPQ2lr/vPvz5lEq4Aq5Mu6P8JyPyReexBzMc/buikhdut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ml5ckAQDhUELJJyBfQvQEObgI89JLeH8UWK5Z?= =?us-ascii?Q?S0mEPriRXhfMMz0mXc6DK2Cg?= X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-Network-Message-Id: debb402b-0ac6-4809-224a-08d97d1b4eb3 X-MS-Exchange-CrossTenant-AuthSource: PA4PR07MB7600.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2021 16:17:28.8931 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4qqQECw3F+d7v1y7KiOW4jGKbSS9rbx4wO5Q9nmUAyhwCJRSNCxRohSFRG0kpuDlDpbblP5cxgX1tS3l9+ZnXJ5iDKEi8ZPk93Z1DizQVGo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR1PR07MB5018 Subject: [dpdk-dev] [PATCH v2] stack: fix reload head when pop fails 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 Sender: "dev" The previous commit 18effad9cfa7 ("stack: reload head when pop fails") only changed C11 implementation, not generic implementation. List head must be loaded right before continue (when failed to find the new head). Without this, one thread might keep trying and failing to pop items without ever loading the new correct head. Fixes: 3340202f5954 ("stack: add lock-free implementation") Cc: stable@dpdk.org Signed-off-by: Julien Meunier --- v2: * rebase * update commit log + remove invalid CC email address lib/stack/rte_stack_lf_generic.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/stack/rte_stack_lf_generic.h b/lib/stack/rte_stack_lf_generic.h index 4850a05ee7..7fa29cedb2 100644 --- a/lib/stack/rte_stack_lf_generic.h +++ b/lib/stack/rte_stack_lf_generic.h @@ -128,8 +128,10 @@ __rte_stack_lf_pop_elems(struct rte_stack_lf_list *list, /* If NULL was encountered, the list was modified while * traversing it. Retry. */ - if (i != num) + if (i != num) { + old_head = list->head; continue; + } new_head.top = tmp; new_head.cnt = old_head.cnt + 1; -- 2.17.1