From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id E70A8A052A;
	Wed, 23 Dec 2020 10:36:17 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id BD5F7CB33;
	Wed, 23 Dec 2020 10:36:16 +0100 (CET)
Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com
 [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 19EFBCAB9
 for <dev@dpdk.org>; Wed, 23 Dec 2020 10:36:13 +0100 (CET)
Received: from pps.filterd (m0045849.ppops.net [127.0.0.1])
 by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id
 0BN9UXD9023493 for <dev@dpdk.org>; Wed, 23 Dec 2020 01:36:13 -0800
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;
 h=from : to : cc :
 subject : date : message-id : references : in-reply-to : content-type :
 content-transfer-encoding : mime-version; s=pfpt0220;
 bh=hEDX75AYnKo26kOgb4gmLm88f4Zl6JfSX2mwkI5Mtgc=;
 b=AwdVkuGklDG13OruNNYwJcj4OwemCSyqVHIvuDlSv9Hd7AC0ikU+tz1d+A9rs+YzIF0a
 5nXDnzsuLmDioBy8ZE7xgUhCVZ4V60/hOsSmzIr3kCH+ieaGvmTNclzIIagR31gBuMcW
 MXH4wyOcnQf18pi0zCTN+Pe5JzZypr2uXHiipuChu3kbrec+qVDsMVIU59e7lrCETELP
 NMvz0J72meVgd60KkMSK8wz+F0TWJ0ciEehSp+k7UhlNbMchR/2QRbqH3ozTWM7gilHi
 yweabetzFgrzvEDxN2g5rgzTQCH/3Qx8sqoiS/NrFhN6jESg5gfTEQTMGEvPiNNistTF Nw== 
Received: from sc-exch02.marvell.com ([199.233.58.182])
 by mx0a-0016f401.pphosted.com with ESMTP id 35k0ebdruv-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)
 for <dev@dpdk.org>; Wed, 23 Dec 2020 01:36:13 -0800
Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH02.marvell.com
 (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2;
 Wed, 23 Dec 2020 01:36:12 -0800
Received: from SC-EXCH03.marvell.com (10.93.176.83) by DC5-EXCH02.marvell.com
 (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2;
 Wed, 23 Dec 2020 01:36:11 -0800
Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.173)
 by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id
 15.0.1497.2 via Frontend Transport; Wed, 23 Dec 2020 01:36:11 -0800
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=SZyOOOlctdtwY3vAL458MyIsPixjX5kQDH7Exs7NWYnvKuG4AyTRiXXfHuRAwTvjj+H+dlV6YpC3ImxpVDYytuyRusmoAPsLZR6dvliyllIJoEW9EZvgNCVH6kEoue8+r4U+P+PeEj/T+Do88AG1pcMzDAIjccKe6JPylVddghSOdHO4gbcF46fiZhNr93A2Irrzs1xwfO/oQPJbRu3dDArWrcqdPnZ1sXpX5p6J+mPHTMWOvupm0APgindmTYO4kOBP3HGTSNnNX4PeGtDI0HhwV4uY+tVOWcdaTi4sQ1BTgsgn1v9T+wgs5yHghhUmDF1gRCNKzPqF01FkTbyEeA==
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-SenderADCheck;
 bh=hEDX75AYnKo26kOgb4gmLm88f4Zl6JfSX2mwkI5Mtgc=;
 b=ej0zBzdjFqPEyQpoW8TA77l27VCV50vFkunnkgXaey8We1N9tszi8m0xiwbrF50Y6kvO0vAr/AV4yZb/ZxaiTmNWe9ooQJ5owAvbUR/lIIcuuRDIaGP7lFrWNRnFI7yg9xjessJU0DHKhgjcW9uC/dSLBvyTjVGTT4uDlw5hUrOqYQFKPAPyQ0AfWo7J30nE0PBqOAbjVh4ih9pe3PaleMQB6eQem1JryM31wgd8zZs5ZbCl6I+9Hwe8UJQJYxMMUiKtQZWvAKSIIOlFhw/I53XOkZ3GTK/kj354L/2zToZiHPzXXAHVFaATkDfHXADMXY4STNg1BpPH2CHJX461xw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com;
 dkim=pass header.d=marvell.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=hEDX75AYnKo26kOgb4gmLm88f4Zl6JfSX2mwkI5Mtgc=;
 b=Cj0BfYdkTrUNVZY7KTJZbfBJaHw6t9YVKsdJ4cUnMVMnGa/yLKWyFWPaHVyGHSfYOHatQwduGTqgcUOAql4wxgFsDFEijsJWlevjZC2YcMY6GQNlsWzGWFuShz4SisZpubUPQhjrPsX6B2QFnR9xYunvizKPHXV7jMNi2a7pY+0=
Received: from DM5PR1801MB2058.namprd18.prod.outlook.com (2603:10b6:4:67::31)
 by DM6PR18MB2795.namprd18.prod.outlook.com (2603:10b6:5:172::29) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27; Wed, 23 Dec
 2020 09:36:09 +0000
Received: from DM5PR1801MB2058.namprd18.prod.outlook.com
 ([fe80::303b:5c79:93c7:b432]) by DM5PR1801MB2058.namprd18.prod.outlook.com
 ([fe80::303b:5c79:93c7:b432%7]) with mapi id 15.20.3676.033; Wed, 23 Dec 2020
 09:36:09 +0000
From: Michael Shamis <michaelsh@marvell.com>
To: Liron Himi <lironh@marvell.com>, Jerin Jacob Kollanukkaran
 <jerinj@marvell.com>
CC: "dev@dpdk.org" <dev@dpdk.org>, Liron Himi <lironh@marvell.com>
Thread-Topic: [dpdk-dev] [PATCH v1 24/38] net/mvpp2: move common functions to
 common location
Thread-Index: AQHWyJTLgtCXyx9dIEWN6N+Hk4dKjaoEjMMQ
Date: Wed, 23 Dec 2020 09:36:09 +0000
Message-ID: <DM5PR1801MB20585B321507F3F69A5A9605A4DE0@DM5PR1801MB2058.namprd18.prod.outlook.com>
References: <20201202101212.4717-1-lironh@marvell.com>
 <20201202101212.4717-25-lironh@marvell.com>
In-Reply-To: <20201202101212.4717-25-lironh@marvell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [83.130.154.133]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 6d78cf49-abe5-461a-ea4f-08d8a7262e30
x-ms-traffictypediagnostic: DM6PR18MB2795:
x-ms-exchange-transport-forked: True
x-microsoft-antispam-prvs: <DM6PR18MB279585D41E5CAC1E446CF0DBA4DE1@DM6PR18MB2795.namprd18.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:3383;
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: Edf9zq264xTZyQiGYUyaxkTqYo5AqIKc6PdFql+XIXFkAj3GsAMNcgiV3UJJA22ThY9wTE5oGARJNw8fjLeB8b9tYDCT5ZDrXal0T19Kldvr8czAJnUWCYcnDbDmbHnpkM+BJbkjOXTSv3aIixxgGFAf4hYbXHNNvQqPkbHEfBZYw2AwjfLRIgF/vnH4lEAHYmoaYs+b9sF1ZoXtrbziTV9YkwDBSUNJGQXETpcrWhJ+eoWOqJTNugV8021gO088loOjx4kDj2zUZUovjAntqowjeQkJ/3w8ZaGw2Bo0/BmvMShODXjTaIxzwB5JKCT3DPJ92hAD2DYkStzIfONtnbR6gs7drY09/x1C87asrkXlk3gFVRfMvAzujSJ/cUj9GEVx6smOje4JsI2AYqyjjw==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:DM5PR1801MB2058.namprd18.prod.outlook.com; PTR:; CAT:NONE;
 SFS:(4636009)(136003)(396003)(39860400002)(346002)(376002)(366004)(7696005)(26005)(54906003)(2906002)(478600001)(186003)(9686003)(5660300002)(55016002)(83380400001)(4326008)(107886003)(8936002)(66946007)(86362001)(64756008)(66556008)(53546011)(66476007)(6636002)(6506007)(52536014)(33656002)(76116006)(110136005)(71200400001)(66446008)(316002);
 DIR:OUT; SFP:1101; 
x-ms-exchange-antispam-messagedata: =?us-ascii?Q?PxNeAczwfkRUquBdY8weEngXla3MIWyEYRWZQ3x1S7r0gwbwPW4zf7+Wf501?=
 =?us-ascii?Q?SljwH2KqIVflEvvVeMYynXAfH0tl1QBRF//h3Y2Y0HSbPtf1yKze90xbAo/F?=
 =?us-ascii?Q?ct3rS1iA9DYFtpfoQVOt7diMoLxImYgIuV5HXbJn7Hr85B/YGs1C5BHbDgRA?=
 =?us-ascii?Q?y2mgSj5sisVS6V8tMZZS0K500GykNGa8R4UAY3WWI9OQ0y4YU8t8aCkDIJjG?=
 =?us-ascii?Q?XxK/q8qkE38H03WN/ClEkaqs+rdNgSxw9B4ggoeYoJHOPAsWseYawwsZvr1f?=
 =?us-ascii?Q?kUiDfKQoL6EqbQhW/GvPXIApBIAdi7uz4G41mdU4bdZB4s4T02AdFMVEq5qX?=
 =?us-ascii?Q?a6TYgP1pZXs19gFo6+L6yPKCHkeCVq506tDRI89d4TBL8cg8tJH4nCfJFHi7?=
 =?us-ascii?Q?N4A+gmYbQ8liBLyQMpUGuzyQSjNOsB244xSZghUX6h5VRn42cvcQ2Qz4TIMN?=
 =?us-ascii?Q?Z8ueSEJR0x2gQH28cy5QUgTNSRPJTY0ZnMJcwgVAMlXLMCG2aSedPt9ZmRrR?=
 =?us-ascii?Q?XbWK/ezNBVji2X6epuRfzTFynDf4ol5vt4p3B57mfOiSjSMgnEiANnkn/aT9?=
 =?us-ascii?Q?rS9xnmF9t4L3O2XBr1maMTgJPwzvl5MhgA5zjVDcmN+gQ3s056CUDOeW76FE?=
 =?us-ascii?Q?0RN5PWk5Sxz+8MAUhLMcTYCirXXBWr8E/g+tBhhPENpcKaW28UWQ1Lrnzn8T?=
 =?us-ascii?Q?T9T9gaO5Gzn5UuE0atLojTUPqhxBYM7VKm78RI2cSAN60mehyUWNtxeip1xZ?=
 =?us-ascii?Q?PUpFsTPjswXCZrPOetux8VuBYiNa2RqklRbNNZGT1uLbr1NJ3E/xnJvAs7tu?=
 =?us-ascii?Q?UimqkpeO/p8Ti5PfO6Dju74LSXZ43O/3T5aWeONl5Ka0D7VfjuVFDCGspPR/?=
 =?us-ascii?Q?rY4LB47XXDlHOYsK52/uIw3D2DfuZflT/UCvZsghr879D9llDVF6nGYBDJaz?=
 =?us-ascii?Q?XuG8y8XWNI8d0/yWP5gW1qrogm5r8skZP1n9eDI7Lwg=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: DM5PR1801MB2058.namprd18.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6d78cf49-abe5-461a-ea4f-08d8a7262e30
X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Dec 2020 09:36:09.7399 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 48/NxMyATnO3c4DZhWYomhgiazoKvXNNHvxzhyhXYmdk3nvi08Laly02QcEIQ/woAmeFeehjPV4Lm3PLTxlnyw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR18MB2795
X-OriginatorOrg: marvell.com
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343, 18.0.737
 definitions=2020-12-23_04:2020-12-21,
 2020-12-23 signatures=0
Subject: Re: [dpdk-dev] [PATCH v1 24/38] net/mvpp2: move common functions
	to	common location
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

Reviewed-by: Michael Shamis <michaelsh@marvell.com>

-----Original Message-----
From: dev <dev-bounces@dpdk.org> On Behalf Of lironh@marvell.com
Sent: Wednesday, December 2, 2020 12:12 PM
To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
Cc: dev@dpdk.org; Liron Himi <lironh@marvell.com>
Subject: [dpdk-dev] [PATCH v1 24/38] net/mvpp2: move common functions to co=
mmon location

From: Liron Himi <lironh@marvell.com>

move common functions to common location

Signed-off-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
---
 drivers/net/mvpp2/mrvl_ethdev.h | 41 +++++++++++++++++++++++++++++++++
 drivers/net/mvpp2/mrvl_qos.c    | 24 -------------------
 2 files changed, 41 insertions(+), 24 deletions(-)

diff --git a/drivers/net/mvpp2/mrvl_ethdev.h b/drivers/net/mvpp2/mrvl_ethde=
v.h index be5e5a51b..5dbd8b46c 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.h
+++ b/drivers/net/mvpp2/mrvl_ethdev.h
@@ -197,4 +197,45 @@ extern int mrvl_logtype;
 	rte_log(RTE_LOG_ ## level, mrvl_logtype, "%s(): " fmt "\n", \
 		__func__, ##args)
=20
+/**
+ * Convert string to uint32_t with extra checks for result correctness.
+ *
+ * @param string String to convert.
+ * @param val Conversion result.
+ * @returns 0 in case of success, negative value otherwise.
+ */
+static int
+get_val_securely(const char *string, uint32_t *val) {
+	char *endptr;
+	size_t len =3D strlen(string);
+
+	if (len =3D=3D 0)
+		return -1;
+
+	errno =3D 0;
+	*val =3D strtoul(string, &endptr, 0);
+	if (errno !=3D 0 || RTE_PTR_DIFF(endptr, string) !=3D len)
+		return -2;
+
+	return 0;
+}
+
+static int
+get_val_securely8(const char *string, uint32_t base, uint8_t *val) {
+	char *endptr;
+	size_t len =3D strlen(string);
+
+	if (len =3D=3D 0)
+		return -1;
+
+	errno =3D 0;
+	*val =3D (uint8_t)strtoul(string, &endptr, base);
+	if (errno !=3D 0 || RTE_PTR_DIFF(endptr, string) !=3D len)
+		return -2;
+
+	return 0;
+}
+
 #endif /* _MRVL_ETHDEV_H_ */
diff --git a/drivers/net/mvpp2/mrvl_qos.c b/drivers/net/mvpp2/mrvl_qos.c in=
dex d8f6dd5c6..1c65b5276 100644
--- a/drivers/net/mvpp2/mrvl_qos.c
+++ b/drivers/net/mvpp2/mrvl_qos.c
@@ -74,30 +74,6 @@
 /** Global configuration. */
 struct mrvl_cfg *mrvl_cfg;
=20
-/**
- * Convert string to uint32_t with extra checks for result correctness.
- *
- * @param string String to convert.
- * @param val Conversion result.
- * @returns 0 in case of success, negative value otherwise.
- */
-static int
-get_val_securely(const char *string, uint32_t *val) -{
-	char *endptr;
-	size_t len =3D strlen(string);
-
-	if (len =3D=3D 0)
-		return -1;
-
-	errno =3D 0;
-	*val =3D strtoul(string, &endptr, 0);
-	if (errno !=3D 0 || RTE_PTR_DIFF(endptr, string) !=3D len)
-		return -2;
-
-	return 0;
-}
-
 /**
  * Read out-queue configuration from file.
  *
--
2.28.0