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 8CCA5436EF; Thu, 14 Dec 2023 12:34:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7B58443258; Thu, 14 Dec 2023 12:34:53 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2051.outbound.protection.outlook.com [40.107.102.51]) by mails.dpdk.org (Postfix) with ESMTP id 3A92243250 for ; Thu, 14 Dec 2023 12:34:52 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eAXJyG5EAySet/W2zU3VVpSeIIaGQnRkhQku2BRu2KXQBs/wO58P+QAD/NUdYR3rMfpn3BlbLm2onSqe1q9axBlVQXdlmipfYqx1IjJiKQmoVpsc21HKGJQxk2zciayRHZ8CORqd3h89kXZOkHUPniC/m2AwKCIj+ACZHy1znJQXrvOTon82DTeKUsPCdMKh3NhV1pdRPdv66wdctFN2QDFmXSDzoyJOeOmJ9qFieKVbaMR1VaglwRhv7tz9cR2tdqfytm/HR1bnSqwkgLDclmtRdrJiIi+PJLYGKFonDUd27xshglN3EOgiTIGNvZEXdDJQHl+2Q6u/uDT++Sq5xA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=P0AIjxwkkRwow6GSOnAN3/lzpP+tLgN1jKOrJ6HvbqE=; b=JYguPPN/Hv28GBJPB4IzfUDWHswsDkaj+qikHTGK9J/+MMdl6SSNlT7EMrAtYZqneTJgCbhMgtVUoVxz6D8Q6fQPCNL3rKf4RrSth3ssIBlyc/QkfffN3mDoO2JvbTeC7YbApFTRPL24Ic/SqX/t5ipPRiorINWAYQr4qe3N6EmKwlP40AEn1LRHKWmTqJLbR07ifcaoeYoQFu1CITaw8t9P9L2XataN668nkcYHQXkVtku/55eEixk3y7BNiykev0LgAnrlm1O1gbAR9UVXd1528GrgSqQQ6b3YO6b+9v6GaP+KgPYmfjW8AgTZhgIwSPrGlS6Vw448J2VymkBCsw== 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=P0AIjxwkkRwow6GSOnAN3/lzpP+tLgN1jKOrJ6HvbqE=; b=Jxj8SHHiqJw1ZuWfRLqC6We0AmN48T/iXZxIyPqrVRTINOIZBiMgPBw2MH5niUcg849oIPIiX7sYk3Zqm+opUvOim4vdBRMfI3ySNeyS7CJFCtMY0TPBVkbDYojCs/IxcNyoOhQSgwkQR1tcFstUMkJR3T2OjC6VJzWwOTctgto= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by BL3PR12MB6545.namprd12.prod.outlook.com (2603:10b6:208:38c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.28; Thu, 14 Dec 2023 11:34:46 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::2569:edb2:670f:816f]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::2569:edb2:670f:816f%6]) with mapi id 15.20.7091.028; Thu, 14 Dec 2023 11:34:46 +0000 Message-ID: <7ec96599-6235-4ef5-9bba-6a037815d358@amd.com> Date: Thu, 14 Dec 2023 11:34:39 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [RFC] ethdev: introduce entropy calculation Content-Language: en-US To: Ori Kam , dsosnowski@nvidia.com, cristian.dumitrescu@intel.com, Thomas Monjalon , Andrew Rybchenko Cc: dev@dpdk.org, rasland@nvidia.com References: <20231210083100.7893-1-orika@nvidia.com> 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/6BQJkdyEEBQkE3meNAAoJEFR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VM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <20231210083100.7893-1-orika@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR3P281CA0192.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a4::16) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|BL3PR12MB6545:EE_ X-MS-Office365-Filtering-Correlation-Id: 983df685-8033-4bc8-8996-08dbfc98abec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o0yOdFAJKBQvZC3s1djKzmqPJ3WS07T8voaCGYZlkn0qAvjceNFczWXTR8k2RHY8rIfqouoDbartZKhvTxSLZuZLuIGv/Q/RolWK/cuVpvr6ivQglYHqMThPWQDZKqyjVReZBN98nR0MvcX+SW4zN9aX/IZhIF0k+WFnlXDpUJamXCXxZqcflJV9qrTYE+bwGrIjHfFEnLqWrU5c1jPkqQd+p+hvd2Y5izKX9B9A761HZZ+Cju+u6Iem8Mj50bQMIHukZwZyqB+k5cHTUoPgaqNQc16unFX/d4tz9zQLdWucY34yewY9Ir32ZtnmnUAyFf2BxhYSz43n3pI0+7ik43oKnXsC1PqtLwmYDFi+OvI7vcKObfUuAihJdPSf33c9p3L/Degj20lX5hLVv3cf+6KFUqoYI2RNnKm/+iEYaKe72ee5Q6/RsNJywj1LZMsSxVKg5wKQnaU0j1yKzVfGzZt1tZyHJbNOEZYqtNNaPgS8sH9j36crfbvMCz8qK4REqKjUB7LwFhIwLz1EP0BGZgKtN+AdDGR5H6s5ZuS6WAIcf9WGLpeXsOE0BiMYKxF2IEbCbQCZvwMXpRUe0h7ZTdLaLr3WZogvs6muhKZFN67Qt5Fgh0WD1Ua01WZOOhC4Wkh3EFaX1x33OVsisxeJB22FaaN28YLS8CATODKoD0zm4aB87lPQm1oH6ybIc5fj X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(376002)(366004)(39860400002)(136003)(396003)(230273577357003)(230173577357003)(230922051799003)(451199024)(186009)(64100799003)(1800799012)(66946007)(110136005)(66476007)(66556008)(44832011)(316002)(8676002)(8936002)(2616005)(4326008)(6512007)(6486002)(26005)(83380400001)(53546011)(6506007)(478600001)(6666004)(5660300002)(2906002)(41300700001)(36756003)(38100700002)(86362001)(31696002)(31686004)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TDNJbHQrdlBtS2pOMGxxTWd0bzgwSk1HYjZ0amtISFFxOGZwUlN6Vmc4bU5o?= =?utf-8?B?eDcrZzlNTEJJS0VYZTNKaW9kdFc3RTc1YW1ONml3YkkzTEhtVXZMOUdrdWU2?= =?utf-8?B?YzhpVWR1S2JBNWxqVndFcythVERhcmdUT0luL2d4ZmJwaHJ1UFFEUlpRcHBJ?= =?utf-8?B?bkFTb2phQUJQbGNIa2o3QUpIQ0xvNmFUUndRR3ROQ2p0YW1aclFKdEFhaEpm?= =?utf-8?B?aEcwQ2Nvb3hlcjk4dmxnR0RQVG9rZExhVUJXdDMzZVpGSWowMWM2RXhacC9C?= =?utf-8?B?QmZxeWxkY3EvbFJVZHpCbjJyeUhtUk9tWW1kMm9OZXRETmVBbVBHTlhMdXRR?= =?utf-8?B?bmoxL3gyTXFHaXIvRGFiNDJKMFFIeHM5MFJtUE9memxXbGI4eWZ6aDFyUWEv?= =?utf-8?B?YzQ1Z2F1VGZBT0xIOFR0aUc4VnRBa2VTcGorSktPaE5ydUo0bjJNT01WZUlO?= =?utf-8?B?Y2tsUll2LzFNRV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VVL0xq?= =?utf-8?B?UzE5K1UwMThLOGx0cGtUalMvK0cwY2dKbzdUaHhVNnpOQVMrc3NJVStWM2ln?= =?utf-8?B?MGlEMmU1bmxUOHFZczZObEcybjlPbVZMWFlURUlvTFVnc0NXQ2FTMnppOWRv?= =?utf-8?B?c3VOSEdiOHBzTU1xQys0OFdIbkxwR1NKT000OFBaUy9rVzJZY2hmSU1RRzZM?= =?utf-8?B?aFJnaURyNVJEUmJXNEhBRjFDdmpURHNBNXJ6UTlDMmNiME5hN2VDemZwZzZs?= =?utf-8?B?MEowNzEvOWw1dnZlRlRZaVlxaDcyTjlBK0txSldneUpsVWJaWHRJZlRKVzBE?= =?utf-8?B?a1kyZDRiZW9rMkh4amxpcG04WHJHQ09OLzB0U3d5OUNmR2JBS1IzcHd1Y3hF?= =?utf-8?B?aFlSaExPZ1pQMGVrV25vdTVtY0MrY1BkdGZvSTBQaFNSQzRNcDdpNUxvSVE3?= =?utf-8?B?a0hJZ004ZmlmVFBQZUpTVlhkMlBjSUxHRHEveHdWaWgyemtnTEFtNHlpRSt2?= =?utf-8?B?eHZCR05mQVBkZkJMdjVubUxCODN2cHh0WkdNNDA2Nlo1c1BHL3N6MUNKMHJv?= =?utf-8?B?WWxHKzVLWTJibGI5REFrVG8yWENuQkZkNjJaT09OeWdkZHYyNFZ3SGUrZ2Zq?= =?utf-8?B?ZURxdlZCUHUzRVRBWnNOSFZqQlBSd0gvUlI5OW9qS2NZaVQ3eXVpTGhMcmNs?= =?utf-8?B?SWE5bnR0c2UwSWFCWFFoZExSMmorMkZQMTRRdC9rb2tXaHJMNDlZVnBmemY1?= =?utf-8?Q?euH0=3D?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 983df685-8033-4bc8-8996-08dbfc98abec X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2023 11:34:46.0769 (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: TLdQaaCZZtpSMCGZYY9bv0tGZc0fQc/gaNPWnzI30cfNjIys95juiswwIlCB7n4k X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6545 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 12/10/2023 8:30 AM, Ori Kam wrote: > When offloading rules with the encap action, the HW may calculate entropy based on the encap protocol. > Each HW can implement a different algorithm. > Hi Ori, Can you please provide more details what this 'entropy' is used for, what is the usecase? > When the application receives packets that should have been > encaped by the HW, but didn't reach this stage yet (for example TCP SYN packets), > then when encap is done in SW, application must apply > the same entropy calculation algorithm. >> Using the new API application can request the PMD to calculate the > value as if the packet passed in the HW. > So is this new API a datapath API? Is the intention that application call this API per packet that is missing 'entropy' information? > Signed-off-by: Ori Kam > --- > lib/ethdev/rte_flow.h | 49 +++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 49 insertions(+) > > diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h > index affdc8121b..3989b089dd 100644 > --- a/lib/ethdev/rte_flow.h > +++ b/lib/ethdev/rte_flow.h > @@ -6753,6 +6753,55 @@ rte_flow_calc_table_hash(uint16_t port_id, const struct rte_flow_template_table > const struct rte_flow_item pattern[], uint8_t pattern_template_index, > uint32_t *hash, struct rte_flow_error *error); > > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice. > + * > + * Destination field type for the entropy calculation. > + * > + * @see function rte_flow_calc_encap_entropy > + */ > +enum rte_flow_entropy_dest { > + /* Calculate entropy placed in UDP source port field. */ > + RTE_FLOW_ENTROPY_DEST_UDP_SRC_PORT, > + /* Calculate entropy placed in NVGRE flow ID field. */ > + RTE_FLOW_ENTROPY_DEST_NVGRE_FLOW_ID, > +}; > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice. > + * > + * Calculate the entropy generated by the HW for a given pattern, > + * when encapsulation flow action is executed. > + * > + * @param[in] port_id > + * Port identifier of Ethernet device. > + * @param[in] pattern > + * The values to be used in the entropy calculation. > + * @param[in] dest_field > + * Type of destination field for entropy calculation. > + * @param[out] entropy > + * Used to return the calculated entropy. It will be written in network order, > + * so entropy[0] is the MSB. > + * The number of bytes is based on the destination field type. > Is the size same as field size in the 'dest_field'? Like for 'RTE_FLOW_ENTROPY_DEST_UDP_SRC_PORT' is it two bytes? > + * @param[out] error > + * Perform verbose error reporting if not NULL. > + * PMDs initialize this structure in case of error only. > + * > + * @return > + * - (0) if success. > + * - (-ENODEV) if *port_id* invalid. > + * - (-ENOTSUP) if underlying device does not support this functionality. > + * - (-EINVAL) if *pattern* doesn't hold enough information to calculate the entropy > + * or the dest is not supported. > + */ > +__rte_experimental > +int > +rte_flow_calc_encap_entropy(uint16_t port_id, const struct rte_flow_item pattern[], > + enum rte_flow_entropy_dest dest_field, uint8_t *entropy, > + struct rte_flow_error *error); > + > #ifdef __cplusplus > } > #endif