From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0082.outbound.protection.outlook.com [104.47.40.82]) by dpdk.org (Postfix) with ESMTP id 731E02BB9 for ; Fri, 16 Jun 2017 07:32:30 +0200 (CEST) Received: from BLUPR0301CA0027.namprd03.prod.outlook.com (10.162.113.165) by SN2PR03MB2399.namprd03.prod.outlook.com (10.166.210.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1178.14; Fri, 16 Jun 2017 05:32:28 +0000 Received: from BN1AFFO11OLC004.protection.gbl (2a01:111:f400:7c10::139) by BLUPR0301CA0027.outlook.office365.com (2a01:111:e400:5259::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1178.14 via Frontend Transport; Fri, 16 Jun 2017 05:32:28 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11OLC004.mail.protection.outlook.com (10.58.53.75) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1157.12 via Frontend Transport; Fri, 16 Jun 2017 05:32:28 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.39]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v5G5WNF0001003; Thu, 15 Jun 2017 22:32:26 -0700 From: Shreyansh Jain To: CC: , Date: Fri, 16 Jun 2017 11:10:31 +0530 Message-ID: <1497591668-3320-2-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497591668-3320-1-git-send-email-shreyansh.jain@nxp.com> References: <1497591668-3320-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131420647485187587; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(6009001)(336005)(39860400002)(39380400002)(39840400002)(39450400003)(39410400002)(39850400002)(39400400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(9170700003)(77096006)(76176999)(33646002)(2950100002)(8676002)(6666003)(2351001)(106466001)(105606002)(356003)(104016004)(50466002)(189998001)(81166006)(6916009)(54906002)(110136004)(498600001)(38730400002)(53936002)(8656002)(4326008)(5660300001)(305945005)(8936002)(50226002)(36756003)(2906002)(48376002)(86362001)(5003940100001)(47776003)(85426001)(50986999)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2399; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1AFFO11OLC004; 1:TZFk3KoTgPNp58VK5nCihhdqu90A1dnCeV0FfP4Y?= =?us-ascii?Q?AgGPpBSjWObzYGD0QLKETQl6sjffvCYsb68PBJSxfY28MG4W2IVbuuANG0Ss?= =?us-ascii?Q?HK0lxgIxY0CuEqh04J1thX87vnqP4CGjWZmp1ONtnsMqe33zMAelYIz999x1?= =?us-ascii?Q?CzeHsuSJFxlKMLX+shivc+igc+kD+IfJjoxlR2Qe/evz4cUh1FD9nGsFJQZd?= =?us-ascii?Q?72KCnhMtTPcMar057kV3U7EX2osMSCWIPNdGnC/TUMIOYMjxz+cx/oVoCgKR?= =?us-ascii?Q?isGRZ7LuI6/gssah8fGFk2oUBg2lqsZOfHGHA5+JcPDL2yXcqowsT8o1EE40?= =?us-ascii?Q?zgfv0i+U7qPw5Sl3U+Do3tRYXcfonGwvFX7WlWDRW7NLxyD/IDzdZQFcxsxO?= =?us-ascii?Q?shyJZ/kjD29zoSYM4L7WE4sssLEHx2qd4OjJ3jYxmy+XfyMJGDmLm2Lnc9w9?= =?us-ascii?Q?SvbGuRWQTyr/LDoowCIdnuYlnirrkP3QBKLeZnT4TqLR95aC0w/LUcanowwm?= =?us-ascii?Q?sTOSXBeuN28vM9/oyN0eP8QKWUtAfXuI9p5RaMfhk9938ROxzrpMgXZbX14j?= =?us-ascii?Q?cAT9RgB36fjeEeI/JOpl5vWh5sV/NJJVri8sW+/5L71ESvvh4aovEJ5R6+3y?= =?us-ascii?Q?pKQtj+AryP34UI8ju3Cqz3PVPxAGJ0dotPQ+9hhWm16YZTPmPbaVzfbzkV7F?= =?us-ascii?Q?spz80XfZwGyYdWyyWYEx8PhKmBAI1vt627nSxSLsaDJmY9BRcOmzPydAbyhi?= =?us-ascii?Q?eZeEll7b0nLDwzQAmwdNYmhRsTOhllVZf0cNB5Q4Qf2KIN3FycIcNOT981WB?= =?us-ascii?Q?eS/T7fR51sg5pb7dzabAWXO76RgO3p6sbf4xq51gBOwLA7MemR6Uo/1KZc+3?= =?us-ascii?Q?rnixUaY+fTnlEHU/OKYkfT4GuZp8ul0M1HIJ8AVCuvif6tpJ1exAQkRATt4n?= =?us-ascii?Q?KLdTzmbno+GTxdv6uvCWi4hcEcJ0nTnGK76HrbRyXtYN1DLz4mL7v0Ekh+Z5?= =?us-ascii?Q?M6qRV/KiwQpuS97I0X3G1aQhXjWlqFQIOmIdncZpQ3/O0uWekLzTVcBrDbeX?= =?us-ascii?Q?YEOG0weVrjv14J3Cbsy54IyLj+Nv7YnWzJ0/4Dtvn+P+SLDwYg=3D=3D?= MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f1a08eda-01ed-45d7-81ef-08d4b47913f1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:SN2PR03MB2399; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2399; 3:BkRt70KP3oZTntvsQIsTtLVqmNgHNtrB5FhlSRX8ao2FDrTugj1vNzdLsHkfETxL3TeCcbhlVK355W5nZYHGD7GDJO+ca0KWUJO+A4XfPIVFZQjJMukpl8OyUU0mUpgFkVKMCCEWQw3UZkn3oCuB3mRtycTpiM2fSwPhSZr09zsmH/Pf/zxLKGXzyQpqiieYcJj0D+gAiuj5f2d9kfeFJF994wfbsnx2wuzEf0YVEzlHW2JBxLCSPZkH0psJl3QrD4txG4MsUCZ50RJgvFAL/RO33vu3fGo+BG3hlQQRC2u9lPpYDStyeEfsTknqKvG5b8ezwIjvijXzk0QiKZ6mDHD3dVAxkxVvjdzXJPnAYuPi8ziSEv9+r3/0J7N1WrauMi7WdtxYH22AHlbmGaHoU8679+Im1eG7/c3w8BoLgsArGsDd7jlAHsPrv0iNxw+2; 25:kAOl6rH3Fc2hFScS6jDhnSJojPD5hRDbYxG2hPBrj4Hy/0kHbBDwyiTHsgo6srhVSRd8yjdMCDCx4JCSRbzB/eHxo+78q9yxuhwXfvK6joSHZaTQ4+CgyBJY/o3mTjcUePP8MaI3wi0YKGHuT9ODHcIuUfyDtnRsEdBKBRKKqKQPg486kGEp1PndlCeJJHJmTdrdQ+1fZaIWedWJiMwvpPhu/VvHBA4TxHNMDSTYZZ+fX/ufDewTGbuGO1TtkGFay2MRgL7LTmDvxNG880rc+3ulcSsBKysl4MUebMoRG3r/9dnb42boROwwruCRzZiArqET0YqQBVPFVYLaTXC18ClfZ8CjRTR6FnQYodYDVAFyXqFdXEEEa29Ca5C1S2DunOLvU/YVxVnExPrUtfJvWFpe9NEb7mshcrjw6eeMX+41F3q9rBNgio5SbZPPEWk1newvSV2nnXKvukgFEY3oYf1acmuiVq4NgJuAKZTFEKg= X-MS-TrafficTypeDiagnostic: SN2PR03MB2399: X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2399; 31:p3JIDfjVA8dRuJRvSPF4KWgdU/ACysuHcj3BDrcAI+w94f+1Ynu5M0sHjt60ViHTF9EB40vFV+xz003hHTqdo1YY43Sjr38/43xF8Dbvm4GP+HCgrts0mEZJOwuJqEXhcmXJCOYiAxztu/EnoDUURLzJs8HbrfnMyuWFkv3tMcAt6rEhYdfFN2p8qXzlgPJavxvxWs0xlFQkj7hCuYRA4NUwbnsd77uUuXMjZroCfrZBkKCk+OEHHjkCHtkPb72ZbYE2VWZnafeRJDWgGQUWYg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13018025)(5005006)(13016025)(8121501046)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6096035)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123563025)(20161123561025)(20161123565025)(20161123556025)(20161123559100)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN2PR03MB2399; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN2PR03MB2399; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2399; 4:m/L8zCDzPtUbSLCUOSihJbJxWPXCfmrwIEowVwvgo+?= =?us-ascii?Q?Z+mErOAIz6iF8xmJgzXvbW5bzVCiO2UW4XwC2Csvm0a5YYzi7G1PAh3TA3pS?= =?us-ascii?Q?sQrCpp+kuwsSgbgjQkwAtaoHhmnRVYZj6CCGK6EU4r/zxKwY+2iZghvtLKGG?= =?us-ascii?Q?YNEwLy8qZ0eD3ltU+fRpGx5t1soyRj4jSnZsIt+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0Wa7MzOGzWzzJ/R3pNdmgvTZ5d9ttokE0e0AMblHTNva4w1mRn7O/zqYJxUQ?= =?us-ascii?Q?sCsMcMRQjQztjC+VJK7G5ZfSOwMoGATKdfYA6GL0yfnjY2VPI37OVIGsyRlG?= =?us-ascii?Q?00dj63+vGAHqqL+CZWKbg7G3Cp/VKH9NyduayR9FTwBd6wWygyX/0Y+p13z1?= =?us-ascii?Q?T6TqColO6DAEGbuGHv8D/4tUTq0RQnWm0KdqMo?= X-Forefront-PRVS: 0340850FCD X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2399; 23:NPqGShTnVOF1p29M803LFSOf/E5rG2dP410MyU8In?= =?us-ascii?Q?Mz0eEwwZ8qA1oyAUX+hxD8v5IL6eR4a+9c4h7clb8A921CIZAifnJ93aUd6H?= =?us-ascii?Q?PajkTBkBt8MTPDUKLAnyQg3fTzO8FeRLROGQhAPCDSdrnuY/1mS0TniGvGbd?= =?us-ascii?Q?/kHCgjjYiiO95okkQt3Crfs87/8XsW5BvvY54Yboxq0kE+ERXbHIP7/cBxhu?= =?us-ascii?Q?8p2NvyEFU9uL+38sPc2PjKPA6ktM8IIszWec6yvmCZ1o3O3KOTrUCCFuU1CE?= =?us-ascii?Q?xDfKmRJMXYDCMlZ3WKpHJAoO0V1JMkCr2VIZxSuuV+Gs/xRDjG0luCRkff3l?= =?us-ascii?Q?D+5O82vWfUR3I44RaTaamjQvdfqKz/ihk1SXhiQViNm5LO6XY2A0QI0VID9c?= =?us-ascii?Q?0tKmif6hk+xpBdz8kdp81n2OPz2dZXgB4R84zu7vUhHJ7CJrjCE7Gc7oZudo?= =?us-ascii?Q?841r3XY2YtJ8d/6opMZNeXk4X+RWA+DQrZUmpLT7swn7PhKCB8cv8U/f92pd?= =?us-ascii?Q?eek/OwcnfswKwVdUsHIWytfB1wMno0iHQkWia+mTtlOJy8IPexLcv6YveE5m?= =?us-ascii?Q?B2G6NPZReQcGryBuUnI3/AeGK8TaPHzZW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put: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2399; 7:Z+zrpO1ffM3kScR+wtNS1cytW3ad9AgyRAJAO6tOPLba7y1zXTsVFGvrcUr/XtWcUg1GQfu5J+nziw5EhHc8/Cb5fIPGW9GWqSUO06bg0k+zfwJy9X1pSCX9+mXc+5lt1B3VvwLYdmB8sBT8fqIG84O+KwpfHYWIr5IwTNffgNhhj8vaCka0YTVp8jXsS5MScducjeCxkq+SPR5nRo8mglKvrVfu8AwpDPg3/9JIrqoPCJ86Pnvjd9klOlRCteU3ftx6qA/tGQ/HxHjq0FrIli5DLXucWkN5N4LHekra4oZvSq67EdUp6v/Ie/lzoy2h8V7pTPr85Dznj0hVDB2x4w== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2017 05:32:28.3159 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB2399 Subject: [dpdk-dev] [PATCH 01/38] eal: add support for 24 40 and 48 bit operations 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, 16 Jun 2017 05:32:31 -0000 From: Hemant Agrawal Bit Swap and LE<=>BE conversions for 23, 40 and 48 bit width Signed-off-by: Hemant Agrawal --- .../common/include/generic/rte_byteorder.h | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/lib/librte_eal/common/include/generic/rte_byteorder.h b/lib/librte_eal/common/include/generic/rte_byteorder.h index e00bccb..8903ff6 100644 --- a/lib/librte_eal/common/include/generic/rte_byteorder.h +++ b/lib/librte_eal/common/include/generic/rte_byteorder.h @@ -122,6 +122,84 @@ rte_constant_bswap64(uint64_t x) ((x & 0xff00000000000000ULL) >> 56); } +/* + * An internal function to swap bytes of a 48-bit value. + */ +static inline uint64_t +rte_constant_bswap48(uint64_t x) +{ + return ((x & 0x0000000000ffULL) << 40) | + ((x & 0x00000000ff00ULL) << 24) | + ((x & 0x000000ff0000ULL) << 8) | + ((x & 0x0000ff000000ULL) >> 8) | + ((x & 0x00ff00000000ULL) >> 24) | + ((x & 0xff0000000000ULL) >> 40); +} + +/* + * An internal function to swap bytes of a 40-bit value. + */ +static inline uint64_t +rte_constant_bswap40(uint64_t x) +{ + return ((x & 0x00000000ffULL) << 32) | + ((x & 0x000000ff00ULL) << 16) | + ((x & 0x0000ff0000ULL)) | + ((x & 0x00ff000000ULL) >> 16) | + ((x & 0xff00000000ULL) >> 32); +} + +/* + * An internal function to swap bytes of a 24-bit value. + */ +static inline uint32_t +rte_constant_bswap24(uint32_t x) +{ + return ((x & 0x0000ffULL) << 16) | + ((x & 0x00ff00ULL)) | + ((x & 0xff0000ULL) >> 16); +} + +#define rte_bswap24 rte_constant_bswap24 +#define rte_bswap40 rte_constant_bswap40 +#define rte_bswap48 rte_constant_bswap48 + +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN + +#define rte_cpu_to_le_24(x) (x) +#define rte_cpu_to_le_40(x) (x) +#define rte_cpu_to_le_48(x) (x) + +#define rte_cpu_to_be_24(x) rte_bswap24(x) +#define rte_cpu_to_be_40(x) rte_bswap40(x) +#define rte_cpu_to_be_48(x) rte_bswap48(x) + +#define rte_le_to_cpu_24(x) (x) +#define rte_le_to_cpu_40(x) (x) +#define rte_le_to_cpu_48(x) (x) + +#define rte_be_to_cpu_24(x) rte_bswap24(x) +#define rte_be_to_cpu_40(x) rte_bswap40(x) +#define rte_be_to_cpu_48(x) rte_bswap48(x) + +#else /* RTE_BIG_ENDIAN */ + +#define rte_cpu_to_le_24(x) rte_bswap24(x) +#define rte_cpu_to_le_40(x) rte_bswap40(x) +#define rte_cpu_to_le_48(x) rte_bswap48(x) + +#define rte_cpu_to_be_24(x) (x) +#define rte_cpu_to_be_40(x) (x) +#define rte_cpu_to_be_48(x) (x) + +#define rte_le_to_cpu_24(x) rte_bswap24(x) +#define rte_le_to_cpu_40(x) rte_bswap40(x) +#define rte_le_to_cpu_48(x) rte_bswap48(x) + +#define rte_be_to_cpu_24(x) (x) +#define rte_be_to_cpu_40(x) (x) +#define rte_be_to_cpu_48(x) (x) +#endif #ifdef __DOXYGEN__ -- 2.7.4