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 33E53A0C4B for ; Thu, 11 Nov 2021 13:27:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1C77241147; Thu, 11 Nov 2021 13:27:35 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2058.outbound.protection.outlook.com [40.107.220.58]) by mails.dpdk.org (Postfix) with ESMTP id C4AC540E2D; Thu, 11 Nov 2021 13:27:32 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dgquDmXh/nkNBRWs7L7aDgWPg4u97QROUkdsToxSHATYxnlebUDMR4AN4GSVCMUXxSbuP180XyBfrAy63vO8dZmfXK5ELoryuwjUKGMvIuBvJxa+bo+vslPLsruvDNRdrw1dNhRlUXdRSzMOtK3PKtstv2j8LuVdo4INOWLFTEpZ6n+kTN0run8DUMnOs1t0O7nc4Zx6ssbfCe0ZT7Lt8JHzm/tTf7rhoJdopc/CmZsYhgAZVH37AGRw/lyJe/lOdJxyNvDLtaxE85DtwqGzVmzO3icNp2TtSa9MRJts46+pSQF2ERghPwkD/xDnC8RaKUF97H7grsHFPakkitDzxQ== 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=f0uQcOPz/wrFYKRkaAUCJWcatnwEgRNuXZmC06X4jSg=; b=HhNVXywVFAaA+Brd1gyw59ZMn10t56wcNagY5DcZ7dTzao6dA2mPifEa9R9HXrfXcLoiUn3hSFnPQe67Gz9BlxBPhJL8Dr7VH8nXPJFENyc6g4fQfcc0ygZ5dlFtnMqbSoJhTxUNh+Y2LHUYNH2QP3dMdnZleErIR9ILAPqGO/+TKPhWSqlm53Zds2L6YRUa2uKdzL+Zy3e0wbKHH8ewmUsTKKtrE9Ays03+io8A8R95XFXVC/vWuN0jWxeEmxu8mKPmDKkfZavFyvBr1BOviGM7vM3NTcua6wDMeax4oe5afV/0YeLPd7BKKAGs85Y+rifCNcJFBg3S+JInnSyx3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; 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=f0uQcOPz/wrFYKRkaAUCJWcatnwEgRNuXZmC06X4jSg=; b=uErjYCMczqBAQAr7+7aWX+o/DU2hNqo6/6YnLpa+04gcVwPdhFyyyOUSWvN08y8X+jFstBJYMC840hTAm97YmiAvLg0NHJnzlKlOyKjwvmVcWm+snbGObCcZ/xcNY6qw0/tf/GGOH6qgG89zNXTXCqi0YEt/URH2LZu2FVVxd+QT1Z8EuUgHj09dzys/yG9a7WCKqKicXsXfIxZw6+V9kslfnVIKETeFP/lYq42N5snPb1u3hVb3lQJdqzGjx4sFrnJ7dTNIeFeBCBwfiMMLy8CTGfwwcE89eOWimmB0FmJCG41s7qMudECtzlQV0JBw2OTH0N5Vot+QwoxDTnKqCg== Received: from DM6PR12MB3753.namprd12.prod.outlook.com (2603:10b6:5:1c7::18) by DM6PR12MB5024.namprd12.prod.outlook.com (2603:10b6:5:20a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Thu, 11 Nov 2021 12:27:30 +0000 Received: from DM6PR12MB3753.namprd12.prod.outlook.com ([fe80::e550:35a2:96e5:657f]) by DM6PR12MB3753.namprd12.prod.outlook.com ([fe80::e550:35a2:96e5:657f%4]) with mapi id 15.20.4669.016; Thu, 11 Nov 2021 12:27:30 +0000 From: Slava Ovsiienko To: Ferruh Yigit , "dev@dpdk.org" CC: Raslan Darawsheh , Matan Azrad , "stable@dpdk.org" , Chengfeng Ye Subject: RE: [PATCH] net/mlx5: remove redundant "set used" Thread-Topic: [PATCH] net/mlx5: remove redundant "set used" Thread-Index: AQHX1tjfs+lNzlBS506dGdKP2oGSqav+BdSQgAA2CICAAAMLAA== Date: Thu, 11 Nov 2021 12:27:30 +0000 Message-ID: References: <20211111084751.26721-1-viacheslavo@nvidia.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ef3444f7-52fc-415d-1a2b-08d9a50ea17d x-ms-traffictypediagnostic: DM6PR12MB5024: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: P24mEUQs9rtm8ddQqipC0E4YarsMl6ToQvIY+qy9u835PUtTBuSltfdg7Eby951D7nl3xht6TPukHycHmZLKMWOJo7kzq3TB0/C4nVKRbqocuTcLsETUU7k+BEtra5y5dzShhPkoXQykfSpJ44x4i6mUSB0/PAYL1OZzKPbanTn8CCTh+mwj7e3GOpIY8AD+NJR8xq3wRsM0x3bq9DNKklQJ7P1TViNMcV00/It/KDCMXWlUMPy9MWj9Ojzy5463lMj9vgEjmNv+RBkrk6VeeYlDtLokWB3poB0FGLz1O5w8ThCxJ2jyEq/b+w3EInvARPB4kkQk7ODJ6vmPK/qINbi79C9aadYrP0EUqn8/xl0GZidg8WfZ78K7+4jE2utbg7x9nzrX3Iuz2uwC6mrUSWJgqlw7U9w961MBrwcCRLV0R+nHe7QL0+Xt3kiYdiR4BYAYjhsKyKebt1wxAfRcb6ycOEiS9J0DgmiavMKHBTmepAm9h5bokbZN6IpZDy5KSAbh2+j621829wzAlySx6O9Tn/HdHbWKj0P3aVzHkeg+MHnmlRPk0pMFbnWwMU4Au21BdpLyobCgEpqCKwVuegGdHy499Q8iFV5PtnWUJFhzvgTcvfh99F1r3ROcHnW+7jXPz24Uaz0kr0i0t8Xk5I17l0xdbIPdLCqMPVgZ/und7ZH9I2cPeF/0PaoGnSsi1oJoRn5GmDtf9fKj7d7ygJybiWF2OJu5/9JJAY4OKmLy7rW2dl+ESVFaxSRzBlIiOyf91M/2rcLe4ACQNKkN/0TBXKJsvXMhAVxkLC2GAIQ= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB3753.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(966005)(2906002)(508600001)(33656002)(38100700002)(316002)(38070700005)(122000001)(8936002)(7696005)(186003)(8676002)(53546011)(26005)(6506007)(86362001)(9686003)(54906003)(55016002)(76116006)(110136005)(71200400001)(83380400001)(4326008)(66946007)(5660300002)(64756008)(66556008)(66476007)(52536014)(66446008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UcELpsy6Z8IvO7LXihyst2I+G0W4oKSVYs1em5lubGKq53Y62cnYt2/T27jW?= =?us-ascii?Q?pohhIytzRyDECdmq4+znO/X/SXtAVD8Kf/1WcYOIBV5F4fLoGSldj4KtjgqQ?= =?us-ascii?Q?b8r2KHQdCu78fiK+eg9EgQX82DpGEVfL2cEUZy81I6l0JjKIoKWEg/SIl+UP?= =?us-ascii?Q?jNRzXjI4/1kdmtfpY2zQNfN/8TnMKhpn7UR3f2OPaA4/ZdoxOr+TD4GyvxZc?= =?us-ascii?Q?SHOYaUlV8xSI3+A9A/b3S9LlFLYwyiZ0PSuHUsCNliDg34fDluL5DC5JYkBB?= =?us-ascii?Q?/sIMudSt786Pp0iB55p+dkrAeOUkZsmaxmA+foGhVEzFqDXV0A205sxkmJHw?= =?us-ascii?Q?ln8Nw6VwwWI7Yqo7OWfAOcWlSYPJ03Taosk//nRKp00/sX+liQbW1BgKunCI?= =?us-ascii?Q?TKzo9Zd6czosIMo1VPtUmQBZexomWGV0RYulI+C8xr0efzNhniSpl7ODh1Et?= =?us-ascii?Q?vNCmkv41kKAitPXOG//v5LdM8yyb02YzDbcLrEG0lAldR+S77WOLpMVUiIDb?= =?us-ascii?Q?8GkPQ9RqG5cH7JX61JOObN9BileebPfhKY1btURNEyeDkO7e69MbLy7zMLdB?= =?us-ascii?Q?sv+axIDbT/SjmfUu3mSToALe5GRPfsj1CPCI7QBjmKsjQKo1g+Bo4k7EusD6?= =?us-ascii?Q?nMGlU8GqjInKZAVCe8qqtcXppJFmNyx1pyHCKObUrDi2xg5dzWqCCkK91VFN?= =?us-ascii?Q?sXMvCiydpRHPZWrOj9noDx4D0tZIW0Pmc361kFbbVmGFAey4svVn0kYgiVmH?= =?us-ascii?Q?jvu0rhImvlHeA/9ZcRrFH2ZOrkwa2ZWIuUAlALO7DNsKxvNdcyMvYSAn+P2n?= =?us-ascii?Q?Nl3BsED9EGGf0RVF7A1jDWmkdLabecwfZG2Lj+B8YEeKowhS7adqKyZZaJSF?= =?us-ascii?Q?2F6+wBSU2OzJunKCykQ8WCH+1sljKdln81IO7K128+kjLoAzszfI/qopf0GK?= =?us-ascii?Q?Yiy36nEqKgEHpPDLWjQM0wNoKsHc8UlXGjqpCC8KGbK2hiYAa7jmIBoyi35z?= =?us-ascii?Q?twfJRLyiZPvsgTZUBZma9J8rph09Nqzfvrx9+mzj1fxenHHTWA42cKPqDEaz?= =?us-ascii?Q?5uf9XO44JVeXkdVbSx0Z0qZjBtllcVPArA3QICFyf5Xo6POp9Zv5VPYjDyUy?= =?us-ascii?Q?LUtJAXp/LlH4jb30iqWaDyAS+4WcxqSkFsZ3rlO5ioWLlgR1NfX4UzvzBsx3?= =?us-ascii?Q?KkzWmg2NThVRA7uWSvUONFcRXwhEjIHwBaP5gXiXeSC/IwjFLca6Bl/5/xef?= =?us-ascii?Q?tKGXy2dUCSUwWYNXAi22VtqWi788t8n8DbxSNNcLSuReyqjSHaudJZg3gxb/?= =?us-ascii?Q?+QIhKncFnVuNeBwU32qk2Qb8eD4gEthCUtF30C8itr9qPXsxvA8TpSSJbNQM?= =?us-ascii?Q?XSE0ML7K8a+ZMDDnVYEAeguMlPxV8bS752t3wbcXO4cpx3wuluhKMAqONaOa?= =?us-ascii?Q?bKFolQhY/4pHCuXR0ubzjeZAPnVGI6ut9i543XeaTpj+f7Dknm91FKxtS/GX?= =?us-ascii?Q?8iN9l7NgbE17FHJj8rmFWb+NK7l0YfTdEb0+b0Y5VubdgYZ3D1HyVqmUUVWK?= =?us-ascii?Q?uCr917p2pSxauaTyPiO6qpRYEnK8MclkTJbwQHzqTUb4cTHX3/B1FP6EiaQx?= =?us-ascii?Q?+w=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3753.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ef3444f7-52fc-415d-1a2b-08d9a50ea17d X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Nov 2021 12:27:30.6062 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: dGEJ94kKc0vtnrM5yqWni65AeZPtBROeuQP6V76IZPDaXjzDyltNs9eaZSrfJIB6zMwzv+/p1p77Z/gL6O6gyg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB5024 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 Hi, Ferruh > -----Original Message----- > From: Ferruh Yigit > Sent: Thursday, November 11, 2021 14:08 > To: Slava Ovsiienko ; dev@dpdk.org > Cc: Raslan Darawsheh ; Matan Azrad > ; stable@dpdk.org; Chengfeng Ye > > Subject: Re: [PATCH] net/mlx5: remove redundant "set used" >=20 > 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- > viac > > heslavo@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= . > > >=20 > It will cause additional complexity for the LTS, since a small part of th= e 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_ze= ro' > usage? Would be nice, I have no any objections. Chengfeng, could you please, squash (or write by yourself) my proposed upda= tes and send the next version of your patch with "claim_zero()"? > So only your update need to be merged to LTS releases. Yes, agree, it is even better than my proposal. 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 =3D dev->data->dev_private; > >> struct mlx5_dev_ctx_shared *sh =3D priv->sh; > >> int err =3D 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 =3D rte_mbuf_dynflag_lookup > >> - > >> (RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME, NULL); > >> - if (ret < 0) > >> + err =3D rte_mbuf_dynflag_lookup > >> + (RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME, > >> NULL); > >> + /* No flag registered means no service needed. */ > >> + if (err < 0) > >> return 0; > >> + err =3D 0; > >> } > >> - ret =3D 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 =3D 1; > >> ++sh->txpp.refcnt; > >> @@ -924,9 +923,7 @@ mlx5_txpp_start(struct rte_eth_dev *dev) > >> rte_errno =3D -err; > >> } > >> } > >> - ret =3D 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 =3D dev->data->dev_private; > >> struct mlx5_dev_ctx_shared *sh =3D priv->sh; > >> - int ret; > >> > >> if (!priv->txpp_en) { > >> /* Packet pacing is already disabled for the device. */ > >> return; > >> } > >> priv->txpp_en =3D 0; > >> - ret =3D 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 =3D 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 =3D pthread_mutex_unlock(&sh->txpp.mutex); > >> - MLX5_ASSERT(!ret); > >> - RTE_SET_USED(ret); > >> + claim_zero(pthread_mutex_unlock(&sh->txpp.mutex)); > >> } > >> > >> /* > >> -- > >> 2.18.1 > >