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 83CFC45B04; Thu, 10 Oct 2024 16:49:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 50B9D402A3; Thu, 10 Oct 2024 16:49:24 +0200 (CEST) Received: from egress-ip11b.ess.de.barracuda.com (egress-ip11b.ess.de.barracuda.com [18.185.115.215]) by mails.dpdk.org (Postfix) with ESMTP id F1F264028C for ; Thu, 10 Oct 2024 16:49:21 +0200 (CEST) Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03lp2105.outbound.protection.outlook.com [104.47.30.105]) by mx-outbound20-48.eu-central-1b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 10 Oct 2024 14:49:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZlAM6TZ4jOvJVXvAIwYgkpUrohw8eOD1l4Rlx5fstaz6flQLDFg9uNBCgFaOljKmij/8tVKk/lTOJChhHXSqb4PzEz5xcQnE3arEKZZ4jfT+vf4pyK9la5rR0f/T0xkNw4SGirpduZeyNRS/MVHtVCgO5YKKz8GyWGCThsBPzmFqXdMfHt8EaUd7vVHwC7lDrATN91ZX9kWmejVP+Li9YNQuQuri6t8nRGSUnwE6+tkDpB+fWKhDdQrmC/A7MY9GM5Nr3PwrOFzuVVL8j6cmcub/0hpX/eguu4ASEPVNdOOU7SsBd4fPmOZoc827+gwW5GsHcqW/CPcW5MxyqXLMTw== 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=aUxictFrC9QuMBQqaLn+O8aJ8q67JqcxdPp3ECbzxcw=; b=Qd971tRG4T8jVhituQmzTsoZWZB61nKEBoQ26YiciKW8EVe3ig1/6R8uzJO83bxRd+mbsrjCPyqPjOGlbWpyOOChjk6ONH7AECHAfKYFtEKixQjsbAzWkUxyhGv7lzjozx1ioK8Q1ST+vKlWTZ4R7UuM2uZO3gi7gpqGxEWU57Uem0OTTPsOcxEgaarE1HZ+RUS8ZZwBIj4Br7h5hrgS6Gizo8EAkUF6a/rEdQWMEvtXisCVFCThcZV/2TGQBR/KgQsSDMix4ms0kAL3r4KgJXkZK6nP490FdVTm7Nb1mnM1stWYhzf5vw6+1dHL+6H1QU8VjPLszUwa/o1Th72kcw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 178.72.21.4) smtp.rcpttodomain=dpdk.org smtp.mailfrom=napatech.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=napatech.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=napatech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aUxictFrC9QuMBQqaLn+O8aJ8q67JqcxdPp3ECbzxcw=; b=Q/qZmKtfhfGVfGCPzkgIqtWQJJyV6QoewxVPSkdl//nXHiQ+YX2QyDKUGfs2weiABA4Iu0rfIK9Cq7Rp8opWguWWorJml/PDUKrMNzQN2VlQq4CWJr3nvfsuDhc/9CwPW7EymOAme1kfiUcW9nlFt5nbb4ma169wZT9Vni4c8Dg= Received: from DU2PR04CA0073.eurprd04.prod.outlook.com (2603:10a6:10:232::18) by AM8P190MB0964.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:1d4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.16; Thu, 10 Oct 2024 14:14:56 +0000 Received: from DU6PEPF0000B61B.eurprd02.prod.outlook.com (2603:10a6:10:232:cafe::b4) by DU2PR04CA0073.outlook.office365.com (2603:10a6:10:232::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18 via Frontend Transport; Thu, 10 Oct 2024 14:14:56 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 178.72.21.4) smtp.mailfrom=napatech.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=napatech.com; Received-SPF: Fail (protection.outlook.com: domain of napatech.com does not designate 178.72.21.4 as permitted sender) receiver=protection.outlook.com; client-ip=178.72.21.4; helo=localhost.localdomain; Received: from localhost.localdomain (178.72.21.4) by DU6PEPF0000B61B.mail.protection.outlook.com (10.167.8.132) with Microsoft SMTP Server id 15.20.8048.13 via Frontend Transport; Thu, 10 Oct 2024 14:14:56 +0000 From: Serhii Iliushyk To: dev@dpdk.org Cc: mko-plv@napatech.com, sil-plv@napatech.com, ckm@napatech.com, andrew.rybchenko@oktetlabs.ru, ferruh.yigit@amd.com, Oleksandr Kolomeiets Subject: [PATCH v3 33/50] net/ntnic: add slicer (SLC LR) FPGA module Date: Thu, 10 Oct 2024 16:13:48 +0200 Message-ID: <20241010141416.4063591-34-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241010141416.4063591-1-sil-plv@napatech.com> References: <20241006203728.330792-2-sil-plv@napatech.com> <20241010141416.4063591-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU6PEPF0000B61B:EE_|AM8P190MB0964:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: e6ca54a6-3200-46b1-11b4-08dce935eaeb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?prmKiWdy5SNE3DrUXb9x2Za9W9OOX6b8Rr8CitB4Gx0szfsTJax932Ql7qRg?= =?us-ascii?Q?H9OGD2PI+VhrAGDuYap8u1RUUT0+jIkPDpQS/rDsYSoNFpXBEAjohOiLcqyI?= =?us-ascii?Q?/7C2VONb4MCAt4OJMVaW19OJkm9Ri5A6rKD5jRMHs1UuXl4Y/lRExHW89Ece?= =?us-ascii?Q?fAeLaM7e8f1dDhS0nQWyfzXP30XGOSwI6QaZdpWddLrIXsmeZeJHswQ+0bDJ?= =?us-ascii?Q?IDJqcG3O1z6IY1O9duoVCDYgJtTVhA4PFd6oZFYauPOI/asEvLTH+fvq71z4?= =?us-ascii?Q?jYvc5o7l8+Tr14BYCVPbj5X4P8IjRYJ0pd6kXjNzNdroeh6lcPNsqC4fbdsA?= =?us-ascii?Q?gZypWabt5HIybTCJ8tGXk60An5PCwCzxpytDFl49oA20ST1newxj/roKCjW5?= =?us-ascii?Q?HkZ2QSVqQ5R7Hyz1BpnrJdghHpiGU1YllLGnL3lDhLbsXesfFPH7DclbM6En?= =?us-ascii?Q?jYvVmBOdRcfxZK9juXOCJ5RKnBEYis+pmhzaSDA/dv/bujRcm2VhJAC5B8xf?= =?us-ascii?Q?zhJmrbZtd20xdnv42t3ZHRpoS3WdWT1a2FuJR2JVT2MpjiwCRKIPp5Ty4DC4?= =?us-ascii?Q?4RK1YCw9dH35EfRlgjD2UZhbxu26kP6I2idWPeVA0YY1ytkwarSOycUh+4e5?= =?us-ascii?Q?UjsZnZOmaSWcqrG8NAImKeht4jDmGaFQKnJTEsjKhivxvitw0zOK/tFi5Kux?= =?us-ascii?Q?CryVuoQP8FUSOcS5Kbqa2BU9G3I09HbNAhOVT7wq6gZWpWpu/hUbcXtVyKBy?= =?us-ascii?Q?SYIYgY45HCRgHfW6SmSkKjn3WhcVx44ipfk/+MQ7X2FOkMbJ2xEJXuIHO0VF?= =?us-ascii?Q?0lshkOFOo/kQsGDX3yaUWi6gcgc9i3mI5Y2SiYgF7OW71SA6jvWK5wWayrCX?= =?us-ascii?Q?WCSdrR/WxJ3M/3s04KM+jKJvRbq2/n0A3iSpw0FF953k6nCUXs2Sb63nXReq?= =?us-ascii?Q?Xi6iwt43cirEot0cF47ZfL0HrA7ryUKVdSuaPi6YbkvYkBDE1mFyzoWQOD9E?= =?us-ascii?Q?haaby6b7YSFW2+7H4HU7TB5wRYWy/mEOiSWjBr7Tt1Pmp77OcQFyLmFOxPZF?= =?us-ascii?Q?p4ptXBy0ynX87EGBP7iOme3b3RIHxMHbiwHdLexgnFgatxWKuWu+NwpWNOI5?= =?us-ascii?Q?0I6xeJWW0BKrmjgH6QNphZQlscN27e2llSAhX22ByrT0wI29GEMae2jr0ALo?= =?us-ascii?Q?KOmwM6ADLHsoQ0qEV7T0Ee2bwAT/f8XHuoIki88tXZH8/z3rN/VhGD9wVtIc?= =?us-ascii?Q?VywXd5grpZcJZxWq8gNVfzxhlbfgsZGvJNfyrQYb3ANzaELF7j+pZ4RRGQnY?= =?us-ascii?Q?v48sqvQKW3+nRUGeD3/H+ZzTasqL0p5nhKbn02X+xAbe4ICRXbxQ/asADAIb?= =?us-ascii?Q?3E0aMHZxAARMhEjAaO4d+6NzOM6D?= X-Forefront-Antispam-Report: CIP:178.72.21.4; CTRY:DK; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:localhost.localdomain; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(1800799024)(36860700013)(82310400026)(376014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: C9vOqNEQFInYGKP/lQHJa0S1eNRCpyAic/pVuz/Nf7OAR+DvK8e5N2ge1D+tLzmMZRNL1NMfHsWufchWYyUCQ7tL3xrmKcs+p7tLIKEHiPzX+shgQxRfu/yrQEpe9K9eBQeNSotpr6VBWhQXzukPb7ijBkkLr4Qv/hi1RxqWEsiC3QApWAWENf0R5pM95ZQleBHtsWbMLJu8V+w6LNVzK+9yVEitVOlN/ULN6LZDfJ4MRuKUvQN9WW8pwsHXIdEmIMO2MWxLyfhmpMww1LxbB518aR+2AVkf8favu4O1otFkGeT1FObZJzBzc14vhpiwh1IlKUzi+wSIXJCR7K3zwB2CjBSrn+h+bMKZQh5sLXpUtCcfbDbMF/P9kh/OI90j0C+zba5bolL23y9YSFqu0Rd8ajtz5v2iOrvU+tqbMmTxyfhM9skf7HuDrvOD43cNRRKbknthmW8fEcXVyaEHH9yiw4HSQL++IQQKWyRCcM61enqP/T+UulO5HZ3EkZ52iEhH2xOjpgQEKq8+sEchPCj8guw+oq9uL1xQpbKUX/1iuP4C1ArHrDf9QVGQi7AP8bBgiTGekP7levrKZh4GQ4HhPgsL9tOiiuEwV8h4CNCIjZbxyZDOE8A/HXhEHac4YyPehUdxVvo9Fq5DSKAjkpIcCtJI1d4/tT7+vrU2WYE= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 14:14:56.0767 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e6ca54a6-3200-46b1-11b4-08dce935eaeb X-MS-Exchange-CrossTenant-Id: c4540d0b-728a-4233-9da5-9ea30c7ec3ed X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c4540d0b-728a-4233-9da5-9ea30c7ec3ed; Ip=[178.72.21.4]; Helo=[localhost.localdomain] X-MS-Exchange-CrossTenant-AuthSource: DU6PEPF0000B61B.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8P190MB0964 X-OriginatorOrg: napatech.com X-BESS-ID: 1728571761-305168-12632-28937-1 X-BESS-VER: 2019.1_20241004.2057 X-BESS-Apparent-Source-IP: 104.47.30.105 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVqZGJsZAVgZQ0CjR3NgwMckiJc 0k2cAsxdzAzMgg1dw4LdHUIMnQwsJcqTYWANgxsvZBAAAA X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.259630 [from cloudscan22-12.eu-central-1b.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS113687 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 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 From: Oleksandr Kolomeiets The Slicer for Local Retransmit module can cut of the head a packet before the packet leaves the FPGA RX pipeline. This is used when the TX pipeline is configured to add a new head in the packet. Signed-off-by: Oleksandr Kolomeiets --- v3 * Remove newline characters from logs. * Modify macros according to new logging and fix braces --- drivers/net/ntnic/include/hw_mod_backend.h | 21 ++++++ drivers/net/ntnic/meson.build | 1 + .../nthw/flow_api/hw_mod/hw_mod_backend.c | 4 ++ .../nthw/flow_api/hw_mod/hw_mod_slc_lr.c | 68 +++++++++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_slc_lr.c diff --git a/drivers/net/ntnic/include/hw_mod_backend.h b/drivers/net/ntnic/include/hw_mod_backend.h index 52ad4f9ac8..b26db9d939 100644 --- a/drivers/net/ntnic/include/hw_mod_backend.h +++ b/drivers/net/ntnic/include/hw_mod_backend.h @@ -7,6 +7,7 @@ #define _HW_MOD_BACKEND_H_ #include +#include #include "ntlog.h" @@ -583,6 +584,25 @@ struct slc_lr_func_s { struct hw_mod_slc_lr_v2_s v2; }; }; +enum hw_slc_lr_e { + /* functions */ + HW_SLC_LR_RCP_PRESET_ALL = 0, + HW_SLC_LR_RCP_COMPARE, + HW_SLC_LR_RCP_FIND, + /* fields */ + HW_SLC_LR_RCP_HEAD_SLC_EN = FIELD_START_INDEX, + HW_SLC_LR_RCP_HEAD_DYN, + HW_SLC_LR_RCP_HEAD_OFS, + HW_SLC_LR_RCP_TAIL_SLC_EN, + HW_SLC_LR_RCP_TAIL_DYN, + HW_SLC_LR_RCP_TAIL_OFS, + HW_SLC_LR_RCP_PCAP +}; +bool hw_mod_slc_lr_present(struct flow_api_backend_s *be); +int hw_mod_slc_lr_alloc(struct flow_api_backend_s *be); +void hw_mod_slc_lr_free(struct flow_api_backend_s *be); +int hw_mod_slc_lr_reset(struct flow_api_backend_s *be); +int hw_mod_slc_lr_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count); struct pdb_func_s { COMMON_FUNC_INFO_S; @@ -761,6 +781,7 @@ struct flow_api_backend_s { struct flm_func_s flm; struct hsh_func_s hsh; struct qsl_func_s qsl; + struct slc_lr_func_s slc_lr; /* NIC attributes */ unsigned int num_phy_ports; diff --git a/drivers/net/ntnic/meson.build b/drivers/net/ntnic/meson.build index 02981ef987..4caee8ac41 100644 --- a/drivers/net/ntnic/meson.build +++ b/drivers/net/ntnic/meson.build @@ -54,6 +54,7 @@ sources = files( 'nthw/flow_api/hw_mod/hw_mod_hsh.c', 'nthw/flow_api/hw_mod/hw_mod_km.c', 'nthw/flow_api/hw_mod/hw_mod_qsl.c', + 'nthw/flow_api/hw_mod/hw_mod_slc_lr.c', 'nthw/flow_filter/flow_nthw_cat.c', 'nthw/flow_filter/flow_nthw_csu.c', 'nthw/flow_filter/flow_nthw_flm.c', diff --git a/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c b/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c index 3628c25754..d4458980a4 100644 --- a/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c +++ b/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c @@ -22,6 +22,10 @@ static const struct { { "FLM", hw_mod_flm_alloc, hw_mod_flm_free, hw_mod_flm_reset, hw_mod_flm_present }, { "HSH", hw_mod_hsh_alloc, hw_mod_hsh_free, hw_mod_hsh_reset, hw_mod_hsh_present }, { "QSL", hw_mod_qsl_alloc, hw_mod_qsl_free, hw_mod_qsl_reset, hw_mod_qsl_present }, + { + "SLC LR", hw_mod_slc_lr_alloc, hw_mod_slc_lr_free, hw_mod_slc_lr_reset, + hw_mod_slc_lr_present + }, }; #define MOD_COUNT (ARRAY_SIZE(module)) diff --git a/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_slc_lr.c b/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_slc_lr.c new file mode 100644 index 0000000000..1d878f3f96 --- /dev/null +++ b/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_slc_lr.c @@ -0,0 +1,68 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2023 Napatech A/S + */ + +#include +#include + +#include "hw_mod_backend.h" + +#define _MOD_ "SLC_LR" +#define _VER_ be->slc_lr.ver + +bool hw_mod_slc_lr_present(struct flow_api_backend_s *be) +{ + return be->iface->get_slc_lr_present(be->be_dev); +} + +int hw_mod_slc_lr_alloc(struct flow_api_backend_s *be) +{ + _VER_ = be->iface->get_slc_lr_version(be->be_dev); + NT_LOG(DBG, FILTER, "SLC LR MODULE VERSION %i.%i", VER_MAJOR(_VER_), VER_MINOR(_VER_)); + + switch (_VER_) { + case 2: + if (!callocate_mod((struct common_func_s *)&be->slc_lr, 1, &be->slc_lr.v2.rcp, + be->max_categories, sizeof(struct slc_lr_v2_rcp_s))) + return -1; + + break; + + default: + UNSUP_VER_LOG; + return UNSUP_VER; + } + + return 0; +} + +void hw_mod_slc_lr_free(struct flow_api_backend_s *be) +{ + if (be->slc_lr.base) { + free(be->slc_lr.base); + be->slc_lr.base = NULL; + } +} + +int hw_mod_slc_lr_reset(struct flow_api_backend_s *be) +{ + /* Zero entire cache area */ + zero_module_cache((struct common_func_s *)(&be->slc_lr)); + + NT_LOG(DBG, FILTER, "INIT SLC LR RCP"); + return hw_mod_slc_lr_rcp_flush(be, 0, be->max_categories); +} + +int hw_mod_slc_lr_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count) +{ + if (count == ALL_ENTRIES) + count = be->max_categories; + + if ((unsigned int)(start_idx + count) > be->max_categories) { + INDEX_TOO_LARGE_LOG; + return INDEX_TOO_LARGE; + } + + return be->iface->slc_lr_rcp_flush(be->be_dev, &be->slc_lr, start_idx, count); +} -- 2.45.0