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 0AB5645C18; Thu, 31 Oct 2024 02:05:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ECCC0434EF; Thu, 31 Oct 2024 02:05:51 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2086.outbound.protection.outlook.com [40.107.102.86]) by mails.dpdk.org (Postfix) with ESMTP id ACDF6433A9 for ; Thu, 31 Oct 2024 02:05:49 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WgPmgMeJAxtMRPAXvvdE3kfinXggcYMYwy6uuNRlFvBVsdhNkEh7OOiRwY7opOBGqqx74As8PnpkwYzK8+6cCFx+xQGPPheVvSjuaHnMoZrUYA/1+NGheaKg5y5BRSMaUuqUt9xN/xRfwXY+mowvglTAFLuYsWtAv/CWkGwC7FsaAWn3Hy2tvdPnNllbQa1asRBqJxOp/6wbvapiKxKDwGUUiyHijEXmJTGslOglCxeVeohy0EJYBh1V9eo05os8DU0ZlCuDmwneFh0g036ndsnwG+Ssr7kmbuXRGuzW7QuT/uIFVyiTXOkLSDh4n5xi4kDqv8aq+1x4cKZKsnTxoA== 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=iHUKqXp1ou0LWGsGNtK7QfKi2iXBKAUfp0Y43HPI6dE=; b=ed/EpiQ9x8QkHld5a7SBmx3AaVKpQOdl//deaLaWWXATr0AA04z+HKcdVuaTx0oe9xMLdJn03IM4kYLghvJxhbhygltbbcuZffo7t8tFvwwW+FBgCturJA2VhPVi6sNOUCtLt2uz+WtU1iTU6JiAEFgPrqwNE9KR64o1GWm8rxBSfPqzdYwgSinrMnUnU/l79CZx6OyJTnmpQmhQCATKszjRoW84pFEceSjETj5wwHyUrrEQcBkDX4WD6uCR1d5lKqpMKJOglXBB9yvzek42kNeAG5a+i7adrEviW+sl9JlasJIlx+xGAZ5ECua/GAw1wrYCNmxKS6to0gh3rCnFPw== 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=iHUKqXp1ou0LWGsGNtK7QfKi2iXBKAUfp0Y43HPI6dE=; b=cTPXDKbDYph9QWqa8I6b8ulDgNw1u9JGWnkKgrBEwkj0ECB8mAcC6424gJxBpdwqYT0Y4zZLdOva6j/Q7TziuUop8e+0UwjC9kMJs2GzUPfnlxYAtwyrYUTFPHTVdBPD8i5Zv4WlZRM+V7Z0EmGkjZn/MyQIn6aE7EXIhkS5qgs= 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 DM3PR12MB9434.namprd12.prod.outlook.com (2603:10b6:0:4b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Thu, 31 Oct 2024 01:05:47 +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.8093.024; Thu, 31 Oct 2024 01:05:46 +0000 Message-ID: Date: Thu, 31 Oct 2024 01:05:40 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 05/86] net/ntnic: add minimal NT flow inline profile To: Serhii Iliushyk , "dev@dpdk.org" Cc: Mykola Kostenok , Christian Koue Muf , "andrew.rybchenko@oktetlabs.ru" , "stephen@networkplumber.org" References: <20241021210527.2075431-1-sil-plv@napatech.com> <20241029164243.1648775-1-sil-plv@napatech.com> <20241029164243.1648775-6-sil-plv@napatech.com> <70ea8bae-a599-481d-86b8-93d002bd2a81@amd.com> Content-Language: en-US From: Ferruh Yigit In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DB7PR05CA0004.eurprd05.prod.outlook.com (2603:10a6:10:36::17) To SJ2PR12MB8830.namprd12.prod.outlook.com (2603:10b6:a03:4d0::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR12MB8830:EE_|DM3PR12MB9434:EE_ X-MS-Office365-Filtering-Correlation-Id: 4fbf5800-9863-4f16-aea0-08dcf94826e6 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?R1E1OEpJdVByVHAwdk9hMnNqYjYrSFBTTUtsS1VLTUVSZmd1eS8wTDBwUTdI?= =?utf-8?B?ZWlEdUlsdi9MZHlQcmFpaFJtcE5sT1M2Q0dFRmZyYTY3amV3T2djUmlIRmNY?= =?utf-8?B?VTZWM21rdHZtenZzTEprU0h6OTMyNlE3M0tvYlVaRnhKRG50V3JielNQUWEw?= =?utf-8?B?MGZBaXdXaG5iMHRJNCtmbUs1T1M5Rlh6OTI3YXdqdVIyOXVJd3pHbG5ETFNC?= =?utf-8?B?a1pGZ2ZOZVNPMWNKUHdiU1FzOFpvOGVNN1lXd00vNnNDSlFML29HaGxialVx?= =?utf-8?B?ajdSZzJUb0lYb3NEeUpZYUVTcXRXMVRENHpuT2RwQ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GSDNoZzZOTFViSW9sUjRMM21tYlpqaUsrYUdLb2Nw?= =?utf-8?B?ZU1GY3RUQzR2T2lCaEUxa3IyRTJra3M1TkcwZ2hodFhsYUltOTNFcTdCNU9C?= =?utf-8?B?TzlGZDRVNHVxYkJ2U2dvMnZ0VFpZQU5GakpydlpFWDkzdzBLLzYraWdpZzVE?= =?utf-8?B?ekZUR3BNWlRxTVJuNEdjVUlCbmo1TW5OZndHUTdodFhQTjNoWG5LWlc3QTRt?= =?utf-8?B?ZkFhKzNFRVY0SUpLa2wyN3VuZ2xFRVRydzRxbGY5dEV4dExBMnptcUZWYWZq?= =?utf-8?B?MUcxaWgzUDZ3dGdsR3QreDVrR0N4R1VLZFJ2RlFqcmZuY3BJMytkVmJma2Fq?= =?utf-8?B?bDBBcGxQREFZN3I1SEtnSXJ0NDN1d01DTkJaZ2Z4cHY4V3MyNUc3UmRGWENR?= =?utf-8?B?MEs2d25lbnBaOVBqWUIrcnl6L3lTM2l1M0xvSG04VjhVT0owY2NldEpOWHBO?= =?utf-8?Q?zqPMN4wVWMYouKsvxacW?= 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?UXNxMnVjSnlBdEhSVjJTbFNwd3NEc2w2RUFId2lMbnh4ZHdMd0NqbTE3dFBD?= =?utf-8?B?TUpIVDd6MXhrWGkwYU0rQlJxZDJOd2lYQkU0cDJRem5SbWQ4ZkQ5U25TWXM5?= =?utf-8?B?TTZ4bFNEU0RaUi9jZUVPeTZKYzRWaVRaNThKVkh1dlc5TzJ5cXdiQUN5emht?= =?utf-8?B?OEFWclhpK3VMd2lRMTF2NlMzaGZURGljcTJvMTNXb1pa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Y3FpTDFFSEV6U1A1YXdmUEx2akNEbXdETnZubGdHclRIdzZTQjVpMXp2WFM4?= =?utf-8?B?OHZFVzYwUGFxdkRMTFdZUXV5Nk0vYUYrQkJsbHg2SUJZUDFlMU1sbExWbXY3?= =?utf-8?Q?WJA+Dcrf227tyTyQudukT2ySO?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4fbf5800-9863-4f16-aea0-08dcf94826e6 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR12MB8830.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 01:05:46.7732 (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: NxX7et54LsIuxG0cVm83DF/mJduDUhmh+DP0ey9QBb3QqXAOZyPTpIm+I4jb0ZIr X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB9434 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/30/2024 9:08 PM, Serhii Iliushyk wrote: >> On 30.10.2024, 03:56, "Ferruh Yigit" wrote: >> >> On 10/29/2024 4:41 PM, Serhii Iliushyk wrote: >>> The flow profile implements a all flow related operations >>> >> >> >> Can you please give some more details about the profiles, and "inline >> profile" mentioned? >> >> >>> Signed-off-by: Serhii Iliushyk > >>> --- >>> drivers/net/ntnic/include/flow_api.h | 15 +++++ >>> drivers/net/ntnic/https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmeson.build&c=E,1,3-LUdenxfqOoBy-HbMvK5R_o9qtMZZNE0F19ALnszQbAj5cUU-GdmZiycNh09BY4nVE_Qlw-Pr13vddTJpmb_0oBZCfzAMcNRtVlIfRA&typo=1 | 1 + >>> drivers/net/ntnic/nthw/flow_api/flow_api.c | 28 +++++++- >>> .../profile_inline/flow_api_profile_inline.c | 65 +++++++++++++++++++ >>> .../profile_inline/flow_api_profile_inline.h | 33 ++++++++++ >>> drivers/net/ntnic/ntnic_mod_reg.c | 12 +++- >>> drivers/net/ntnic/ntnic_mod_reg.h | 23 +++++++ >>> 7 files changed, 174 insertions(+), 3 deletions(-) >>> create mode 100644 drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c >>> create mode 100644 drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.h >>> >>> diff --git a/drivers/net/ntnic/include/flow_api.h b/drivers/net/ntnic/include/flow_api.h >>> index c80906ec50..3bdfdd4f94 100644 >>> --- a/drivers/net/ntnic/include/flow_api.h >>> +++ b/drivers/net/ntnic/include/flow_api.h >>> @@ -74,6 +74,21 @@ struct flow_nic_dev { >>> struct flow_nic_dev *next; >>> }; >>> >>> +enum flow_nic_err_msg_e { >>> + ERR_SUCCESS = 0, >>> + ERR_FAILED = 1, >>> + ERR_OUTPUT_TOO_MANY = 3, >>> + ERR_MATCH_INVALID_OR_UNSUPPORTED_ELEM = 12, >>> + ERR_MATCH_RESOURCE_EXHAUSTION = 14, >>> + ERR_ACTION_UNSUPPORTED = 28, >>> + ERR_REMOVE_FLOW_FAILED = 29, >>> + ERR_OUTPUT_INVALID = 33, >>> + ERR_ACTION_MULTIPLE_PORT_ID_UNSUPPORTED = 40, >>> + ERR_MSG_NO_MSG >>> +}; >>> + >>> +void flow_nic_set_error(enum flow_nic_err_msg_e msg, struct rte_flow_error *error); >>> + >>> /* >>> * Resources >>> */ >>> diff --git a/drivers/net/ntnic/https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmeson.build&c=E,1,JkeJQE_rpALNHr8SqBaVRLlDDbEL5EdOBXNqajuwseGrtrDcbtJEThEZxS8SOYA81WEBENa4Y3YVoU0q_IAzScErc1y1KOeKOG99MB9Xfls_jQyJnQ,,&typo=1 b/drivers/net/ntnic/https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmeson.build&c=E,1,0M6paR3-EwN18O8adbL-tbzs-1s_8MHatakMugSL_h3LzyBrM9gdLleDiJDSh-akPcT9y4YbgcIw_odTVAvhaO6sFcomFQaVYHdXdzYM5vJHpbdY&typo=1 >>> index d272c73c62..f5605e81cb 100644 >>> --- a/drivers/net/ntnic/https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmeson.build&c=E,1,A4iLxNwVi_0mKCG6VrkXqjF93-MHs6mtooOFwRaFDaHTcSDkkK6guLOt1nG5JZNlJjv7l6PvxOokDrUSTYNSixtC8VdSvOP5Ze1-Epx52R3YyVQ0et9K6w,,&typo=1 >>> +++ b/drivers/net/ntnic/https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmeson.build&c=E,1,VgoRksF64gHnqsTKesLw3bGf08ELIO9hZPpjBLt-omKH3u6vgrZl_u-Ww9dNMHJbawVJsQ0h6eYuZqQtne7BN6_EQDXfZN___5w0U_xS67C9YF59&typo=1 >>> @@ -47,6 +47,7 @@ sources = files( >>> 'nthw/core/nthw_sdc.c', >>> 'nthw/core/nthw_si5340.c', >>> 'nthw/flow_api/flow_api.c', >>> + 'nthw/flow_api/profile_inline/flow_api_profile_inline.c', >>> 'nthw/flow_api/flow_backend/flow_backend.c', >>> 'nthw/flow_api/flow_filter.c', >>> 'nthw/flow_api/flow_kcc.c', >>> diff --git a/drivers/net/ntnic/nthw/flow_api/flow_api.c b/drivers/net/ntnic/nthw/flow_api/flow_api.c >>> index d779dc481f..d0dad8e8f8 100644 >>> --- a/drivers/net/ntnic/nthw/flow_api/flow_api.c >>> +++ b/drivers/net/ntnic/nthw/flow_api/flow_api.c >>> @@ -36,6 +36,29 @@ const char *dbg_res_descr[] = { >>> static struct flow_nic_dev *dev_base; >>> static pthread_mutex_t base_mtx = PTHREAD_MUTEX_INITIALIZER; >>> >>> +/* >>> + * Error handling >>> + */ >>> + >>> +static const struct { >>> + const char *message; >>> +} err_msg[] = { >>> + /* 00 */ { "Operation successfully completed" }, >>> + /* 01 */ { "Operation failed" }, >>> + /* 29 */ { "Removing flow failed" }, >>> +}; >>> + >>> +void flow_nic_set_error(enum flow_nic_err_msg_e msg, struct rte_flow_error *error) >>> +{ >>> + assert(msg < ERR_MSG_NO_MSG); >>> + >>> + if (error) { >>> + error->message = err_msg[msg].message; >>> + error->type = (msg == ERR_SUCCESS) ? RTE_FLOW_ERROR_TYPE_NONE : >>> + RTE_FLOW_ERROR_TYPE_UNSPECIFIED; >>> + } >>> +} >>> + >>> /* >>> * Resources >>> */ >>> @@ -136,7 +159,8 @@ static struct flow_handle *flow_create(struct flow_eth_dev *dev __rte_unused, >>> return NULL; >>> } >>> >>> - return NULL; >>> + return profile_inline_ops->flow_create_profile_inline(dev, attr, >>> + forced_vlan_vid, caller_id, item, action, error); >>> } >>> >>> static int flow_destroy(struct flow_eth_dev *dev __rte_unused, >>> @@ -149,7 +173,7 @@ static int flow_destroy(struct flow_eth_dev *dev __rte_unused, >>> return -1; >>> } >>> >>> - return -1; >>> + return profile_inline_ops->flow_destroy_profile_inline(dev, flow, error); >>> } >>> >>> /* >>> diff --git a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c >>> new file mode 100644 >>> index 0000000000..a6293f5f82 >>> --- /dev/null >>> +++ b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c >>> @@ -0,0 +1,65 @@ >>> +/* >>> + * SPDX-License-Identifier: BSD-3-Clause >>> + * Copyright(c) 2023 Napatech A/S >>> + */ >>> + >>> +#include "ntlog.h" >>> + >>> +#include "flow_api_profile_inline.h" >>> +#include "ntnic_mod_reg.h" >>> + >>> +struct flow_handle *flow_create_profile_inline(struct flow_eth_dev *dev, >>> + const struct rte_flow_attr *attr, >>> + uint16_t forced_vlan_vid, >>> + uint16_t caller_id, >>> + const struct rte_flow_item elem[], >>> + const struct rte_flow_action action[], >>> + struct rte_flow_error *error) >>> +{ >>> + return NULL; >>> +} >>> + >>> +int flow_destroy_locked_profile_inline(struct flow_eth_dev *dev, >>> + struct flow_handle *fh, >>> + struct rte_flow_error *error) >>> +{ >>> + assert(dev); >>> + assert(fh); >>> + >>> + int err = 0; >>> + >>> + flow_nic_set_error(ERR_SUCCESS, error); >>> + >>> + return err; >>> +} >>> + >>> +int flow_destroy_profile_inline(struct flow_eth_dev *dev, struct flow_handle *flow, >>> + struct rte_flow_error *error) >>> +{ >>> + int err = 0; >>> + >>> + flow_nic_set_error(ERR_SUCCESS, error); >>> + >>> + if (flow) { >>> + /* Delete this flow */ >>> + pthread_mutex_lock(&dev->ndev->mtx); >>> + err = flow_destroy_locked_profile_inline(dev, flow, error); >>> + pthread_mutex_unlock(&dev->ndev->mtx); >>> + } >>> + >>> + return err; >>> +} >>> + >>> +static const struct profile_inline_ops ops = { >>> + /* >>> + * Flow functionality >>> + */ >>> + .flow_destroy_locked_profile_inline = flow_destroy_locked_profile_inline, >>> + .flow_create_profile_inline = flow_create_profile_inline, >>> + .flow_destroy_profile_inline = flow_destroy_profile_inline, >>> +}; >>> + >>> +void profile_inline_init(void) >>> +{ >>> + register_profile_inline_ops(&ops); >>> +} >>> diff --git a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.h b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.h >>> new file mode 100644 >>> index 0000000000..a83cc299b4 >>> --- /dev/null >>> +++ b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.h >>> @@ -0,0 +1,33 @@ >>> +/* >>> + * SPDX-License-Identifier: BSD-3-Clause >>> + * Copyright(c) 2023 Napatech A/S >>> + */ >>> + >>> +#ifndef _FLOW_API_PROFILE_INLINE_H_ >>> +#define _FLOW_API_PROFILE_INLINE_H_ >>> + >>> +#include >>> + >>> +#include "flow_api.h" >>> +#include "stream_binary_flow_api.h" >>> + >>> +/* >>> + * Flow functionality >>> + */ >>> +int flow_destroy_locked_profile_inline(struct flow_eth_dev *dev, >>> + struct flow_handle *fh, >>> + struct rte_flow_error *error); >>> + >>> +struct flow_handle *flow_create_profile_inline(struct flow_eth_dev *dev, >>> + const struct rte_flow_attr *attr, >>> + uint16_t forced_vlan_vid, >>> + uint16_t caller_id, >>> + const struct rte_flow_item elem[], >>> + const struct rte_flow_action action[], >>> + struct rte_flow_error *error); >>> + >>> +int flow_destroy_profile_inline(struct flow_eth_dev *dev, >>> + struct flow_handle *flow, >>> + struct rte_flow_error *error); >>> + >>> +#endif /* _FLOW_API_PROFILE_INLINE_H_ */ >>> diff --git a/drivers/net/ntnic/ntnic_mod_reg.c b/drivers/net/ntnic/ntnic_mod_reg.c >>> index ad2266116f..593b56bf5b 100644 >>> --- a/drivers/net/ntnic/ntnic_mod_reg.c >>> +++ b/drivers/net/ntnic/ntnic_mod_reg.c >>> @@ -118,9 +118,19 @@ const struct flow_backend_ops *get_flow_backend_ops(void) >>> return flow_backend_ops; >>> } >>> >>> +static const struct profile_inline_ops *profile_inline_ops; >>> + >>> +void register_profile_inline_ops(const struct profile_inline_ops *ops) >>> +{ >>> + profile_inline_ops = ops; >>> +} >>> + >>> const struct profile_inline_ops *get_profile_inline_ops(void) >>> { >>> - return NULL; >>> + if (profile_inline_ops == NULL) >>> + profile_inline_init(); >>> + >>> + return profile_inline_ops; >>> } >>> >>> static const struct flow_filter_ops *flow_filter_ops; >>> diff --git a/drivers/net/ntnic/ntnic_mod_reg.h b/drivers/net/ntnic/ntnic_mod_reg.h >>> index ec8c1612d1..d133336fad 100644 >>> --- a/drivers/net/ntnic/ntnic_mod_reg.h >>> +++ b/drivers/net/ntnic/ntnic_mod_reg.h >>> @@ -225,7 +225,30 @@ void register_flow_backend_ops(const struct flow_backend_ops *ops); >>> const struct flow_backend_ops *get_flow_backend_ops(void); >>> void flow_backend_init(void); >>> >>> +struct profile_inline_ops { >>> + /* >>> + * Flow functionality >>> + */ >>> + int (*flow_destroy_locked_profile_inline)(struct flow_eth_dev *dev, >>> + struct flow_handle *fh, >>> + struct rte_flow_error *error); >>> + >>> + struct flow_handle *(*flow_create_profile_inline)(struct flow_eth_dev *dev, >>> + const struct rte_flow_attr *attr, >>> + uint16_t forced_vlan_vid, >>> + uint16_t caller_id, >>> + const struct rte_flow_item elem[], >>> + const struct rte_flow_action action[], >>> + struct rte_flow_error *error); >>> + >>> + int (*flow_destroy_profile_inline)(struct flow_eth_dev *dev, >>> + struct flow_handle *flow, >>> + struct rte_flow_error *error); >>> +}; >>> + >>> +void register_profile_inline_ops(const struct profile_inline_ops *ops); >>> const struct profile_inline_ops *get_profile_inline_ops(void); >>> +void profile_inline_init(void); >>> >>> struct flow_filter_ops { >>> int (*flow_filter_init)(nthw_fpga_t *p_fpga, struct flow_nic_dev **p_flow_device, >> > > Hi Ferruh > > Please find below the description of NT FPGA profiles. > > The Napatech adapters support more different functionality than can fit into a single FPGA. > This functionality is grouped into a number of profiles called inline, capture, vswitch, and basic. > The adapter support we aim to upstream this time around, is for the inline profile. > The code contains some of the structures and enums needed to add other profiles, > mainly for future compatibility, and for compatibility with our legacy code base. > > Here is a short description of each profile: > Inline: Uses a scatter gather packet system, which is quite fast and lightweight. > The FPGA contains functionality for hardware offload use-cases, such as stateful flow matching, > encap/decap, packet steering etc. > vSwitch: Also uses the scatter gather system. The FPGA features are selected to support > the functionality of OVS. > Capture: Uses Napatech’s proprietary packet buffer system, > which requires a lot of space on the FPGA, but is extremely fast, guarantees zero packet loss, > and zero copy packet handling on the host cpu. > Basic: The same feature set as one might expect from a basic nic. > Mostly used in Kubernetes containers to reduce complexity. > Thanks Serhii, It is good to have this information in the driver documentation, and I will reflect some of this in to the relevant commit log.