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 2928CA0545; Tue, 31 May 2022 03:26:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 81E6940694; Tue, 31 May 2022 03:26:09 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2055.outbound.protection.outlook.com [40.107.102.55]) by mails.dpdk.org (Postfix) with ESMTP id 72E30400D6; Tue, 31 May 2022 03:26:08 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gX/4zam3VbjXKStEl+Rvw9uhrShyBF6l1MuXXP1cQkjlIG0txmXBzvRzKeCg4I52V5agE82vo40T4Baa9Hy4GW6kYoKu9+oCLYeTDjJHgahonQHakEt1qapttgttykzf986f257zx0ml2oeLgO2Q63hMQL49/omMcr0l2lV1RJb2idtnCMk8MfEmTlzNb41KW2T3483qRb7mT9SAypzvjrJthNcnmhgsdG3cyOP19MDTfwjO8QZerY1mgjJd9aeLTP8+xUIagfwY1u8g2rlL+53Ykyygsep2s8Zcrnldx3o08fGakEMJNubGG/YdICv8rK/dSyEL4PNwR5BTCR5llg== 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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1QUrnC4ucI+3F4HNtw/3POIJA+siL3GFlD8qFbQf4jw=; b=D0K1xF+dTWnLutjqwxjr4Wth5pvCA9gK/vT5DHvBTFTaOk29YLrsK41EptJsu4SPDhwElrmr6WqYHJuyx41sUtJrDw+B4qeCUq3+qifnXsDXR2HTgSIZ8j46iRGdRPu/vlarM1uqWvAcbFo9Ja2CwhocibNWbtfT5dsiAi3/1gdTpoyeVvQpDqgJ/F442FAq9hRJ5P7+k8dlpBCoPRM57sxpY4h/O8s7dmZFzkMgrV+mxWPIzwZ6f9j/4iCJQqqJv83aKq0LWrQoe6ELCejxh9lrLntJGqIQkXh0bnuLm8KLWefiFaI6Ycnn6+z0v9/UK3b7ce+cLDG2wmdfJbYMvQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1QUrnC4ucI+3F4HNtw/3POIJA+siL3GFlD8qFbQf4jw=; b=lhTKi8mGNK+Hhu/vX07/4mZ+AO2Q+xqZj90GklbtLyaU2gsXmbWP3y/8Uy6kHNpHIIMYtFhHRUb67JZjXTxjJqjNc2hgBZ6aX9/uuAVSkyk4o+Ixb/JP2khp4QkeURbC+KtLAbRJXdQ5QLHCoxuPbiekdXMAHLcYaR/aCjcmA7Pgw25lsXnb1VmdhbkCCPN61Vha/2KN0yv1xR04d5q0Cyh9xMn4vPS3dT+ANDZDhgR4aweHHnOUiZ1W/xi02r6CR8ZTmDLugCv29WE+SXgcyJPSi8QVKnTGl42tRHZ6zj/rk2tpEz5tMX8hlf+wfelJjP3li6kJ/ILNEzGwHWKzug== Received: from MW4PR04CA0100.namprd04.prod.outlook.com (2603:10b6:303:83::15) by DM6PR12MB4122.namprd12.prod.outlook.com (2603:10b6:5:214::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Tue, 31 May 2022 01:26:06 +0000 Received: from CO1NAM11FT053.eop-nam11.prod.protection.outlook.com (2603:10b6:303:83:cafe::77) by MW4PR04CA0100.outlook.office365.com (2603:10b6:303:83::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13 via Frontend Transport; Tue, 31 May 2022 01:26:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.235) by CO1NAM11FT053.mail.protection.outlook.com (10.13.175.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5293.13 via Frontend Transport; Tue, 31 May 2022 01:26:06 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Tue, 31 May 2022 01:26:05 +0000 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 30 May 2022 18:26:03 -0700 From: Suanming Mou To: , CC: , , Subject: [PATCH] common/mlx5: fix list unused lcore check Date: Tue, 31 May 2022 04:25:48 +0300 Message-ID: <20220531012548.11156-1-suanmingm@nvidia.com> X-Mailer: git-send-email 2.18.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7d1ff9bc-408a-4d3a-956e-08da42a488db X-MS-TrafficTypeDiagnostic: DM6PR12MB4122:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KIXmaThth183m1tWIU25SKS+3sJVUUfNK7V1kBTaxqKPyvrI6Him5b7qQ3q+ZVnRrRetsIUQGqXiUhhK4d2llwvmbPj09Lf2KNOKx1pN/23C/Et7sZK/NP/vRLe8h5BiQKBRzYQMk1NTdVe3ArBWejhMQ6SaNP99t5uci+6kYxvhxBXJKvsbJXmGz804/v/y7cxTWYwcLI+JyoW4NnLykrhCp0wQKnDPAGvU3MHa8dCTqd/aIrt39pfb2EMA6ig1Qi0twoaiHkcCeRPHq00Ppv4au1xgsFS2aqPVxp5EJcIu0fR6LJRu99uMoeot4i0PZCE3GPMcX6bOsjRxm7C5QhO+loJmULolzsexYMvG/mHx5mTEy7Glgya4kD9caY7VRph6EmetxWIevuL6cZv+YUMquwBA/zyiioVtClaxuPqBB/ekm5QmUjy2FvMOb6SWaxYE7pehmjP38kamz0aVK6WXwz/Z12/Cf7D76LBffoPit/lQ9ll9CZGtC61be3eaRZ/u/QMvWbE3aNTikVLJwtmMvMc22Tq7/AR8HQHnyHeeSQ063ZZGWAnEcpngjmRQSHo+QI/13RhlMpstjltxoL1qGAdKevnbmkh+rWyWasBhttWp/1vZxEQGAGwFIMfnNlg+xtK43HiZ4gOOYVxndk7ZGB6vkt8/nhuR+t0uXuMy1BBLq9qFvyk+NUBryrdVHEtwYpo24LDr5+q+viDpSw== X-Forefront-Antispam-Report: CIP:12.22.5.235; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(40470700004)(46966006)(55016003)(36756003)(70586007)(70206006)(4326008)(8676002)(54906003)(110136005)(316002)(1076003)(450100002)(8936002)(426003)(6666004)(186003)(336012)(16526019)(6636002)(5660300002)(2616005)(7696005)(2906002)(86362001)(508600001)(6286002)(81166007)(83380400001)(36860700001)(26005)(47076005)(356005)(82310400005)(40460700003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2022 01:26:06.3414 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7d1ff9bc-408a-4d3a-956e-08da42a488db X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.235]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT053.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4122 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 While non-lcore list operations were supported, non-lcore index will be converted to MLX5_LIST_NLCORE. In that case, no need to check the lcore index be -1 or not anymore. This commit removes the unused lcore check in list. Fixes: 7e1cf892711b ("common/mlx5: support list non-lcore operations") Cc: stable@dpdk.org Signed-off-by: Suanming Mou Acked-by: Matan Azrad --- drivers/common/mlx5/mlx5_common_utils.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/common/mlx5/mlx5_common_utils.c b/drivers/common/mlx5/mlx5_common_utils.c index 775fabd478..58d744b4d4 100644 --- a/drivers/common/mlx5/mlx5_common_utils.c +++ b/drivers/common/mlx5/mlx5_common_utils.c @@ -293,11 +293,9 @@ _mlx5_list_unregister(struct mlx5_list_inconst *l_inconst, l_const->cb_clone_free(l_const->ctx, entry); else l_const->cb_remove(l_const->ctx, entry); - } else if (likely(lcore_idx != -1)) { + } else { __atomic_add_fetch(&l_inconst->cache[entry->lcore_idx]->inv_cnt, 1, __ATOMIC_RELAXED); - } else { - return 0; } if (!l_const->lcores_share) { __atomic_sub_fetch(&l_inconst->count, 1, __ATOMIC_RELAXED); -- 2.25.1