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 6002BA0350; Mon, 10 Jan 2022 15:15:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EC35441153; Mon, 10 Jan 2022 15:15:26 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 40FE640041; Mon, 10 Jan 2022 15:15:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1641824125; x=1673360125; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Q7Q7TcSGMw2xX8bFcJIFgRs8DCP5DyP6vzlFWIRrD18=; b=bw3fkPGMyMuTyWj4H3+uBSRRDYrOg0V1JX3TzrSKYTXp61X5JYWuPPAM ubJczg+P4yGqZrnmhU3PsvFjhgyw8ewL8/chsabssdoB+alYhKvFZ4ky7 trWA9+YQ3AmHd+FxV/KEYF1VE443dfbaQ7TdiqYORgPV0dZyveOUhC+fl UZLznkl2bLLWqHnz/8Xwh13Tr9Wekab02kjSM9BKW4mJSf9S4ptDhtt9O vyXo8lWvv4lxzTAsU/jM8QE7epTGSGNoPLY596HVi5Zh7oTNDb1hNBZQ3 BMrffj6PY6VTbXwS+OsE98OvC5PKooJlpCQB0rSEs8DzpQvECWCkt4BQ2 w==; X-IronPort-AV: E=McAfee;i="6200,9189,10222"; a="240783917" X-IronPort-AV: E=Sophos;i="5.88,277,1635231600"; d="scan'208";a="240783917" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2022 06:11:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,277,1635231600"; d="scan'208";a="514683484" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga007.jf.intel.com with ESMTP; 10 Jan 2022 06:11:15 -0800 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 10 Jan 2022 06:11:14 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Mon, 10 Jan 2022 06:11:14 -0800 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.44) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Mon, 10 Jan 2022 06:11:14 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jToykulc6TUeCxGU4piusKR3cpX5hr+nl8bqlXppTY0VczCzEUBNi87ikIaL2Ad09WBakfP0Dvf/MZ+kqDWcT7BqHEq9//SQcMRE41D5QdZJ9SBIFkzvzn8M+1j6gzb4zwyQ7ni/onzjDNGKQgrBxO/pFVvnvlQ8l9uMT2RPzoY63eJDHtJ0rDwjmyBiEI64tZAXRLDZUdbDvOh3kFEcPZ9PH4qBQRPasdwGy35+lVYT+Qm1oZU6oj19I6w9/Sl0Wjcrwu7zrPq0GFABLiEaCvcQUPurBWH1A+Z2T3lCpG9FZqHEGQSUroXSOuvSUilEvrsZ06IsdlK3GwjOXYU9UQ== 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=PziJFJL9O1M5Fek8971F6bxHCM9cCmIYyHEX0ZHAMR0=; b=kLCBHvd2DZwC5lBRC8g2F+3WHCELjglbKyde8ZxaEysmYHs/OHObj1Lcl5grLvf8mMm+YZvTMwer2Cf4UMzsHqu6E6bN22i3kJCuHVzuDOmLvPSmE6F174hnO09NkJwTc0c+Qed+UQrb1eMuFI7u4rDhiAwxuAMuRoZNH8WkGZZdzrsTyb08vVKJ4VrflFASWzKkS2CDb2xch2tqX+22xz3HB4Rq0lfkErz78xAQQPyR5OpwhvRrFRN3oe6CzeO7evNV5jfJqf6PYIgmm7ZdgCNccTaxULzPGWoXCmiVHycK4y84esTyf1hm610VaXrX69WFjpsmeoZRapU9xcRXTw== 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 Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM6PR11MB2730.namprd11.prod.outlook.com (2603:10b6:5:c7::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.11; Mon, 10 Jan 2022 14:11:13 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::7de4:731c:cee2:49c2]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::7de4:731c:cee2:49c2%3]) with mapi id 15.20.4867.012; Mon, 10 Jan 2022 14:11:13 +0000 From: "Ananyev, Konstantin" To: Yunjian Wang , "dev@dpdk.org" CC: "honnappa.nagarahalli@arm.com" , "dingxiaoxiong@huawei.com" , "xudingke@huawei.com" , "stable@dpdk.org" Subject: RE: [dpdk-dev] [PATCH] ring: fix error return value when creating ring Thread-Topic: [dpdk-dev] [PATCH] ring: fix error return value when creating ring Thread-Index: AQHYBgPEETM8YsiezUKdxC6i1ICF1qxcS55g Date: Mon, 10 Jan 2022 14:11:13 +0000 Message-ID: References: <6d7c9da7eb47cb236710a870d91219f1c3ca4684.1641785123.git.wangyunjian@huawei.com> In-Reply-To: <6d7c9da7eb47cb236710a870d91219f1c3ca4684.1641785123.git.wangyunjian@huawei.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c8b9f37f-910f-42b7-8908-08d9d4430f41 x-ms-traffictypediagnostic: DM6PR11MB2730:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: G68VKjrHIcgxFLxPaPpYke0KL6ZEGvlDLYcEnIsrYQTzBbqSnqmswrVBC1IFsZ/iM+TY39kLOutrwU95LJDaNGtHV8ERPIe+8T43iEuamC5gf8U5excddLfBY5ul6FXO9R05rqve3yAElkV6NndZtZuIKFu3Lb7StFvEubGImLl20vk80H/bcvBZGCxS3IISzdqSHopnsUk6CFvwqHmQE3OeR2LV8gcTgD4HCTczKyd9haTlY75wYFm5eH4760N+i84edQjxZYqe3evf33eHFc76gyN42S7gSrpEJE8mQU2dRXJPLP0ZmEMCfbgp2Ajyaog90DyZZ3Urp+CTwnr3EfjWrZOb5MibP3WjBDTOnPsG7iPK0byud/iPPmEXAJG/CigF8J4UDCxMS8MQPXNT3SCL+Lt7j2dszpCppnxOmsABr6ZaBWFFVp8ayEym8+3jbrTnnP4bqojECSz7Ergtjz4fhi46094k9QRln+6CDemoMlxkSeLxdNMFm+TU7Bl1p1ZAVHYJUs+KOuet/Pl4WV4kQgRSEquzx8cdRFmmlBZQNMG8JiUkiptczFxDFcsSsU1ePFi5pxplaWMBgeMnH/pUU2ltUTPe+caAuFJXBsonQ0p94wvD9fhG5KwZalUA0ewWn8FSkd6vOsgro4sVwzqmSYnhshwIv8o2W7B2N0dxjDrpKIl0CHeyBuhkBtgDL9+ibHJLL2I7fIMWcHeNvQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4491.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(66556008)(2906002)(82960400001)(83380400001)(9686003)(508600001)(26005)(186003)(33656002)(55016003)(76116006)(316002)(66946007)(66446008)(86362001)(64756008)(54906003)(110136005)(66476007)(4326008)(5660300002)(8676002)(122000001)(38100700002)(71200400001)(38070700005)(52536014)(6506007)(8936002)(7696005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?8Y7B06dOAvTGBOJufV8LDyu1wzyqqdbakI8zejkrjL7B2kzfZPPURqVlEWX3?= =?us-ascii?Q?41FU7CJGaBTz9TpxSEnSRippgl4wsJaWenrEgppKmVINKVIlKTWFLd8aiGsv?= =?us-ascii?Q?2x84hbWzae58iz75WbJdjSfw/OAze/fehKu6uJ4dSZ/HDSJ6/jmsarSgUd7b?= =?us-ascii?Q?BBYAe/CYDTo9TQLcGl/pDTUZR8DYSgy/3Ic2bSEzDpbzOFwQ/KKfnFE5JNr4?= =?us-ascii?Q?9HRDRG5HQ7eqiy2Y0ktxZIi4Dp+RSwqLw8wu6KBz4T34lCZ+/XMcVbT8CLpF?= =?us-ascii?Q?8Gn2jHCUlwQuRv3dxWhyvs42Ps6g4jCFU9jL96tBjLPW0QibCR837gyn8gc4?= =?us-ascii?Q?FT+hMidea+WC4BJc1j4XqXi6Q6Hyv8t8Mhsw4ZobdZvz28JEca371nuqgWE6?= =?us-ascii?Q?r0FEZAnpIFgGYA8QEBrdv122j7rZqM5ZlCuQJQMQK4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4gAqwhgN8+yJhpdaKh426IOOFRsyjzorddcW7T/vweW?= =?us-ascii?Q?XQl1hbHFgfEgnm3vWKCq2EVaItfYqF2SG3P8tsA3DE3SWonAOX13++/R7005?= =?us-ascii?Q?UX+6IJzz+jWjJTyfHyduWjJ8XYV8sHZNsO/FqeHPHA3gqQ53XE87/Dc2mbMA?= =?us-ascii?Q?mX49Y/2RToz2lOOoCzLVlC0yIYfRPiCL6vtr2GEpuQYIqy4C2zVi89XDo696?= =?us-ascii?Q?DkRpgz8hNNLnzgN33POngI3mRZrtnCfecP848Ma0ENLlBzPt0nrD9jAAhjFP?= =?us-ascii?Q?1NDm9nowNKVyxFs9ToOcN4F544TzH2gZ7hrr8Xo0pIrhq7R6bt1UhJeRXTJD?= =?us-ascii?Q?rrHV1A=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4491.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c8b9f37f-910f-42b7-8908-08d9d4430f41 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jan 2022 14:11:13.2705 (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: jDoGhy0QoLpQxLNY3v5el0IPybXPfKhNF00hxVexKlBDyNWfIkD79pCYvPmnMRgie0IfypGDwqenPvDHhexL3jVIeMFx08tLjhkrtozRW7E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2730 X-OriginatorOrg: intel.com 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 > The error value returned by rte_ring_create_elem() should be positive > integers. However, if the rte_ring_get_memsize_elem() function fails, > a negative number is returned and is directly used as the return value. > As a result, this will cause the external call to check the return > value to fail(like called by rte_mempool_create()). >=20 > Fixes: a182620042aa ("ring: get size in memory") > Cc: stable@dpdk.org >=20 > Reported-by: Nan Zhou > Signed-off-by: Yunjian Wang > --- > lib/ring/rte_ring.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/lib/ring/rte_ring.c b/lib/ring/rte_ring.c > index f17bd966be..185f9be798 100644 > --- a/lib/ring/rte_ring.c > +++ b/lib/ring/rte_ring.c > @@ -267,7 +267,7 @@ rte_ring_create_elem(const char *name, unsigned int e= size, unsigned int count, >=20 > ring_size =3D rte_ring_get_memsize_elem(esize, count); > if (ring_size < 0) { > - rte_errno =3D ring_size; > + rte_errno =3D -ring_size; > return NULL; > } >=20 > -- Acked-by: Konstantin Ananyev > 2.27.0