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 C490F45ACC; Sun, 6 Oct 2024 22:41:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 591C340E18; Sun, 6 Oct 2024 22:38:26 +0200 (CEST) Received: from egress-ip42a.ess.de.barracuda.com (egress-ip42a.ess.de.barracuda.com [18.185.115.201]) by mails.dpdk.org (Postfix) with ESMTP id 2E7BA40B90 for ; Sun, 6 Oct 2024 22:38:01 +0200 (CEST) Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02lp2233.outbound.protection.outlook.com [104.47.11.233]) by mx-outbound44-124.eu-central-1c.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 06 Oct 2024 20:38:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=P69RFTRuVfl7q80XfqKMT3rkhxYyPgNmBFYl18806ucDccLV4sNvle+a1bA+sxx8K0nUgncf+76wBPEe4DtwVLEahlZDLDChboNXOEccofR+R844g5hfaG7qnyt4arv7F+Zde2J5vfVzMkzIzMtvBMC+5rTPmxl8NQUX+r/Cq7EWrEEHvFiKHcW5BtaWYcIAzR4Njyl6P7DKaOzmBqsv0MJ3+shJzYaTDlhnJMheeZPiUBIOTEazZOK2tji9Q1sPDiF7Zd1XP0RZin0ty4FkIKTZRLTnUqxBgchUPacm7ZL0D7vM1iwgkdy07tXmPssSFDqiaR0XCQoDKxEkDaH7OA== 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=xnYnin0spfMO0W/uJkkIxC38N7+rFzKTHek0Q8ZEjQU=; b=Ywmx5oYhX86CPwdH2mMFcL3lqFDVJUREdx9Bpuu9f9J7EtiwNOl5FLDYBjc7mPbM+uhtRLNqcK4Q5pRFbqJ/NQZqbxmA2DdcrsLVqojKEWSZCPe+wZsnF1kOn1J5fjUOS48s2msObywFadb9NQyUSGhFY+AiXPCSG67DQ9Quq6DjFKFPLIznDpQR7Or4XPrAkYhFYyC2UKsxZS1pDQEqdj1nYwsAlux9nfxEOao2bFJ/F9+8oRiLhKkzDPDxH0+WtVYXrmVUO4s0esSvGlN3m/XCzaFI5rwv3UbJtYKKmQg2JrC4WnZElaUFsFEfjENYWdgG8FN5nNAhpf8Yc9mDYg== 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=xnYnin0spfMO0W/uJkkIxC38N7+rFzKTHek0Q8ZEjQU=; b=VIju2djyXT0D3pCE+SQ6l39DyJUMOHbZwGeyVSGcV+xatUhw4O0gLPPKdcKo8gNLYe5Cc7beLiW8lGZ1X7JW4A56Gva2vIZdaJW6s7nmxk03nf7tYxZF4mv4ZNHK9PSZTfXEhqbTOwIeMs9Bcsk6vBrkhXaskfc01SQ80bfHtQs= Received: from AM6PR04CA0023.eurprd04.prod.outlook.com (2603:10a6:20b:92::36) by PAXP190MB1814.EURP190.PROD.OUTLOOK.COM (2603:10a6:102:28e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.20; Sun, 6 Oct 2024 20:37:58 +0000 Received: from AMS0EPF00000190.eurprd05.prod.outlook.com (2603:10a6:20b:92:cafe::b4) by AM6PR04CA0023.outlook.office365.com (2603:10a6:20b:92::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.20 via Frontend Transport; Sun, 6 Oct 2024 20:37:58 +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 AMS0EPF00000190.mail.protection.outlook.com (10.167.16.213) with Microsoft SMTP Server id 15.20.7918.13 via Frontend Transport; Sun, 6 Oct 2024 20:37:58 +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 v1 33/50] net/ntnic: add slicer (SLC LR) FPGA module Date: Sun, 6 Oct 2024 22:37:00 +0200 Message-ID: <20241006203728.330792-34-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241006203728.330792-1-sil-plv@napatech.com> References: <20241006203728.330792-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS0EPF00000190:EE_|PAXP190MB1814:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 22b334c4-80fb-4338-f389-08dce646c393 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info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QgxHRivZcoeKnqxSRZIAG/HKWHGGHl?= =?us-ascii?Q?wHTix8qP1w1M2fg/mYVrGQ/edIChwXjJLbHtWE3s+OW0WbBmK4e4gzBxGk89?= =?us-ascii?Q?LBzBefe2r6+/jPxws3GXYlvLXdyGk31sZk7ayQOwJgS0smt12mFNm2HgqJWN?= =?us-ascii?Q?eTKbFY9APmL9jzN1SkSVMVVhOTTL66h40YY/i2PAVk/Xdujs4SNUGkQj1hJk?= =?us-ascii?Q?a+em2oIgE+XakzDU03ql6YrwnrTRCcXRqbvEKJH2poKM0gg9323gStZFe+tR?= =?us-ascii?Q?x/j03y2ztyHGawpThfcPM8ieTJGQO0ILRzTntDGXUcwt9U7Cec8VxzaXDZtn?= =?us-ascii?Q?P2TSk15gVpeKWqSwz6vbC90NRyVx69MrFle4UILdJXX582K7bpCyV3nroRLD?= =?us-ascii?Q?SFFPHW3GCCbciNrPjiZ0bGgqOG1HCxaux30/j7kWwEtLYNKz1Mqsa+UjaejE?= =?us-ascii?Q?0B2wU6/cHZNPjFfHncgg0hlk/B4J7eX1EwOtV2XrCLJRzG0eBj57mH6WAb7V?= =?us-ascii?Q?eQf1O6WbsTkaJ3BIYC44m1biPwOr?= 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)(376014)(36860700013)(82310400026); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: FkAZ9Oh+6TLIX/+6P9EeU5M4eNP6SybC7gpTQ1cu+9TuLpQozFva5WsREppdFWKX18542pLPRDyi7Em61kDX5V32rzWAATfuChZQCI85CfvZU8OUKGIMQe2dDux2ongRYxA7dxVEz3EFbdgWxYCKuJF/atE95LENG4AG0dH3aqH+53+lIHXEAoASTmGD68z/rzLB8Dc6E7Ok5CcrcvKaTJ/HCsjewvy8LO4auj+4LUTE70udNjI7VM61apGMrLDj+kTOcNdsavHXKgW5DqlQP2hc/hg9sZzuiLROqxRh0w4C6Zmy4YJzTAfX462R3OYZvKXETAp1lCdoB6LFamASAFTfBGAk7JNsqAz3Zb3l6hkk56AyVJik51SAyz7PKrT1px1kVXkINWcaas0nPwz0apJxmVEvRT4eFsYftbzWuFV2fmvUH1oZD43BpCVKIjNE1lZJVesTmxLJEJNxrvXZEiZ8JwN49aRdKNIZb40Nh9bpmy0GjBaNnNN61lOPeAInjh7e0+PuJPVw1WdZlKYatvYxl6VHWbtvHVYN4w9TgRF7jO3/WM8LoVXqMRmo6FYhwQjkuFmyCX7hPNbr8IHn4SpuqnTrLF24m8sqvRW+BePqLVJoe4wh7Nkch19hcGV4Oobjh4glDIFrtQlfvHTLpQ== X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2024 20:37:58.1714 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 22b334c4-80fb-4338-f389-08dce646c393 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: AMS0EPF00000190.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXP190MB1814 X-BESS-ID: 1728247080-311388-7260-101887-1 X-BESS-VER: 2019.1_20240924.1654 X-BESS-Apparent-Source-IP: 104.47.11.233 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVqYGluZAVgZQ0DQ1Lc3Q1Mjc0D wRKGiclGhikJSclGZhYGppYGRknqxUGwsAMR6F40EAAAA= X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.259547 [from cloudscan15-206.eu-central-1a.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 --- 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 | 65 +++++++++++++++++++ 4 files changed, 91 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 13e0d1731e..b28192e682 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" @@ -580,6 +581,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; @@ -758,6 +778,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 4f16235a67..6b0ea2a4a6 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..d95352ec67 --- /dev/null +++ b/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_slc_lr.c @@ -0,0 +1,65 @@ +/* + * 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\n", 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: + 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\n"); + 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) + return INDEX_TOO_LARGE; + + return be->iface->slc_lr_rcp_flush(be->be_dev, &be->slc_lr, start_idx, count); +} -- 2.45.0