From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 49CA5A0350; Mon, 11 May 2020 00:53:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CDC101D15F; Mon, 11 May 2020 00:53:55 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 8AC401D15D for ; Mon, 11 May 2020 00:53:53 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04AMrniR002223; Sun, 10 May 2020 15:53:49 -0700 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=pfpt0818; bh=pvmd9pJICEZ20dBO0o2PAEHaehmBIVDmvh24WjDXe8w=; b=nCMmzwgTbhcJ9iw5RtRTY4jHGlo4OiHIDkZa1dN5iHA4INcHp4u0/A2ilekWEL/pIXri FFyPgV0vH+2qy+jrq+K6hb7qw5poDqISFKR4FkMdGFNXz61tr9q8Fiiaj7VGlwufiTjg lflOYt9BDelulBkjOWbbylXlHel21G49vCnQvMIDy5LX2uzQYd3FD3vK1ht8iwHfInAt CpZM5UGkjfWsYIzjamgaEcUvh9wh5O1qlznbV07gohzv+5hO45uZsPOZ5aQV6p/Bl7TH qm3DI/Ex7uIoiPC9UwG+M2+yK50vdZT8qSbGvz2CzX6ujwegcjP8PH5mHKsMHnyVoIFx UA== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 30wsvqcvcu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 10 May 2020 15:53:49 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 10 May 2020 15:53:47 -0700 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; Sun, 10 May 2020 15:53:47 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.171) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Sun, 10 May 2020 15:53:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LoMa30Vje5zf2Kx1jGWfbC8a5pmcKA7ttSqL5TRoTVW2SQd1p/AtnS33FE1wRWB9LJifq8k1voYktnfjRkP72TWyu9g6+GbIi2gASLfLx8p3vLj4xUghW/BaOA69QvI8sqBTSe+r2d/s1C3o2W0Gcs0vIPRqhdhJRCfEHCf9lxUwNP9uj8kVkNnrOZrEzY74XOZNqyUnJdEddY2IXQIsjCyLJ+F7x0MB4dnodUtnjWX9MDUyHRpUiWUEghE/9IaZ/wMULYSl5uwAtSe0+JFcNPAr1/JaWcMjjamrcS9JQ/fWf0g2HsHv0QlbTh1s0Vl8KMErf/hllvbN2U9aK1C40g== 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=pvmd9pJICEZ20dBO0o2PAEHaehmBIVDmvh24WjDXe8w=; b=ZFp/AIrWm4rqbRZvQphYR5ZoCG2CZA6wurlnoag5emjGnn8YV1F9eQ8iXq1EcTyoOpMQfvxiqSZgPENCLS+NJT7AcCubMAYw49e96Y01jztKucc/8yP1nAjuAfFgP3+Sz4/nOB3s2lJ3/QnBkqTS663knlCs2WwSt6CTVxx0IuFi36a4kVzY9R17wRL9x1+s/ynvkB3zzC+QlG0ejNk5V/VANetm9CJhG28LOMsi4vn2QnZsPMd2rtumArDC/+hQ6VKUdWgJbY5HdrtqyARwfmNUDgNHrG3ovZOYw4N2yDXE1FrVRizC6t4+Hw8pQoL3xsHfmLKQNbeCARiXsp0mRg== 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=pvmd9pJICEZ20dBO0o2PAEHaehmBIVDmvh24WjDXe8w=; b=WIiyzk+SGAWcog42LVByNEE/vb+RS6md9zcn6aoO050bH8Aj9LxXKs74/LkMhyYt/Sf6k8XH+2MlusAP+HXVaXUQDF/UmeaJG6he3OUsNyMC2naM5qjgM1KLLHngnmWMME6G9P6zwYyLh8PZL2m57Gs1s+l48Z+dUxNmEXIgGaA= Received: from BYAPR18MB2518.namprd18.prod.outlook.com (2603:10b6:a03:13b::18) by BYAPR18MB3077.namprd18.prod.outlook.com (2603:10b6:a03:10a::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Sun, 10 May 2020 22:53:45 +0000 Received: from BYAPR18MB2518.namprd18.prod.outlook.com ([fe80::fca4:5e00:46d9:a289]) by BYAPR18MB2518.namprd18.prod.outlook.com ([fe80::fca4:5e00:46d9:a289%3]) with mapi id 15.20.2979.033; Sun, 10 May 2020 22:53:45 +0000 From: Pavan Nikhilesh Bhagavatula To: "Ananyev, Konstantin" , "Jerin Jacob Kollanukkaran" , "thomas@monjalon.net" , "Wang, Yipeng1" , "Gobriel, Sameh" , "Richardson, Bruce" , Ruifeng Wang CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [RFC] hash: unify crc32 API header for x86 and ARM Thread-Index: AQHWJTgHo7IAeERCXE2KuklKRB3ozKih8Afg Date: Sun, 10 May 2020 22:53:45 +0000 Message-ID: References: <20200429180515.5704-1-pbhagavatula@marvell.com> In-Reply-To: Accept-Language: en-IN, 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=marvell.com; x-originating-ip: [223.226.86.58] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fdb52e82-0956-4794-653c-08d7f534feb1 x-ms-traffictypediagnostic: BYAPR18MB3077: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 039975700A x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: HLWPAZv6JMU0rHbVB6iaScrHe3IJd4dDJW2SS9BsGeoS/ugeM9bqCkNJNzcjqMWy/zf6Y9McX9UV1LcI3gIa5oFNpmzoJM7OfroAbyEttC3+QoyHN2y58HDczpGrY4kO0PyJyDCm7Y5MiwEGQIEJyHM8/mRW9l/rJTl9m91mdlh3j6+ZnQZRCy9+3kCRZJvhG5kTStadH2fWXfkq1MEMeriuNUSxNQo9Yq99T3YNMv9BiZ9fwbsGJJtytQ3QhvbRB1ZbVoXYySrvN4NYGT7sHP5XhxIZuqcZcoXvJ+wWP8ti7px64kBgNxf9U0aBVUI8Evrf0MhccsLgPAJREuxZim37aRcCv765J4F5Xykf2gvyrErfPfZiyjA9XduyVfNwgAnrBz+QTWS6tHCVA7323sYSgIJm0tbG4CHUbyvjeBUMNkdCuJ1j+KOVCofcRqQaDiu4at5Ed1GnXM2yG/RChJtAHSF4FYy/v2aQITEnKr4F/iby41lFT0+LWhftqt9KWizZWsAtxoTRPQbJRRWq6WH29ZRovriCubFxaQjnT0I= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR18MB2518.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(396003)(39850400004)(366004)(376002)(136003)(33430700001)(478600001)(26005)(33656002)(316002)(9686003)(4326008)(8676002)(110136005)(55016002)(5660300002)(8936002)(71200400001)(55236004)(64756008)(66556008)(6506007)(186003)(33440700001)(66476007)(76116006)(66446008)(2906002)(66946007)(86362001)(52536014)(7696005)(921003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: GM8LCyD0dZ5BTGqDpyyJeC8edkZ6tlYEEgfK7RaeBdt3LPAkwfGUUAAwvGqP2QnvwjMTwYqQL72jvWoLCB1CcrUnO2SwbAdFa6R5mw01Dm5jAmCQSprltqio07RvK+ZsRykBOOvjEwDKkl04VSrRFN87CqC4b4vJyQAqDGY8EizBN+NKC/02MV1lWi2fx/cA0cDgxcIkhK0lPir7EKpzRKp3a14kVKmB4LsqL4nB6H5RccgmBLjUiizx/R84mUM2vG3vqf3ggw/0CvupyYbIB9eeXtUjD8A0vDiXrxIyIrj2sogQ0Rr3SN5uTRnJuaNyhY9hYAybjkw9+thJa0Kdvj1ZFYx3+OxicaOXW2TrK1gfiij+pM27u7aZtQPlJo3dHF6M9iq/wVlCHBhxN9X9oXNGW0A5UBhbpZSn5DNUclrMXBXQQvr1fig2OkcDI+odGfhBofVOp69ejibrcqx9cM7QlboMR90LpVMxziF7UBc= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: fdb52e82-0956-4794-653c-08d7f534feb1 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 May 2020 22:53:45.4368 (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: KFEjXe7GKHa0zMxwRVVu/MDZNOnZSiDL1iEOPEaEqUOpYWAZhnGIa4XM96keASVOTOkUAYr634pmYEHpYj6SopOyzB9PaxogwhTMjpZtQPM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR18MB3077 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-10_11:2020-05-08, 2020-05-10 signatures=0 Subject: Re: [dpdk-dev] [RFC] hash: unify crc32 API header for x86 and ARM X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" >> From: Pavan Nikhilesh >> >> Merge crc32 hash calculation public API headers for x86 and ARM, >> split implementations of x86 and ARM into their respective private >> headers. >> This reduces the ifdef code clutter while keeping current ABI intact. >> >> Although we install `rte_crc_arm64.h` it is not used in any of the lib o= r >> drivers layers. All the libs and drivers use `rte_hash_crc.h` which fall= s >> back to SW crc32 calculation for ARM platform. >> >> Signed-off-by: Pavan Nikhilesh >> --- >> >> Currently, if application incorrectly sets CRC32_ARM64 as crc32 >algorithm >> through `rte_hash_crc_set_alg()` on x86 or vice-versa we fallback to >algorithm >> set previously via `rte_hash_crc_set_alg()` instead of setting the best >> available. >> This behaviour should probably change to setting the best available >algorithm >> and is up for discussion. >> >> app/test/test_hash.c | 6 + >> lib/librte_hash/Makefile | 5 - >> lib/librte_hash/crc_arm64.h | 67 +++++++++++ >> lib/librte_hash/crc_x86.h | 68 +++++++++++ >> lib/librte_hash/meson.build | 3 +- >> lib/librte_hash/rte_crc_arm64.h | 183 ------------------------------ >> lib/librte_hash/rte_hash_crc.h | 193 +++++++++++++------------------ >- >> 7 files changed, 219 insertions(+), 306 deletions(-) >> create mode 100644 lib/librte_hash/crc_arm64.h >> create mode 100644 lib/librte_hash/crc_x86.h >> delete mode 100644 lib/librte_hash/rte_crc_arm64.h >> >> diff --git a/app/test/test_hash.c b/app/test/test_hash.c >> index afa3a1a3c..7bd457dac 100644 >> --- a/app/test/test_hash.c >> +++ b/app/test/test_hash.c >> @@ -195,7 +195,13 @@ test_crc32_hash_alg_equiv(void) >> } >> >> /* Resetting to best available algorithm */ >> +#if defined RTE_ARCH_X86 >> rte_hash_crc_set_alg(CRC32_SSE42_x64); >> +#elif defined RTE_ARCH_ARM64 >> + rte_hash_crc_set_alg(CRC32_ARM64); >> +#else >> + rte_hash_crc_set_alg(CRC32_SW); >> +#endif >> >> if (i =3D=3D CRC32_ITERATIONS) >> return 0; >> diff --git a/lib/librte_hash/Makefile b/lib/librte_hash/Makefile >> index ec9f86499..f640afc42 100644 >> --- a/lib/librte_hash/Makefile >> +++ b/lib/librte_hash/Makefile >> @@ -19,11 +19,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_HASH) +=3D >rte_fbk_hash.c >> # install this header file >> SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include :=3D rte_hash.h >> SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include +=3D rte_hash_crc.h >> -ifeq ($(CONFIG_RTE_ARCH_ARM64),y) >> -ifneq ($(findstring RTE_MACHINE_CPUFLAG_CRC32,$(CFLAGS)),) >> -SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include +=3D rte_crc_arm64.h >> -endif >> -endif >> SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include +=3D rte_jhash.h >> SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include +=3D rte_thash.h >> SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include +=3D rte_fbk_hash.h >> diff --git a/lib/librte_hash/crc_arm64.h b/lib/librte_hash/crc_arm64.h >> new file mode 100644 >> index 000000000..8e75f8297 > >Wouldn't that break 'make install T=3D...'? My bad I verified with meson and it was building fine. >As now rte_hash_crc.h includes not public headers (crc_x86.h, etc.). >Same question about external apps, where they would get from these >headers? I think in the next version we can directly have the arch specific function= s Implemented in rte_hash_crc.h. Since its pretty stable code and overhead of= extra=20 ~120 lines. > >> --- /dev/null >> +++ b/lib/librte_hash/crc_arm64.h >> @@ -0,0 +1,67 @@ >> +/* SPDX-License-Identifier: BSD-3-Clause >> + * Copyright(c) 2015 Cavium, Inc >> + */ >> +