From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10078.outbound.protection.outlook.com [40.107.1.78]) by dpdk.org (Postfix) with ESMTP id 4AB0F3256 for ; Fri, 7 Sep 2018 12:20:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HGgJsg+s/cHsxtM+VAahKVHiL4jEtpHMX1ztTgndfEk=; b=kaS6TiZxXeuu0nBwoKApbJMFFlvq1Nv0wKdBjQggc2SXddhv02bXLaTb3NsdTnc7Ue8elepKx5bot4xs0V73Y6xcHuV9023eDL71U8STjzIOEbhpAhV+Kvdoei2uioyNqSoDzoGfJVcW/7QPmEuF+Xq1LekWvKGWOW3YGIepEgo= Received: from VI1PR08MB3167.eurprd08.prod.outlook.com (52.133.15.142) by VI1PR08MB0736.eurprd08.prod.outlook.com (10.163.169.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16; Fri, 7 Sep 2018 10:20:31 +0000 Received: from VI1PR08MB3167.eurprd08.prod.outlook.com ([fe80::b91d:e285:4647:f3e8]) by VI1PR08MB3167.eurprd08.prod.outlook.com ([fe80::b91d:e285:4647:f3e8%2]) with mapi id 15.20.1101.019; Fri, 7 Sep 2018 10:20:31 +0000 From: "Gavin Hu (Arm Technology China)" To: Kevin Laatz , "dev@dpdk.org" CC: "cristian.dumitrescu@intel.com" , Jianbo Liu , "jerin.jacob@caviumnetworks.com" Thread-Topic: [PATCH v3 3/3] net/softnic: modify softnic to use librte_table headers Thread-Index: AQHURpJ5s6c8U8s/GEyUfuhLkR3XGKTkm5kg Date: Fri, 7 Sep 2018 10:20:31 +0000 Message-ID: References: <20180907100626.8165-1-kevin.laatz@intel.com> <20180907100626.8165-3-kevin.laatz@intel.com> In-Reply-To: <20180907100626.8165-3-kevin.laatz@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Gavin.Hu@arm.com; x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR08MB0736; 6:mHE0eBrFFCZir7G590Xk1re0TsKt0rQIPEjMGUl+8UfeEignVd8PTwnmhas4zQqZ2QLMwF57omC5JbPH2BojIReIMF+MPwNs43f1ZEtJp+5DDXgJmRrQnrAdBhSL8bs6++f6QuaACCkT0ePWLrb5LnmwOooy0GYCxuIcp6ACAhm+4lmI1X1zbq5q3XjD2MI254n4NbJ/awIOFrdJAeIzZyu1//4wggv1V9TgCekPvw6966p6hWQWHjsvW9fH46MUw3SbF4zJUuvrH2tAaJqXEKgn76Fo+dACO6w+oNEc03qi/nfsTC1JJv6VC5E1RE9A9fphXz9Gxua1g0lp450jLn2r1aASdfAiphOrvnLv3mvBZKiXV461JMzfO1hy8yv0URka0fo0Kifd+vPOE7FU3dxV1M2cXvYF59osVDt7dxpBoSfS1qNaoRKDxc8IZJdFCcD6NM2U+irn2FA+kBiO9A==; 5:PqGxnM7iQauydb4JAmyJE5j/9Ep93QnxogPlsCYWuh8SrGnor+6VFrRAp1+3L7CC+EyjRM2Upn2K6G/W1qqCEooRZqb4cBbWOe1rFFECcQrX4uWKwbr+3WLgkPedD84NNRgGDSwe3lZCjUJTXOpSaK5iRd2Wj7vtYKSSioav5dg=; 7:+ycPdR+sDSTA+rN1kVwg0VxRHzI0JDotYtewQQMwFpnCIpMocm63BRgzH+nczWddkLFnCJ82zKqZjzCOgxYk3iPMMZn8+GCVgD+WLNNJJkTSC0s0sEskqyZyT5bTnSzcCi8FncWe6nbAHa3YQX4peLSFNRim4xt6uoqirSOO4K23tHMnoo+aFv7sHJQIlVKbMPPSrc5gdg9yGEkE8UwJfbZK/VyHQcAUJC0oqW6TRLBSNIJQ1StTAkv022pB62UK x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-ms-office365-filtering-correlation-id: dfab4e45-51d4-4c4b-2ef8-08d614ab8a75 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR08MB0736; x-ms-traffictypediagnostic: VI1PR08MB0736: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(103651359005742)(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699050); SRVR:VI1PR08MB0736; BCL:0; PCL:0; RULEID:; SRVR:VI1PR08MB0736; x-forefront-prvs: 07880C4932 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(136003)(366004)(396003)(376002)(346002)(39860400002)(40434004)(199004)(189003)(13464003)(81166006)(305945005)(7736002)(6436002)(229853002)(97736004)(2900100001)(66066001)(2906002)(14454004)(5660300001)(3846002)(6116002)(256004)(5024004)(14444005)(25786009)(486006)(9686003)(4326008)(55016002)(68736007)(53936002)(55236004)(8676002)(72206003)(102836004)(33656002)(2501003)(186003)(110136005)(478600001)(105586002)(99286004)(6506007)(53546011)(54906003)(11346002)(53946003)(26005)(316002)(446003)(8936002)(7696005)(5250100002)(74316002)(81156014)(76176011)(86362001)(476003)(106356001)(6246003)(575784001)(579004)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB0736; H:VI1PR08MB3167.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 70WERfJRHRBRt2vzV0yfvALBKnKfKogLgz2CWLSIgU+Q9rECZfGoXg6Ec1oXJgS8bMHCIFsucpHgE3ZWAFRKHgMn8XOCd8+npTF1TKLbu3u7jvtAP5pgCPQksuMWloinm//wCtXgThLSnznRAxySvAaWG9hR+xahR+2hCtBPBPcM+LcvA3EgJPQBYEm430YXidcY6f1C+u+09tNAJf8hL8iFGbTQh1/Kx5qAZ/vlpajnZgtmtV/u0HjXZahpel0LhJY125ZT0T3Eo0xfJ9IRH9yirtf5xnOW3zK5agc84mW8NVu1qtLwT5nJrIUk3Gzt2BtxoZwrxLRqMMnCH3dBqPu6uyXYa8xmkvn5dHggQss= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: dfab4e45-51d4-4c4b-2ef8-08d614ab8a75 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Sep 2018 10:20:31.2996 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB0736 Subject: Re: [dpdk-dev] [PATCH v3 3/3] net/softnic: modify softnic to use librte_table headers 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: , X-List-Received-Date: Fri, 07 Sep 2018 10:20:33 -0000 > -----Original Message----- > From: Kevin Laatz > Sent: Friday, September 7, 2018 6:06 PM > To: dev@dpdk.org > Cc: cristian.dumitrescu@intel.com; Jianbo Liu ; Gavin > Hu (Arm Technology China) ; > jerin.jacob@caviumnetworks.com; Kevin Laatz > Subject: [PATCH v3 3/3] net/softnic: modify softnic to use librte_table > headers > > This commit modifies SoftNIC to make use of the new header files in > librte_table. > > As we are now using the new header files in librte_table in SoftNIC, we n= o > longer need the old header files so they can be removed. > > Signed-off-by: Cristian Dumitrescu > Signed-off-by: Kevin Laatz Acked-by: Gavin Hu > --- > drivers/net/softnic/hash_func.h | 359 -------------------= ------ > drivers/net/softnic/hash_func_arm64.h | 261 ------------------ > drivers/net/softnic/rte_eth_softnic_action.c | 34 +-- > drivers/net/softnic/rte_eth_softnic_pipeline.c | 19 +- > 4 files changed, 26 insertions(+), 647 deletions(-) delete mode 100644 > drivers/net/softnic/hash_func.h delete mode 100644 > drivers/net/softnic/hash_func_arm64.h > > diff --git a/drivers/net/softnic/hash_func.h > b/drivers/net/softnic/hash_func.h deleted file mode 100644 index > 198d2b2..0000000 > --- a/drivers/net/softnic/hash_func.h > +++ /dev/null > @@ -1,359 +0,0 @@ > -/* SPDX-License-Identifier: BSD-3-Clause > - * Copyright(c) 2010-2018 Intel Corporation > - */ > - > -#ifndef __INCLUDE_HASH_FUNC_H__ > -#define __INCLUDE_HASH_FUNC_H__ > - > -#include > - > -static inline uint64_t > -hash_xor_key8(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t xor0; > - > -xor0 =3D seed ^ (k[0] & m[0]); > - > -return (xor0 >> 32) ^ xor0; > -} > - > -static inline uint64_t > -hash_xor_key16(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t xor0; > - > -xor0 =3D ((k[0] & m[0]) ^ seed) ^ (k[1] & m[1]); > - > -return (xor0 >> 32) ^ xor0; > -} > - > -static inline uint64_t > -hash_xor_key24(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t xor0; > - > -xor0 =3D ((k[0] & m[0]) ^ seed) ^ (k[1] & m[1]); > - > -xor0 ^=3D k[2] & m[2]; > - > -return (xor0 >> 32) ^ xor0; > -} > - > -static inline uint64_t > -hash_xor_key32(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t xor0, xor1; > - > -xor0 =3D ((k[0] & m[0]) ^ seed) ^ (k[1] & m[1]); > -xor1 =3D (k[2] & m[2]) ^ (k[3] & m[3]); > - > -xor0 ^=3D xor1; > - > -return (xor0 >> 32) ^ xor0; > -} > - > -static inline uint64_t > -hash_xor_key40(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t xor0, xor1; > - > -xor0 =3D ((k[0] & m[0]) ^ seed) ^ (k[1] & m[1]); > -xor1 =3D (k[2] & m[2]) ^ (k[3] & m[3]); > - > -xor0 ^=3D xor1; > - > -xor0 ^=3D k[4] & m[4]; > - > -return (xor0 >> 32) ^ xor0; > -} > - > -static inline uint64_t > -hash_xor_key48(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t xor0, xor1, xor2; > - > -xor0 =3D ((k[0] & m[0]) ^ seed) ^ (k[1] & m[1]); > -xor1 =3D (k[2] & m[2]) ^ (k[3] & m[3]); > -xor2 =3D (k[4] & m[4]) ^ (k[5] & m[5]); > - > -xor0 ^=3D xor1; > - > -xor0 ^=3D xor2; > - > -return (xor0 >> 32) ^ xor0; > -} > - > -static inline uint64_t > -hash_xor_key56(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t xor0, xor1, xor2; > - > -xor0 =3D ((k[0] & m[0]) ^ seed) ^ (k[1] & m[1]); > -xor1 =3D (k[2] & m[2]) ^ (k[3] & m[3]); > -xor2 =3D (k[4] & m[4]) ^ (k[5] & m[5]); > - > -xor0 ^=3D xor1; > -xor2 ^=3D k[6] & m[6]; > - > -xor0 ^=3D xor2; > - > -return (xor0 >> 32) ^ xor0; > -} > - > -static inline uint64_t > -hash_xor_key64(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t xor0, xor1, xor2, xor3; > - > -xor0 =3D ((k[0] & m[0]) ^ seed) ^ (k[1] & m[1]); > -xor1 =3D (k[2] & m[2]) ^ (k[3] & m[3]); > -xor2 =3D (k[4] & m[4]) ^ (k[5] & m[5]); > -xor3 =3D (k[6] & m[6]) ^ (k[7] & m[7]); > - > -xor0 ^=3D xor1; > -xor2 ^=3D xor3; > - > -xor0 ^=3D xor2; > - > -return (xor0 >> 32) ^ xor0; > -} > - > -#if defined(RTE_ARCH_X86_64) > - > -#include > - > -static inline uint64_t > -hash_crc_key8(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t crc0; > - > -crc0 =3D _mm_crc32_u64(seed, k[0] & m[0]); > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key16(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t k0, crc0, crc1; > - > -k0 =3D k[0] & m[0]; > - > -crc0 =3D _mm_crc32_u64(k0, seed); > -crc1 =3D _mm_crc32_u64(k0 >> 32, k[1] & m[1]); > - > -crc0 ^=3D crc1; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key24(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t k0, k2, crc0, crc1; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > - > -crc0 =3D _mm_crc32_u64(k0, seed); > -crc1 =3D _mm_crc32_u64(k0 >> 32, k[1] & m[1]); > - > -crc0 =3D _mm_crc32_u64(crc0, k2); > - > -crc0 ^=3D crc1; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key32(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t k0, k2, crc0, crc1, crc2, crc3; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > - > -crc0 =3D _mm_crc32_u64(k0, seed); > -crc1 =3D _mm_crc32_u64(k0 >> 32, k[1] & m[1]); > - > -crc2 =3D _mm_crc32_u64(k2, k[3] & m[3]); > -crc3 =3D k2 >> 32; > - > -crc0 =3D _mm_crc32_u64(crc0, crc1); > -crc1 =3D _mm_crc32_u64(crc2, crc3); > - > -crc0 ^=3D crc1; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key40(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t k0, k2, crc0, crc1, crc2, crc3; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > - > -crc0 =3D _mm_crc32_u64(k0, seed); > -crc1 =3D _mm_crc32_u64(k0 >> 32, k[1] & m[1]); > - > -crc2 =3D _mm_crc32_u64(k2, k[3] & m[3]); > -crc3 =3D _mm_crc32_u64(k2 >> 32, k[4] & m[4]); > - > -crc0 =3D _mm_crc32_u64(crc0, crc1); > -crc1 =3D _mm_crc32_u64(crc2, crc3); > - > -crc0 ^=3D crc1; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key48(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t k0, k2, k5, crc0, crc1, crc2, crc3; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > -k5 =3D k[5] & m[5]; > - > -crc0 =3D _mm_crc32_u64(k0, seed); > -crc1 =3D _mm_crc32_u64(k0 >> 32, k[1] & m[1]); > - > -crc2 =3D _mm_crc32_u64(k2, k[3] & m[3]); > -crc3 =3D _mm_crc32_u64(k2 >> 32, k[4] & m[4]); > - > -crc0 =3D _mm_crc32_u64(crc0, (crc1 << 32) ^ crc2); > -crc1 =3D _mm_crc32_u64(crc3, k5); > - > -crc0 ^=3D crc1; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key56(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t k0, k2, k5, crc0, crc1, crc2, crc3, crc4, crc5; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > -k5 =3D k[5] & m[5]; > - > -crc0 =3D _mm_crc32_u64(k0, seed); > -crc1 =3D _mm_crc32_u64(k0 >> 32, k[1] & m[1]); > - > -crc2 =3D _mm_crc32_u64(k2, k[3] & m[3]); > -crc3 =3D _mm_crc32_u64(k2 >> 32, k[4] & m[4]); > - > -crc4 =3D _mm_crc32_u64(k5, k[6] & m[6]); > -crc5 =3D k5 >> 32; > - > -crc0 =3D _mm_crc32_u64(crc0, (crc1 << 32) ^ crc2); > -crc1 =3D _mm_crc32_u64(crc3, (crc4 << 32) ^ crc5); > - > -crc0 ^=3D crc1; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key64(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t k0, k2, k5, crc0, crc1, crc2, crc3, crc4, crc5; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > -k5 =3D k[5] & m[5]; > - > -crc0 =3D _mm_crc32_u64(k0, seed); > -crc1 =3D _mm_crc32_u64(k0 >> 32, k[1] & m[1]); > - > -crc2 =3D _mm_crc32_u64(k2, k[3] & m[3]); > -crc3 =3D _mm_crc32_u64(k2 >> 32, k[4] & m[4]); > - > -crc4 =3D _mm_crc32_u64(k5, k[6] & m[6]); > -crc5 =3D _mm_crc32_u64(k5 >> 32, k[7] & m[7]); > - > -crc0 =3D _mm_crc32_u64(crc0, (crc1 << 32) ^ crc2); > -crc1 =3D _mm_crc32_u64(crc3, (crc4 << 32) ^ crc5); > - > -crc0 ^=3D crc1; > - > -return crc0; > -} > - > -#define hash_default_key8hash_crc_key8 > -#define hash_default_key16hash_crc_key16 > -#define hash_default_key24hash_crc_key24 > -#define hash_default_key32hash_crc_key32 > -#define hash_default_key40hash_crc_key40 > -#define hash_default_key48hash_crc_key48 > -#define hash_default_key56hash_crc_key56 > -#define hash_default_key64hash_crc_key64 > - > -#elif defined(RTE_ARCH_ARM64) > -#include "hash_func_arm64.h" > -#else > - > -#define hash_default_key8hash_xor_key8 > -#define hash_default_key16hash_xor_key16 > -#define hash_default_key24hash_xor_key24 > -#define hash_default_key32hash_xor_key32 > -#define hash_default_key40hash_xor_key40 > -#define hash_default_key48hash_xor_key48 > -#define hash_default_key56hash_xor_key56 > -#define hash_default_key64hash_xor_key64 > - > -#endif > - > -#endif > diff --git a/drivers/net/softnic/hash_func_arm64.h > b/drivers/net/softnic/hash_func_arm64.h > deleted file mode 100644 > index ae6c0f4..0000000 > --- a/drivers/net/softnic/hash_func_arm64.h > +++ /dev/null > @@ -1,261 +0,0 @@ > -/*- > - * BSD LICENSE > - * > - * Copyright(c) 2017 Linaro Limited. All rights reserved. > - * All rights reserved. > - * > - * Redistribution and use in source and binary forms, with or without > - * modification, are permitted provided that the following conditions > - * are met: > - * > - * * Redistributions of source code must retain the above copyright > - * notice, this list of conditions and the following disclaimer. > - * * Redistributions in binary form must reproduce the above copyrig= ht > - * notice, this list of conditions and the following disclaimer in > - * the documentation and/or other materials provided with the > - * distribution. > - * * Neither the name of Intel Corporation nor the names of its > - * contributors may be used to endorse or promote products derived > - * from this software without specific prior written permission. > - * > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND > CONTRIBUTORS > - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT > NOT > - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND > FITNESS FOR > - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE > COPYRIGHT > - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, > INCIDENTAL, > - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT > NOT > - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS > OF USE, > - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED > AND ON ANY > - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR > TORT > - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF > THE USE > - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH > DAMAGE. > - */ > -#ifndef __HASH_FUNC_ARM64_H__ > -#define __HASH_FUNC_ARM64_H__ > - > -#define _CRC32CX(crc, val)\ > -__asm__("crc32cx %w[c], %w[c], %x[v]":[c] "+r" (crc):[v] "r" (val)) > - > -static inline uint64_t > -hash_crc_key8(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint32_t crc0; > - > -crc0 =3D seed; > -_CRC32CX(crc0, k[0] & m[0]); > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key16(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key, k0; > -uint64_t *m =3D mask; > -uint32_t crc0, crc1; > - > -k0 =3D k[0] & m[0]; > - > -crc0 =3D k0; > -_CRC32CX(crc0, seed); > -crc1 =3D k0 >> 32; > -_CRC32CX(crc1, k[1] & m[1]); > - > -crc0 ^=3D crc1; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key24(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key, k0, k2; > -uint64_t *m =3D mask; > -uint32_t crc0, crc1; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > - > -crc0 =3D k0; > -_CRC32CX(crc0, seed); > -crc1 =3D k0 >> 32; > -_CRC32CX(crc1, k[1] & m[1]); > - > -_CRC32CX(crc0, k2); > - > -crc0 ^=3D crc1; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key32(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key, k0, k2; > -uint64_t *m =3D mask; > -uint32_t crc0, crc1, crc2, crc3; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > - > -crc0 =3D k0; > -_CRC32CX(crc0, seed); > -crc1 =3D k0 >> 32; > -_CRC32CX(crc1, k[1] & m[1]); > - > -crc2 =3D k2; > -_CRC32CX(crc2, k[3] & m[3]); > -crc3 =3D k2 >> 32; > - > -_CRC32CX(crc0, crc1); > -_CRC32CX(crc2, crc3); > - > -crc0 ^=3D crc2; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key40(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key, k0, k2; > -uint64_t *m =3D mask; > -uint32_t crc0, crc1, crc2, crc3; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > - > -crc0 =3D k0; > -_CRC32CX(crc0, seed); > -crc1 =3D k0 >> 32; > -_CRC32CX(crc1, k[1] & m[1]); > - > -crc2 =3D k2; > -_CRC32CX(crc2, k[3] & m[3]); > -crc3 =3D k2 >> 32; > -_CRC32CX(crc3, k[4] & m[4]); > - > -_CRC32CX(crc0, crc1); > -_CRC32CX(crc2, crc3); > - > -crc0 ^=3D crc2; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key48(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key, k0, k2, k5; > -uint64_t *m =3D mask; > -uint32_t crc0, crc1, crc2, crc3; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > -k5 =3D k[5] & m[5]; > - > -crc0 =3D k0; > -_CRC32CX(crc0, seed); > -crc1 =3D k0 >> 32; > -_CRC32CX(crc1, k[1] & m[1]); > - > -crc2 =3D k2; > -_CRC32CX(crc2, k[3] & m[3]); > -crc3 =3D k2 >> 32; > -_CRC32CX(crc3, k[4] & m[4]); > - > -_CRC32CX(crc0, ((uint64_t)crc1 << 32) ^ crc2); > -_CRC32CX(crc3, k5); > - > -crc0 ^=3D crc3; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key56(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key, k0, k2, k5; > -uint64_t *m =3D mask; > -uint32_t crc0, crc1, crc2, crc3, crc4, crc5; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > -k5 =3D k[5] & m[5]; > - > -crc0 =3D k0; > -_CRC32CX(crc0, seed); > -crc1 =3D k0 >> 32; > -_CRC32CX(crc1, k[1] & m[1]); > - > -crc2 =3D k2; > -_CRC32CX(crc2, k[3] & m[3]); > -crc3 =3D k2 >> 32; > -_CRC32CX(crc3, k[4] & m[4]); > - > -crc4 =3D k5; > - _CRC32CX(crc4, k[6] & m[6]); > -crc5 =3D k5 >> 32; > - > -_CRC32CX(crc0, ((uint64_t)crc1 << 32) ^ crc2); > -_CRC32CX(crc3, ((uint64_t)crc4 << 32) ^ crc5); > - > -crc0 ^=3D crc3; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key64(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key, k0, k2, k5; > -uint64_t *m =3D mask; > -uint32_t crc0, crc1, crc2, crc3, crc4, crc5; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > -k5 =3D k[5] & m[5]; > - > -crc0 =3D k0; > -_CRC32CX(crc0, seed); > -crc1 =3D k0 >> 32; > -_CRC32CX(crc1, k[1] & m[1]); > - > -crc2 =3D k2; > -_CRC32CX(crc2, k[3] & m[3]); > -crc3 =3D k2 >> 32; > -_CRC32CX(crc3, k[4] & m[4]); > - > -crc4 =3D k5; > - _CRC32CX(crc4, k[6] & m[6]); > -crc5 =3D k5 >> 32; > -_CRC32CX(crc5, k[7] & m[7]); > - > -_CRC32CX(crc0, ((uint64_t)crc1 << 32) ^ crc2); > -_CRC32CX(crc3, ((uint64_t)crc4 << 32) ^ crc5); > - > -crc0 ^=3D crc3; > - > -return crc0; > -} > - > -#define hash_default_key8hash_crc_key8 > -#define hash_default_key16hash_crc_key16 > -#define hash_default_key24hash_crc_key24 > -#define hash_default_key32hash_crc_key32 > -#define hash_default_key40hash_crc_key40 > -#define hash_default_key48hash_crc_key48 > -#define hash_default_key56hash_crc_key56 > -#define hash_default_key64hash_crc_key64 > - > -#endif > diff --git a/drivers/net/softnic/rte_eth_softnic_action.c > b/drivers/net/softnic/rte_eth_softnic_action.c > index c25f4dd..c542688 100644 > --- a/drivers/net/softnic/rte_eth_softnic_action.c > +++ b/drivers/net/softnic/rte_eth_softnic_action.c > @@ -7,8 +7,8 @@ > #include > > #include > +#include > > -#include "hash_func.h" > #include "rte_eth_softnic_internals.h" > > /** > @@ -72,35 +72,35 @@ softnic_port_in_action_profile_create(struct > pmd_internals *p, > params->lb.f_hash =3D=3D NULL) { > switch (params->lb.key_size) { > case 8: > -params->lb.f_hash =3D hash_default_key8; > +params->lb.f_hash =3D rte_table_hash_crc_key8; > break; > > case 16: > -params->lb.f_hash =3D hash_default_key16; > +params->lb.f_hash =3D rte_table_hash_crc_key16; > break; > > case 24: > -params->lb.f_hash =3D hash_default_key24; > +params->lb.f_hash =3D rte_table_hash_crc_key24; > break; > > case 32: > -params->lb.f_hash =3D hash_default_key32; > +params->lb.f_hash =3D rte_table_hash_crc_key32; > break; > > case 40: > -params->lb.f_hash =3D hash_default_key40; > +params->lb.f_hash =3D rte_table_hash_crc_key40; > break; > > case 48: > -params->lb.f_hash =3D hash_default_key48; > +params->lb.f_hash =3D rte_table_hash_crc_key48; > break; > > case 56: > -params->lb.f_hash =3D hash_default_key56; > +params->lb.f_hash =3D rte_table_hash_crc_key56; > break; > > case 64: > -params->lb.f_hash =3D hash_default_key64; > +params->lb.f_hash =3D rte_table_hash_crc_key64; > break; > > default: > @@ -223,35 +223,35 @@ softnic_table_action_profile_create(struct > pmd_internals *p, > params->lb.f_hash =3D=3D NULL) { > switch (params->lb.key_size) { > case 8: > -params->lb.f_hash =3D hash_default_key8; > +params->lb.f_hash =3D rte_table_hash_crc_key8; > break; > > case 16: > -params->lb.f_hash =3D hash_default_key16; > +params->lb.f_hash =3D rte_table_hash_crc_key16; > break; > > case 24: > -params->lb.f_hash =3D hash_default_key24; > +params->lb.f_hash =3D rte_table_hash_crc_key24; > break; > > case 32: > -params->lb.f_hash =3D hash_default_key32; > +params->lb.f_hash =3D rte_table_hash_crc_key32; > break; > > case 40: > -params->lb.f_hash =3D hash_default_key40; > +params->lb.f_hash =3D rte_table_hash_crc_key40; > break; > > case 48: > -params->lb.f_hash =3D hash_default_key48; > +params->lb.f_hash =3D rte_table_hash_crc_key48; > break; > > case 56: > -params->lb.f_hash =3D hash_default_key56; > +params->lb.f_hash =3D rte_table_hash_crc_key56; > break; > > case 64: > -params->lb.f_hash =3D hash_default_key64; > +params->lb.f_hash =3D rte_table_hash_crc_key64; > break; > > default: > diff --git a/drivers/net/softnic/rte_eth_softnic_pipeline.c > b/drivers/net/softnic/rte_eth_softnic_pipeline.c > index 45136a4..0aababe 100644 > --- a/drivers/net/softnic/rte_eth_softnic_pipeline.c > +++ b/drivers/net/softnic/rte_eth_softnic_pipeline.c > @@ -19,14 +19,13 @@ > #include > #include > #include > +#include > #include > #include > #include > > #include "rte_eth_softnic_internals.h" > > -#include "hash_func.h" > - > #ifndef PIPELINE_MSGQ_SIZE > #define PIPELINE_MSGQ_SIZE 64 > #endif > @@ -797,28 +796,28 @@ softnic_pipeline_table_create(struct > pmd_internals *softnic, > > switch (params->match.hash.key_size) { > case 8: > -f_hash =3D hash_default_key8; > +f_hash =3D rte_table_hash_crc_key8; > break; > case 16: > -f_hash =3D hash_default_key16; > +f_hash =3D rte_table_hash_crc_key16; > break; > case 24: > -f_hash =3D hash_default_key24; > +f_hash =3D rte_table_hash_crc_key24; > break; > case 32: > -f_hash =3D hash_default_key32; > +f_hash =3D rte_table_hash_crc_key32; > break; > case 40: > -f_hash =3D hash_default_key40; > +f_hash =3D rte_table_hash_crc_key40; > break; > case 48: > -f_hash =3D hash_default_key48; > +f_hash =3D rte_table_hash_crc_key48; > break; > case 56: > -f_hash =3D hash_default_key56; > +f_hash =3D rte_table_hash_crc_key56; > break; > case 64: > -f_hash =3D hash_default_key64; > +f_hash =3D rte_table_hash_crc_key64; > break; > default: > return -1; > -- > 2.9.5 IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.