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 03CD7A0C4B for ; Thu, 11 Nov 2021 13:08:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E77B94115A; Thu, 11 Nov 2021 13:08:16 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 8610740E2D; Thu, 11 Nov 2021 13:08:13 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10164"; a="293723833" X-IronPort-AV: E=Sophos;i="5.87,226,1631602800"; d="scan'208";a="293723833" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2021 04:08:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,226,1631602800"; d="scan'208";a="504407294" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga008.jf.intel.com with ESMTP; 11 Nov 2021 04:08:11 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 11 Nov 2021 04:08:11 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 11 Nov 2021 04:08:11 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.176) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 11 Nov 2021 04:08:11 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kf+effls1x3VCmQ2LOW+ieBjfr+jJVcnOK0mK+Q60W4owJon8jSvysvn+dEUIa3InQQHz5L37DRn1qm3sxyqTmRx6CQ8ubK8aWTE8oSY/M+QtdETrKY2QhMvFnHFRoyWKFBNFDoO2Rj2NjEDBcuFR0T9J4dKUsZzSE9Gp09TcK7uHwylt0xpha7gqx92anCkawPMqsPHuKfA6PIZAWA6LuvGDPMPqfNsCmToFWRk+oirCv1+aNjcnY8b0C0vAJii+9Xv6wWPS0pi2RmUJ4P/+VP5qGbwcER+7craTAxhzPyvUs4YlcqfVdbPC4wIM/Zdzb+gusCBa1tgKXl85mlZew== 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=zqD3SJiYptm2uz+EbRE06ID+eDiuyfSmatY0BmFbrQ4=; b=lTqnyTdy7chHTylj6or01NaRtGQwzdXxbNZ3iaqVLx1u1Xm2mCQH2CZO9KmWlRsrZx/CGomg4reI2jZNmITog/OQ4FCSzbHu2L59G9o7W5N62OLfa681BO52924ij4oWoRfiyd5kw83mkbs4kwDaWyBon1RMUOZYSyWQB6rODrggwSIh3028qnptmSKvXoLicRFEdu1yImEVx5pd58ATPkjaLUNG/gGDvhWtxYSzcLLX2cM003BKhIZdM8c6PhVjfux6wKGPeXajIWv3X4wkxBixDig3vGo9NpIR6OHqpknSeMC58M64p43MIai8M6A25gOMFyeU4Q/MR7zwjp1r7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zqD3SJiYptm2uz+EbRE06ID+eDiuyfSmatY0BmFbrQ4=; b=RIrOnNG9hjKj7bVvLKrJI9mKFAukTlpJI8L71DOgzWRSjLT+JUdTaYMWYBRbHCppFjI8a2lnJr10MZQveTX9ipXLLw4/P8ksERR1Uf8cqiDLtf3BiMZPSgzcWL1biLFdq4tfzT7Evdkf2x7LLB1CcBy3BJzn6z58zHGU+n9ZRJ8= Authentication-Results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB5904.namprd11.prod.outlook.com (2603:10b6:510:14e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Thu, 11 Nov 2021 12:08:10 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c%6]) with mapi id 15.20.4669.019; Thu, 11 Nov 2021 12:08:09 +0000 Message-ID: Date: Thu, 11 Nov 2021 12:08:03 +0000 Content-Language: en-US To: Slava Ovsiienko , "dev@dpdk.org" CC: Raslan Darawsheh , Matan Azrad , "stable@dpdk.org" , Chengfeng Ye References: <20211111084751.26721-1-viacheslavo@nvidia.com> From: Ferruh Yigit Subject: Re: [PATCH] net/mlx5: remove redundant "set used" X-User: ferruhy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0118.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:192::15) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 Received: from [192.168.0.206] (37.228.236.146) by LO4P123CA0118.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:192::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.19 via Frontend Transport; Thu, 11 Nov 2021 12:08:07 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2e16b99c-52e4-4f05-d696-08d9a50bed19 X-MS-TrafficTypeDiagnostic: PH0PR11MB5904: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2449; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cT6DDsCKALdUrQedqdi/FW5mTAiSlfPM1ZpVsBJ8K28ZDjVUXWadNZeqOKw+7rJnd4C1aEQVeYJqYT5jHZW7xX7iUDXOb/Y0fWLZ1gz2Y/jK+5Qzzu9wBR6NzCM6ZOnpcDvr8mJNXrJmhBDeBtoQiZkWGypEJUIPqpMYiUWxxvqYij+cI+YC/MKJbYzOVWa6p6ntMIryfI3CieSih3ey+d8w1fyC5V6Rv0/peUQZfHRsUsUbSbSwW7ydEqIRS+eOsz+CDNQ+WBTBz+T3bKsdgsJ+sbFVOvDw2c9XXr3BkDnSYC5wr8CfFZYmvFwPSfjsE+RMPA54FbrPqwkT1J5gcU+BMY6F1IvgUA9j9Pjh8oWbRocj4QwPr/3HuKzG0iB6v5EaA3yzg1KymyJmZQsJrqWC405Ogr2LSPQ5nFw46KaM0Vo/DT75u/JZmqWIifwvrRGRvF3sHkGB69MvScZmTZw3dBkHS1XIwdJn/YeFAudCyZfgQ0xIj/Mf7ZPeXBsSDaV4aMFbn9ZChKjcBTy7guyvX+SAKwqIGrMMjw44TYchdJbrIw0XRNzViaZhrV+6rsNE0FKs5cjifhLC5uwB3xe/I+i0D+FipC0YxmrvxhyumngA99pQjYMn4o7PAMHrDSrmGjekqYm6X972HhiCoKrd971PdS962lfvzdxLxj4C7GmO0qIt+R6RbAtikQCd4KY7D6yjS4WUfrEVM0/Ym4t+X4+QDBkGJ0WwAfGp/qsXQqqTRSE4q09hmbXLoZqZoLlEtw/Lccozy2SuumBnucm7jvU4ezVTLokzuShBUU8= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(508600001)(66946007)(26005)(66556008)(83380400001)(53546011)(66476007)(86362001)(6666004)(4326008)(8936002)(966005)(44832011)(54906003)(316002)(36756003)(6486002)(31686004)(186003)(8676002)(110136005)(38100700002)(2906002)(16576012)(5660300002)(82960400001)(2616005)(31696002)(956004)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aFhOV3B5VUxTM0dqVm92blVNa2dsa29lUkNYdDdYSXRsZ2gyd1hPUlprR01x?= =?utf-8?B?dFoySDlWcm5oUE9BT2I0T0lOZ0ZJTUZreDdaVnpyRHpHdWRzZXlRTUl1K2pK?= =?utf-8?B?alFHYkFkZlhEREwwTlFOU0lTVnZWRFhkQTF3MUp0dDNxZXp1N1plM21iZUNJ?= =?utf-8?B?UXkwcjBOQks2U0FYdmZGdGw1R2s5ekZncjVHNEtEMXp5OFRJMXFoejVrOXlQ?= =?utf-8?B?ajVLcTRaQ0tjZ0E0bTB6YXRVLzNmbmFMUUgyVnk2MlRZZldmUVpJWnFXQUdu?= =?utf-8?B?V2ZMc0pDOW1VRWtjMS9DZk1icEh0MFZVSTB4YjYxVWtzZ2dMR2dFSWM4Q21L?= =?utf-8?B?UXowNmpyZ3h1ejQxK1AxcGNvQWg1amZNSkRFYzI3bWpKLytTbVJTS1V3ZlVt?= =?utf-8?B?MkJGaUllQz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-Exchange-CrossTenant-Network-Message-Id: 2e16b99c-52e4-4f05-d696-08d9a50bed19 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2021 12:08:09.3560 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hHkym/mbZELL78yefGr88j8AUOL5qS1ufNsFrLn/6VgGQw99e1w3HsDW0X594fmbDu6NnJJfTOqqAdjPCSZTVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5904 X-OriginatorOrg: intel.com X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 On 11/11/2021 8:59 AM, Slava Ovsiienko wrote: > Hi, Ferruh > > I've also inspected the mlx5 PMD code for RTE_SET_USED() for the similar > issues related to the MLX5_ASSERT(). > > The patch http://patches.dpdk.org/project/dpdk/patch/20211111084751.26721-1-viacheslavo@nvidia.com/ > should refine the few found ones. > > I do not mind about squashing with "net/mlx5: fix mutex unlock in txpp cleanup" > After getting this code in Upstream will care about the version for LTS. > It will cause additional complexity for the LTS, since a small part of the below fix will be originated from Chengfeng's change. To help LTS, what do you think - First get your fix on top of current task - Have a new version from Chengfeng on top of latest head, with 'claim_zero' usage? So only your update need to be merged to LTS releases. > With best regards, > Slava > >> -----Original Message----- >> From: Viacheslav Ovsiienko >> Sent: Thursday, November 11, 2021 10:48 >> To: dev@dpdk.org >> Cc: ferruh.yigit@intel.com; Raslan Darawsheh ; Matan >> Azrad ; stable@dpdk.org >> Subject: [PATCH] net/mlx5: remove redundant "set used" >> >> The patch just refines the code and replaces the pairs of MLX5_ASSERT() and >> RTE_SET_USED() with equivalent claim_zero(). >> >> Cc: stable@dpdk.org >> >> Signed-off-by: Viacheslav Ovsiienko >> --- >> drivers/net/mlx5/mlx5_txpp.c | 30 ++++++++++-------------------- >> 1 file changed, 10 insertions(+), 20 deletions(-) >> >> diff --git a/drivers/net/mlx5/mlx5_txpp.c b/drivers/net/mlx5/mlx5_txpp.c >> index 73626f0e8f..af77e91e4c 100644 >> --- a/drivers/net/mlx5/mlx5_txpp.c >> +++ b/drivers/net/mlx5/mlx5_txpp.c >> @@ -890,7 +890,6 @@ mlx5_txpp_start(struct rte_eth_dev *dev) >> struct mlx5_priv *priv = dev->data->dev_private; >> struct mlx5_dev_ctx_shared *sh = priv->sh; >> int err = 0; >> - int ret; >> >> if (!priv->config.tx_pp) { >> /* Packet pacing is not requested for the device. */ @@ - >> 903,14 +902,14 @@ mlx5_txpp_start(struct rte_eth_dev *dev) >> return 0; >> } >> if (priv->config.tx_pp > 0) { >> - ret = rte_mbuf_dynflag_lookup >> - >> (RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME, NULL); >> - if (ret < 0) >> + err = rte_mbuf_dynflag_lookup >> + (RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME, >> NULL); >> + /* No flag registered means no service needed. */ >> + if (err < 0) >> return 0; >> + err = 0; >> } >> - ret = pthread_mutex_lock(&sh->txpp.mutex); >> - MLX5_ASSERT(!ret); >> - RTE_SET_USED(ret); >> + claim_zero(pthread_mutex_lock(&sh->txpp.mutex)); >> if (sh->txpp.refcnt) { >> priv->txpp_en = 1; >> ++sh->txpp.refcnt; >> @@ -924,9 +923,7 @@ mlx5_txpp_start(struct rte_eth_dev *dev) >> rte_errno = -err; >> } >> } >> - ret = pthread_mutex_unlock(&sh->txpp.mutex); >> - MLX5_ASSERT(!ret); >> - RTE_SET_USED(ret); >> + claim_zero(pthread_mutex_unlock(&sh->txpp.mutex)); >> return err; >> } >> >> @@ -944,28 +941,21 @@ mlx5_txpp_stop(struct rte_eth_dev *dev) { >> struct mlx5_priv *priv = dev->data->dev_private; >> struct mlx5_dev_ctx_shared *sh = priv->sh; >> - int ret; >> >> if (!priv->txpp_en) { >> /* Packet pacing is already disabled for the device. */ >> return; >> } >> priv->txpp_en = 0; >> - ret = pthread_mutex_lock(&sh->txpp.mutex); >> - MLX5_ASSERT(!ret); >> - RTE_SET_USED(ret); >> + claim_zero(pthread_mutex_lock(&sh->txpp.mutex)); >> MLX5_ASSERT(sh->txpp.refcnt); >> if (!sh->txpp.refcnt || --sh->txpp.refcnt) { >> - ret = pthread_mutex_unlock(&sh->txpp.mutex); >> - MLX5_ASSERT(!ret); >> - RTE_SET_USED(ret); >> + claim_zero(pthread_mutex_unlock(&sh->txpp.mutex)); >> return; >> } >> /* No references any more, do actual destroy. */ >> mlx5_txpp_destroy(sh); >> - ret = pthread_mutex_unlock(&sh->txpp.mutex); >> - MLX5_ASSERT(!ret); >> - RTE_SET_USED(ret); >> + claim_zero(pthread_mutex_unlock(&sh->txpp.mutex)); >> } >> >> /* >> -- >> 2.18.1 >