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 2E60445AE0; Tue, 8 Oct 2024 05:43:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B4946400D7; Tue, 8 Oct 2024 05:42:59 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2085.outbound.protection.outlook.com [40.107.237.85]) by mails.dpdk.org (Postfix) with ESMTP id 3FDFE4003C for ; Tue, 8 Oct 2024 05:42:57 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=F0QZ5csjR1HYAOAh+trE9FXCvrbK0o+FCIYmwcOlZcbhRqmCPDHDu042iddHcJX3X6MO+C89OuPz0chJ06JLZHrih73tG4jrRmkH1jn0F8ppkiHKhH+qpDRna7B+XuLJM08s61khc6Tup/UtiiyriEEEyEke1bWPLCGNlbchuNUW9sGUdkCt+tvVDp5HV7nSyTmyCw1iR8dzpzHA17ZK8bZU2ih3TDPSsQ54rfRAu13mN/IzFPWETAGaoaEMj/NGlaLf4K/2i8WmrX9ojlJcgKAvrVYLHCBKhLE2BdTOxOSkV9ygz2unFNnlQIq5Yjad7U/Ynnbg+d/WsOH9+8GqcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=94q1NOWMfnAVYuykvKSD4pmtciMdhFSeQQSDEikWb6w=; b=J6G6gLfxIDvjeHfiqODIZDRDa1zhe0qkZH/ZeYdRdHg51Qjw+MqStdzew9n7k3IuxwLdYWZ6s1zJqOjAbxx6fb9plSVzRppajAm/VSNKhqKpZY+qAwVWvvydhWNajq/v5mgpyyoCrsHxxjfaocev8DYLAo8CKy1AEnu+KLxUyVjFw911DS/g+UL+wbjiJB61tmBkis89bWU4xZ4yjcYN1x/6HUvNHbGgTMUQoW9n8NftM38W+ou4ChcOfkOK4xqtIwuUGh2Jq8gO+z9XbC9E+VlnNpvkpDdbRnFuef5opPYd5Ukm0i9NbVvgYKq7oCwt4TvjKsafvgN4U/x/FcmY/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=94q1NOWMfnAVYuykvKSD4pmtciMdhFSeQQSDEikWb6w=; b=Yu1F+X0XYLonZQkvKdEKLefD1Z7CYgV/edJodbKm5kMCGi683qPtpYtXso+foa45TiNmnhbE5M5+1xLkBn/ZkzC1Emjpx/xi+SIwGhbgo3cvH9aIm5Ef06qrJ7jcOvAyyRFPRsvCGpdTxEPwZhnwQTZTxINFoVIjOdHh7N0kxso= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from SJ2PR12MB8830.namprd12.prod.outlook.com (2603:10b6:a03:4d0::9) by MW4PR12MB6924.namprd12.prod.outlook.com (2603:10b6:303:207::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Tue, 8 Oct 2024 03:42:54 +0000 Received: from SJ2PR12MB8830.namprd12.prod.outlook.com ([fe80::c3eb:df02:eaa9:2055]) by SJ2PR12MB8830.namprd12.prod.outlook.com ([fe80::c3eb:df02:eaa9:2055%4]) with mapi id 15.20.8026.020; Tue, 8 Oct 2024 03:42:54 +0000 Message-ID: <31a2db2a-1983-479e-ab96-5609cf9c18bb@amd.com> Date: Tue, 8 Oct 2024 04:42:48 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/3] net: add thread-safe crc api To: "Kusztal, ArkadiuszX" , "Marchand, David" References: <20241001181150.43506-1-arkadiuszx.kusztal@intel.com> <20241001181150.43506-2-arkadiuszx.kusztal@intel.com> Content-Language: en-US From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAIZARYhBEm7aYjps5XGsPHCElRTPtCKKm/6BQJkdyEEBQkE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tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= Cc: "dev@dpdk.org" , "Ji, Kai" , "Dooley, Brian" In-Reply-To: <20241001181150.43506-2-arkadiuszx.kusztal@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0248.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a7::19) To SJ2PR12MB8830.namprd12.prod.outlook.com (2603:10b6:a03:4d0::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR12MB8830:EE_|MW4PR12MB6924:EE_ X-MS-Office365-Filtering-Correlation-Id: 39121d87-59ea-481a-3d1d-08dce74b4aa8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?Tm9BR1krUEJkeGNQdlJIKzZZMjFkOEEvVkpUOTRSZmN5NXNQbDJjT0lveXdn?= =?utf-8?B?OFNQUEgwMHBMMERxUThTNnFlV1MwNG5KTDZkS21YOUwvaDhsRUhQcjAzMGlN?= =?utf-8?B?R1hCd3dzb21qV2FUN1BVWmJ2WlZRL2Npb2FLUEUwZ1BXUlJOTFMrZklScWVV?= =?utf-8?B?RHA5Y1dnaW9tTmt0MVBWbnBORGY0UklaR3JBUmtZQ3lTek0zc0FEVHhPeEY3?= =?utf-8?B?ODhtTEo4VXVYc2UwcTNtbFhkcDMyYjRmVG93NUNZdU5pSW1KQVdXaW05dlNm?= =?utf-8?B?WDI3cmxpVHU5V21sSkZzc2RDOW80YUE0c0I4cnVYYU93MXlVbWlUbkdjait6?= =?utf-8?B?RFMwVnVRUStSZzhrTXhUVVkzaFN0RFVMNkVvSThtVVJSWWdGcmJNSGw0RlJh?= =?utf-8?B?RWZydW9POFV4NGMxUU1OVS92bS9XOElWVnpFY2VCYk1wSXhLaDdudkQ4UVg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G42RkFRVWkvSUFub3VUYm5q?= =?utf-8?B?QTlpWDV2b1RSSWQ3NjJwaVVxZzU1YWZZWmdNNi9HWUdBWW80RXBIRDFaVGpM?= =?utf-8?B?WHVuc1JJNUIwcEZBMFZqK2lweG9BR2FzdlQwZzZ1SVM2dmh2SXp0aG9Ya2px?= =?utf-8?B?NkppdWFSa2JMUVhWMmpkYnlUb3FlbmY0amp3Szk3WUVmRnB3dXNHTDMzWFBq?= =?utf-8?B?NGJTQ2hWV3cyYWdkdUNTVU9maTlGUjVURTJva0dIKzc4c1o4WU5QT29vU01V?= =?utf-8?B?azFaUGlJZGdPQVl1bHpqN2ZjQ0VtaFo4RWh2U1kzNC9qcFRFRXFqRU9kNDh3?= =?utf-8?B?TXdad1o0cGpVZ25CNEg4U0ZWZHliUUU0bnFLdzU3QlR1YjdUeE1Yd3h3PT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR12MB8830.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TlJLNDdmVzRZT0JJbUgyMitOMTVNbnBiKytyYmpzazJlR0pUZGZHb1RZc1Jo?= =?utf-8?B?cE1SMkppajRzOXBpL21JcjMvOXNKck1lTWh1NkZJMFlBcWx1U0NyUzljczRI?= =?utf-8?B?dU5WTlZFcVRJM05pYW1YNWs3UXZnd0tmVkVKczBBdDU3eW9YaHZCQTRjREdQ?= =?utf-8?B?d0pTVG9KWXdkVmpZeEUwNHVWYitwTmpRWUcxZ0ZtdUxWQlVtRWY4ZFRlVTY4?= =?utf-8?B?WjJvQlNqQjVteTRrbEJ0TkdYRC9Ec1YrN2RrdzNpVkdzZEYrVnZoOTBBRWlv?= =?utf-8?B?MjdsdmdZM1g0TkMxblFZMW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utf-8?Q?YaDwdF3HMcGVj8LJ2KG6igOyU?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 39121d87-59ea-481a-3d1d-08dce74b4aa8 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR12MB8830.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2024 03:42:54.1952 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TZgJRvAiFLEcpluTsdx2vx5LC9bgTMiP0bUZ9umsZvX5CSqJ97BhDxltPe2vkPx7 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6924 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 On 10/1/2024 7:11 PM, Arkadiusz Kusztal wrote: > The current net CRC API is not thread-safe, this patch > solves this by adding another, thread-safe API functions. > This API is also safe to use across multiple processes, > yet with limitations on max-simd-bitwidth, which will be checked only by > the process that created the CRC context; all other processes will use > the same CRC function when used with the same CRC context. > It is an undefined behavior when process binaries are compiled > with different SIMD capabilities when the same CRC context is used. > > Signed-off-by: Arkadiusz Kusztal <...> > +static struct > +{ > + uint32_t (*f[RTE_NET_CRC_REQS]) > + (const uint8_t *data, uint32_t data_len); > It increases readability to typedef function pointers. > +} handlers[RTE_NET_CRC_AVX512 + 1]; > > -/** > - * Reflect the bits about the middle > - * > - * @param val > - * value to be reflected > - * > - * @return > - * reflected value > - */ > -static uint32_t > +static inline uint32_t > Does changing to 'inline' required, as function is static compiler can do the same. > reflect_32bits(uint32_t val) > { > uint32_t i, res = 0; > @@ -99,26 +43,7 @@ reflect_32bits(uint32_t val) > return res; > } > > -static void > -crc32_eth_init_lut(uint32_t poly, > - uint32_t *lut) > -{ > - uint32_t i, j; > - > - for (i = 0; i < CRC_LUT_SIZE; i++) { > - uint32_t crc = reflect_32bits(i); > - > - for (j = 0; j < 8; j++) { > - if (crc & 0x80000000L) > - crc = (crc << 1) ^ poly; > - else > - crc <<= 1; > - } > - lut[i] = reflect_32bits(crc); > - } > -} > - > -static __rte_always_inline uint32_t > +static inline uint32_t > Why not forcing inline anymore? Are these inline changes related to the thread-safety? > crc32_eth_calc_lut(const uint8_t *data, > uint32_t data_len, > uint32_t crc, > @@ -130,20 +55,9 @@ crc32_eth_calc_lut(const uint8_t *data, > return crc; > } > > -static void > -rte_net_crc_scalar_init(void) > -{ > - /* 32-bit crc init */ > - crc32_eth_init_lut(CRC32_ETH_POLYNOMIAL, crc32_eth_lut); > - > - /* 16-bit CRC init */ > - crc32_eth_init_lut(CRC16_CCITT_POLYNOMIAL << 16, crc16_ccitt_lut); > -} > - > static inline uint32_t > -rte_crc16_ccitt_handler(const uint8_t *data, uint32_t data_len) > +crc16_ccitt(const uint8_t *data, uint32_t data_len) > { > - /* return 16-bit CRC value */ > Why not keep comments? Are they wrong? <...> > +static void > +crc_scalar_init(void) > +{ > + crc32_eth_init_lut(CRC32_ETH_POLYNOMIAL, crc32_eth_lut); > + crc32_eth_init_lut(CRC16_CCITT_POLYNOMIAL << 16, crc16_ccitt_lut); > + > + handlers[RTE_NET_CRC_SCALAR].f[RTE_NET_CRC16_CCITT] = crc16_ccitt; > + handlers[RTE_NET_CRC_SCALAR].f[RTE_NET_CRC32_ETH] = crc32_eth; > +1 to remove global handlers pointer and add context, But current handlers array content is static, it can be set when defined, instead of functions. <...> > -static uint32_t > -rte_crc32_eth_default_handler(const uint8_t *data, uint32_t data_len) > +struct rte_net_crc rte_net_crc_set(enum rte_net_crc_alg alg, > + enum rte_net_crc_type type) > { > - handlers = NULL; > - if (max_simd_bitwidth == 0) > - max_simd_bitwidth = rte_vect_get_max_simd_bitwidth(); > - > - handlers = avx512_vpclmulqdq_get_handlers(); > - if (handlers != NULL) > - return handlers[RTE_NET_CRC32_ETH](data, data_len); > - handlers = sse42_pclmulqdq_get_handlers(); > - if (handlers != NULL) > - return handlers[RTE_NET_CRC32_ETH](data, data_len); > - handlers = neon_pmull_get_handlers(); > - if (handlers != NULL) > - return handlers[RTE_NET_CRC32_ETH](data, data_len); > - handlers = handlers_scalar; > - return handlers[RTE_NET_CRC32_ETH](data, data_len); > -} > + uint16_t max_simd_bitwidth; > > -/* Public API */ > - > -void > -rte_net_crc_set_alg(enum rte_net_crc_alg alg) > -{ > - handlers = NULL; > - if (max_simd_bitwidth == 0) > - max_simd_bitwidth = rte_vect_get_max_simd_bitwidth(); > + max_simd_bitwidth = rte_vect_get_max_simd_bitwidth(); > > switch (alg) { > case RTE_NET_CRC_AVX512: > - handlers = avx512_vpclmulqdq_get_handlers(); > - if (handlers != NULL) > - break; > +#ifdef CC_X86_64_AVX512_VPCLMULQDQ_SUPPORT > + if (AVX512_VPCLMULQDQ_CPU_SUPPORTED && > + max_simd_bitwidth >= RTE_VECT_SIMD_512) { > + return (struct rte_net_crc){ RTE_NET_CRC_AVX512, type }; > + } > +#endif > /* fall-through */ > case RTE_NET_CRC_SSE42: > - handlers = sse42_pclmulqdq_get_handlers(); > - break; /* for x86, always break here */ > +#ifdef CC_X86_64_SSE42_PCLMULQDQ_SUPPORT > + if (SSE42_PCLMULQDQ_CPU_SUPPORTED && > + max_simd_bitwidth >= RTE_VECT_SIMD_128) { > + return (struct rte_net_crc){ RTE_NET_CRC_SSE42, type }; > + } > +#endif > + break; > case RTE_NET_CRC_NEON: > - handlers = neon_pmull_get_handlers(); > - /* fall-through */ > - case RTE_NET_CRC_SCALAR: > - /* fall-through */ > +#ifdef CC_ARM64_NEON_PMULL_SUPPORT > + if (NEON_PMULL_CPU_SUPPORTED && > + max_simd_bitwidth >= RTE_VECT_SIMD_128) { > + return (struct rte_net_crc){ RTE_NET_CRC_NEON, type }; > + } > +#endif > Is it more readable as following, up to you: ``` rte_net_crc_set(alg, type) { enum rte_net_crc_alg new_alg = RTE_NET_CRC_SCALAR; switch (alg) { case AVX512: new_alg = .. case NEON: new_alg = .. } return struct rte_net_crc){ new_alg, type }; ``` > + break; > default: > break; > } > - > - if (handlers == NULL) > - handlers = handlers_scalar; > + return (struct rte_net_crc){ RTE_NET_CRC_SCALAR, type }; > } > > -uint32_t > -rte_net_crc_calc(const void *data, > - uint32_t data_len, > - enum rte_net_crc_type type) > +uint32_t rte_net_crc(const struct rte_net_crc *ctx, > + const void *data, const uint32_t data_len) > { > - uint32_t ret; > - rte_net_crc_handler f_handle; > - > - f_handle = handlers[type]; > - ret = f_handle(data, data_len); > - > - return ret; > + return handlers[ctx->alg].f[ctx->type](data, data_len); > 'rte_net_crc()' gets input from user and "struct rte_net_crc" is not opaque, so user can provide invalid input, ctx->alg & ctx->type. To protect against it input values should be checked before using. Or I think user not need to know the details of the "struct rte_net_crc", so it can be an opaque variable for user. <...> > -/** > - * CRC compute API > - * > - * @param data > - * Pointer to the packet data for CRC computation > - * @param data_len > - * Data length for CRC computation > - * @param type > - * CRC type (enum rte_net_crc_type) > - * > - * @return > - * CRC value > - */ > -uint32_t > -rte_net_crc_calc(const void *data, > - uint32_t data_len, > +struct rte_net_crc rte_net_crc_set(enum rte_net_crc_alg alg, > enum rte_net_crc_type type); > > +uint32_t rte_net_crc(const struct rte_net_crc *ctx, > + const void *data, const uint32_t data_len); > + > As these are APIs, can you please add doxygen comments to them? > #ifdef __cplusplus > } > #endif > diff --git a/lib/net/version.map b/lib/net/version.map > index bec4ce23ea..47daf1464a 100644 > --- a/lib/net/version.map > +++ b/lib/net/version.map > @@ -4,11 +4,25 @@ DPDK_25 { > rte_eth_random_addr; > rte_ether_format_addr; > rte_ether_unformat_addr; > - rte_net_crc_calc; > - rte_net_crc_set_alg; > rte_net_get_ptype; > rte_net_make_rarp_packet; > rte_net_skip_ip6_ext; > + rte_net_crc; > + rte_net_crc_set; > > local: *; > }; > + > +INTERNAL { > + global: > + > + rte_net_crc_sse42_init; > + rte_crc16_ccitt_sse42_handler; > + rte_crc32_eth_sse42_handler; > + rte_net_crc_avx512_init; > + rte_crc16_ccitt_avx512_handler; > + rte_crc32_eth_avx512_handler; > + rte_net_crc_neon_init; > + rte_crc16_ccitt_neon_handler; > + rte_crc32_eth_neon_handler; > +}; > +1 to David's comment, these are used only within component, no need to export.