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 0F6D645BA3; Tue, 22 Oct 2024 18:59:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6795C40E49; Tue, 22 Oct 2024 18:56:52 +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 4420540E17 for ; Tue, 22 Oct 2024 18:56:35 +0200 (CEST) Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03lp2241.outbound.protection.outlook.com [104.47.51.241]) by mx-outbound19-119.eu-central-1b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 22 Oct 2024 16:56:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gTxjZvgPBVfeOsmSm1nMmRBd5CIipYl89PYnGiF3xHX0WQElCXpsI4wnMh1gynA5ZThBHC3yeXEwG1eFrlZlelwslvykWMkWPx0ShoOMe3B/f7bN7jD4f95EyKcFBBJcCIYIUBDCpYjMlJzY+lMPyeP6RPp8XYa7Wm7D5wc97AnroR1UjMAg+Spj2fV5hDTrm6F7lgLSFGC45cgiUBgdApSpQprwH7V2lAfJbbr/lQzrR0tZnpioP8h0Y0YQ9zch/JkfrmJb0uVp5fqkxWMIAhkyFdZlsWfbjbCfFOflfaNL2QoWo7nwfZ/fjQ8+wAsSVar+Xi17pDXkUQy+Tgffgw== 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=z90m0AYOFLvesRYWukd43XanHKnaAUfDb5eizLX8FnY=; b=Xlk5YHuymfABwjZH6f+4OFONujJ0l2YwN87gCwhNSVu7W2JF40OAxSLICkPNaBm+copUXBq7N2AluyfTLSvqY6IilbVYiGizoZ1m9hgbbc7c+VE0YXB0W3QDLJ7TrD4k1KhYPMHxncYGGE8EC3PUB06w+xZKj9cR2/P6r9MdROTEmdWrcVWO8rIvievtfNd7aFgNdrQVIWLN0LIyvxzfSjUdRMkcbrrIdGT3HrVmpjv+jL8TbTdT72b9ed9EEhSLwtIMO2MWdLAFGFd7eb69A+oTZ/NrgC8ndw5GWxC0U+6omBwjcwUxqgLXHk2iAkWVaAs5lZmJ37k7k/etFMb1QA== 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=z90m0AYOFLvesRYWukd43XanHKnaAUfDb5eizLX8FnY=; b=dxoyRsshtHcQg3AEfsxs5ApyyiSFhcjICb6/HwBbJ1x+CXjSJUDZylcM7t0gA0HovVBJdcYCBMFX3we1xRPfmAljjm+art5w7xqnTXgZmymWMn+kInIGmTjUMvyNauWvkzd10Wd7CGlLLaltaeV5/GTEpfzHXhgt64zQH3zKZus= Received: from DB9PR06CA0012.eurprd06.prod.outlook.com (2603:10a6:10:1db::17) by AM8P190MB0962.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:1d2::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16; Tue, 22 Oct 2024 16:56:31 +0000 Received: from DU2PEPF0001E9C2.eurprd03.prod.outlook.com (2603:10a6:10:1db:cafe::4c) by DB9PR06CA0012.outlook.office365.com (2603:10a6:10:1db::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16 via Frontend Transport; Tue, 22 Oct 2024 16:56:31 +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 DU2PEPF0001E9C2.mail.protection.outlook.com (10.167.8.71) with Microsoft SMTP Server id 15.20.8093.14 via Frontend Transport; Tue, 22 Oct 2024 16:56:31 +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, stephen@networkplumber.org, Danylo Vodopianov Subject: [PATCH v2 29/73] net/ntnic: add QSL module Date: Tue, 22 Oct 2024 18:54:46 +0200 Message-ID: <20241022165541.3186140-30-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241022165541.3186140-1-sil-plv@napatech.com> References: <20241021210527.2075431-1-sil-plv@napatech.com> <20241022165541.3186140-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PEPF0001E9C2:EE_|AM8P190MB0962:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 882072c0-0657-450c-a839-08dcf2ba7aa5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?OSuRtFQhqR7cCsA15+bfQBsRZXVKHKKVuVgjKC1ET+Mnf6CAXnPYsNaZytRm?= =?us-ascii?Q?OX0bMK1V1PeR1YgC+MtZgyqpBBIt8+/AnA1ubqgkilkxoCf1V3DkzUTT1Qjt?= =?us-ascii?Q?PflGByewEqmK0xV/pZnCxx0RqpGHY3OiUKPPKX9klvBsSs76mQsRngQ3I+mw?= =?us-ascii?Q?zfgSZjCDuVYgRbmE706imtfgo7IDtwyBK6aiBU7yOwJdGvP6pWkP5mRwHHp0?= =?us-ascii?Q?9PmdZWq1AwC/mO42GqMva1An4hYwIPFFOxY9SBybWWVBgTtWX/WoDSga/HHA?= =?us-ascii?Q?X9eZ8pmnYs8Ifjc0pOpOioU/KJqYgakxyzGwxsdgsdDHu4FjgbD1j0syIC3z?= =?us-ascii?Q?kpcVviqmMw0114vxTTD2z4ZGkSg+EPANEfXAOfQEFJ94kg3yQMSYPXbGCq7x?= =?us-ascii?Q?pbvl8PGIkGzz9LzxnxYWTdkaSALL3d6ysLNAP+nZbr5HbcsFYegR329Ko53L?= =?us-ascii?Q?e/YUrtRgjGukpPiEcdiC/62h0Vp5i66ESTDVk+yCO3ZQH5WL7tOGomL+yswE?= =?us-ascii?Q?qiiAEFZYwFR+GhJcBkuTaKCkoE8mJiarx3XwQGS+yFRgjqj8Ypwb94XoUL+w?= =?us-ascii?Q?LPaTnlX5BtHvTlV4eS+f1eqZapTm2U2B9iAzPBdOA39htMQ7rt2ab/l5qOdQ?= =?us-ascii?Q?jCj7NNJwFuB1Pz3LlN/v+R1SmgLpfJ8ulxuNR9AQ2cWEIVxm9gJ6CoigQIy8?= =?us-ascii?Q?nD0buTMo/4r/z6J5Lj4h/CuX5gvib7KiPHqkoEvtaiD5YAQLRp5Ee+VO/Y+G?= =?us-ascii?Q?dXIv60QnmO1bbF0w9n9K5zb6WXyGmN7cx6svqBf+qbEf/syz4v6tV3uCV2ur?= =?us-ascii?Q?JR2MG66JR+ehPvSHb9XEfBb/nPNHAaznynSm7HE5zImX2dcGWwZPw5FHuHn8?= =?us-ascii?Q?MLTbZ1vyHcrv/2qzPAaqxOsbpkBQqwzggqLnM33CUgIxBxtBDjsSNlYoZCfk?= =?us-ascii?Q?XfkcEoueejKVpmXv058oKwLg1oY2vIo/1I0nD86MRPf3pbkMO04wEtrUAWZr?= =?us-ascii?Q?uzRmz+G7gXXS3Rv1KpTK74i2APfEC71hVptFcmNEdg3Ivb00vidEZcF9YIhh?= =?us-ascii?Q?a8tXj29xAc3H2Zo8TLAu7lXsLoB/G8U8puHc64uMxYuHc9QtyXz6yokvW1NW?= =?us-ascii?Q?SSZ/lwIiCvNJsxcYpa/pp0UIA1IGasZA45oE6Dc1ETGeA22pTxUozcT7Geaz?= =?us-ascii?Q?Vpj1PI0iLF5kLXejJjo/jjTXgROiMXQUFpD/hzJOz57ctFEvJsaPoObQ7tgu?= =?us-ascii?Q?IA8GEveV3jdY8oJg67BBu3iOdZJqGaP/sZhP4pJBVA483A8EhkyL+YWAgJbK?= =?us-ascii?Q?69tb2DQq76remfnhrmv98ZxZiShMCRNiedG2+mWP1pgJxRSOrze4VgEpw/lt?= =?us-ascii?Q?XleRriYH4ycOjBvtFDzNruWtn4UppA2lGQPzUUv8OBoDZrdDQQ=3D=3D?= 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)(376014)(1800799024)(82310400026)(36860700013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: NCZwpTG9W3T3BelPbExn5muP4WHDpjyAM13wkaSSxpM6eGeglP4qd37jEhtr5C19OXFoQ5HjI7T3N3h3HDQUE/A94BVW1u0RBwk6feY3Cc/UB1XVZhE6+Z9Ihm5PCJJZuH6hw5HRi4SHZUtd2PSOEaVAhqDcXvLhgbHkdkQbx/gZ8HSulpo8lN4kUykh/T0SIrAPWwMMlefmna7LiK7rMdSEOj9fkJAR6Ag77N6WtMIP/MtVhHePbX3LoBjDEFmk+ZYVGLVAcZWJPeqUcxG64RLcGXuPzGNOUUdglQsU/TvNaj4gf0Ckjdzp8R5WAyRFnU1KGYZfo+W6/Oy7NaPgB/SHw26l1bUfJEtI8OYOBOe1IFHVQJ1Cq33yRaY/RZrTs3tRzTfrmzrVC6WhPDuoCNtwH2iNWGlq093+GdTmRk3ZOU1EYbjYKQUb58QmJIWB4dFwZE/PvsKgB6RyT+usJTuK3CiUA+u0lRQ3fmGtcSFn76u2v63L7L+M6UxczpuLHLKm06VJWgBFjXYnS6MuTcP1Yu2/ttjKfGE2GhrEc4q2kHDQ7W9nWGMlEDGny0WPtlVedbM/aDDjMRJXlB5o72LKF7eU+atFICD3u1fstclR8GOptWtPX9sgOlLUS8A5n3iD/GpbhRY1Fq4V4l0CMRD7hKs3GIVEq1kj2MT3hwc= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2024 16:56:31.2158 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 882072c0-0657-450c-a839-08dcf2ba7aa5 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: DU2PEPF0001E9C2.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8P190MB0962 X-BESS-ID: 1729616193-304983-12655-14399-1 X-BESS-VER: 2019.1_20241018.1852 X-BESS-Apparent-Source-IP: 104.47.51.241 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVkbmBiYWQGYGUNTcIC3RKNXSIM 3ENC3JwtjM3CQ5zSQ5McnE0tDMyNAwTak2FgCfgXsJQgAAAA== X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.259902 [from cloudscan15-77.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: Danylo Vodopianov The Queue Selector module directs packets to a given destination which includes host queues, physical ports, exceptions paths, and discard. Signed-off-by: Danylo Vodopianov --- drivers/net/ntnic/include/flow_api.h | 3 + drivers/net/ntnic/include/hw_mod_backend.h | 8 + drivers/net/ntnic/nthw/flow_api/flow_api.c | 65 ++++++ .../ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c | 218 ++++++++++++++++++ .../profile_inline/flow_api_hw_db_inline.c | 195 ++++++++++++++++ .../profile_inline/flow_api_hw_db_inline.h | 11 + .../profile_inline/flow_api_profile_inline.c | 96 +++++++- 7 files changed, 595 insertions(+), 1 deletion(-) diff --git a/drivers/net/ntnic/include/flow_api.h b/drivers/net/ntnic/include/flow_api.h index 7f031ccda8..edffd0a57a 100644 --- a/drivers/net/ntnic/include/flow_api.h +++ b/drivers/net/ntnic/include/flow_api.h @@ -184,8 +184,11 @@ extern const char *dbg_res_descr[]; int flow_nic_alloc_resource(struct flow_nic_dev *ndev, enum res_type_e res_type, uint32_t alignment); +int flow_nic_alloc_resource_config(struct flow_nic_dev *ndev, enum res_type_e res_type, + unsigned int num, uint32_t alignment); void flow_nic_free_resource(struct flow_nic_dev *ndev, enum res_type_e res_type, int idx); +int flow_nic_ref_resource(struct flow_nic_dev *ndev, enum res_type_e res_type, int index); int flow_nic_deref_resource(struct flow_nic_dev *ndev, enum res_type_e res_type, int index); #endif diff --git a/drivers/net/ntnic/include/hw_mod_backend.h b/drivers/net/ntnic/include/hw_mod_backend.h index 7f1449d8ee..6fa2a3d94f 100644 --- a/drivers/net/ntnic/include/hw_mod_backend.h +++ b/drivers/net/ntnic/include/hw_mod_backend.h @@ -666,8 +666,16 @@ int hw_mod_qsl_alloc(struct flow_api_backend_s *be); void hw_mod_qsl_free(struct flow_api_backend_s *be); int hw_mod_qsl_reset(struct flow_api_backend_s *be); int hw_mod_qsl_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count); +int hw_mod_qsl_rcp_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index, + uint32_t value); int hw_mod_qsl_qst_flush(struct flow_api_backend_s *be, int start_idx, int count); +int hw_mod_qsl_qst_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index, + uint32_t value); int hw_mod_qsl_qen_flush(struct flow_api_backend_s *be, int start_idx, int count); +int hw_mod_qsl_qen_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index, + uint32_t value); +int hw_mod_qsl_qen_get(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index, + uint32_t *value); int hw_mod_qsl_unmq_flush(struct flow_api_backend_s *be, int start_idx, int count); int hw_mod_qsl_unmq_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index, uint32_t value); diff --git a/drivers/net/ntnic/nthw/flow_api/flow_api.c b/drivers/net/ntnic/nthw/flow_api/flow_api.c index 2aee2ee973..a51d621ef9 100644 --- a/drivers/net/ntnic/nthw/flow_api/flow_api.c +++ b/drivers/net/ntnic/nthw/flow_api/flow_api.c @@ -106,11 +106,52 @@ int flow_nic_alloc_resource(struct flow_nic_dev *ndev, enum res_type_e res_type, return -1; } +int flow_nic_alloc_resource_config(struct flow_nic_dev *ndev, enum res_type_e res_type, + unsigned int num, uint32_t alignment) +{ + unsigned int idx_offs; + + for (unsigned int res_idx = 0; res_idx < ndev->res[res_type].resource_count - (num - 1); + res_idx += alignment) { + if (!flow_nic_is_resource_used(ndev, res_type, res_idx)) { + for (idx_offs = 1; idx_offs < num; idx_offs++) + if (flow_nic_is_resource_used(ndev, res_type, res_idx + idx_offs)) + break; + + if (idx_offs < num) + continue; + + /* found a contiguous number of "num" res_type elements - allocate them */ + for (idx_offs = 0; idx_offs < num; idx_offs++) { + flow_nic_mark_resource_used(ndev, res_type, res_idx + idx_offs); + ndev->res[res_type].ref[res_idx + idx_offs] = 1; + } + + return res_idx; + } + } + + return -1; +} + void flow_nic_free_resource(struct flow_nic_dev *ndev, enum res_type_e res_type, int idx) { flow_nic_mark_resource_unused(ndev, res_type, idx); } +int flow_nic_ref_resource(struct flow_nic_dev *ndev, enum res_type_e res_type, int index) +{ + NT_LOG(DBG, FILTER, "Reference resource %s idx %i (before ref cnt %i)", + dbg_res_descr[res_type], index, ndev->res[res_type].ref[index]); + assert(flow_nic_is_resource_used(ndev, res_type, index)); + + if (ndev->res[res_type].ref[index] == (uint32_t)-1) + return -1; + + ndev->res[res_type].ref[index]++; + return 0; +} + int flow_nic_deref_resource(struct flow_nic_dev *ndev, enum res_type_e res_type, int index) { NT_LOG(DBG, FILTER, "De-reference resource %s idx %i (before ref cnt %i)", @@ -348,6 +389,18 @@ int flow_delete_eth_dev(struct flow_eth_dev *eth_dev) hw_mod_qsl_unmq_set(&ndev->be, HW_QSL_UNMQ_EN, eth_dev->port, 0); hw_mod_qsl_unmq_flush(&ndev->be, eth_dev->port, 1); + if (ndev->flow_profile == FLOW_ETH_DEV_PROFILE_INLINE) { + for (int i = 0; i < eth_dev->num_queues; ++i) { + uint32_t qen_value = 0; + uint32_t queue_id = (uint32_t)eth_dev->rx_queue[i].hw_id; + + hw_mod_qsl_qen_get(&ndev->be, HW_QSL_QEN_EN, queue_id / 4, &qen_value); + hw_mod_qsl_qen_set(&ndev->be, HW_QSL_QEN_EN, queue_id / 4, + qen_value & ~(1U << (queue_id % 4))); + hw_mod_qsl_qen_flush(&ndev->be, queue_id / 4, 1); + } + } + #ifdef FLOW_DEBUG ndev->be.iface->set_debug_mode(ndev->be.be_dev, FLOW_BACKEND_DEBUG_MODE_NONE); #endif @@ -580,6 +633,18 @@ static struct flow_eth_dev *flow_get_eth_dev(uint8_t adapter_no, uint8_t port_no eth_dev->rss_target_id = -1; + if (flow_profile == FLOW_ETH_DEV_PROFILE_INLINE) { + for (i = 0; i < eth_dev->num_queues; i++) { + uint32_t qen_value = 0; + uint32_t queue_id = (uint32_t)eth_dev->rx_queue[i].hw_id; + + hw_mod_qsl_qen_get(&ndev->be, HW_QSL_QEN_EN, queue_id / 4, &qen_value); + hw_mod_qsl_qen_set(&ndev->be, HW_QSL_QEN_EN, queue_id / 4, + qen_value | (1 << (queue_id % 4))); + hw_mod_qsl_qen_flush(&ndev->be, queue_id / 4, 1); + } + } + *rss_target_id = eth_dev->rss_target_id; nic_insert_eth_port_dev(ndev, eth_dev); diff --git a/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c b/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c index 93b37d595e..70fe97a298 100644 --- a/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c +++ b/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c @@ -104,6 +104,114 @@ int hw_mod_qsl_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count return be->iface->qsl_rcp_flush(be->be_dev, &be->qsl, start_idx, count); } +static int hw_mod_qsl_rcp_mod(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index, + uint32_t *value, int get) +{ + if (index >= be->qsl.nb_rcp_categories) { + INDEX_TOO_LARGE_LOG; + return INDEX_TOO_LARGE; + } + + switch (_VER_) { + case 7: + switch (field) { + case HW_QSL_RCP_PRESET_ALL: + if (get) { + UNSUP_FIELD_LOG; + return UNSUP_FIELD; + } + + memset(&be->qsl.v7.rcp[index], (uint8_t)*value, + sizeof(struct qsl_v7_rcp_s)); + break; + + case HW_QSL_RCP_FIND: + if (!get) { + UNSUP_FIELD_LOG; + return UNSUP_FIELD; + } + + if (*value >= be->qsl.nb_rcp_categories) { + INDEX_TOO_LARGE_LOG; + return INDEX_TOO_LARGE; + } + + FIND_EQUAL_INDEX(be->qsl.v7.rcp, struct qsl_v7_rcp_s, index, *value, + be->qsl.nb_rcp_categories); + break; + + case HW_QSL_RCP_COMPARE: + if (!get) { + UNSUP_FIELD_LOG; + return UNSUP_FIELD; + } + + if (*value >= be->qsl.nb_rcp_categories) { + INDEX_TOO_LARGE_LOG; + return INDEX_TOO_LARGE; + } + + DO_COMPARE_INDEXS(be->qsl.v7.rcp, struct qsl_v7_rcp_s, index, *value); + break; + + case HW_QSL_RCP_DISCARD: + GET_SET(be->qsl.v7.rcp[index].discard, value); + break; + + case HW_QSL_RCP_DROP: + GET_SET(be->qsl.v7.rcp[index].drop, value); + break; + + case HW_QSL_RCP_TBL_LO: + GET_SET(be->qsl.v7.rcp[index].tbl_lo, value); + break; + + case HW_QSL_RCP_TBL_HI: + GET_SET(be->qsl.v7.rcp[index].tbl_hi, value); + break; + + case HW_QSL_RCP_TBL_IDX: + GET_SET(be->qsl.v7.rcp[index].tbl_idx, value); + break; + + case HW_QSL_RCP_TBL_MSK: + GET_SET(be->qsl.v7.rcp[index].tbl_msk, value); + break; + + case HW_QSL_RCP_LR: + GET_SET(be->qsl.v7.rcp[index].lr, value); + break; + + case HW_QSL_RCP_TSA: + GET_SET(be->qsl.v7.rcp[index].tsa, value); + break; + + case HW_QSL_RCP_VLI: + GET_SET(be->qsl.v7.rcp[index].vli, value); + break; + + default: + UNSUP_FIELD_LOG; + return UNSUP_FIELD; + } + + break; + + /* end case 7 */ + default: + UNSUP_VER_LOG; + return UNSUP_VER; + } + + return 0; +} + +int hw_mod_qsl_rcp_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index, + uint32_t value) +{ + return hw_mod_qsl_rcp_mod(be, field, index, &value, 0); +} + int hw_mod_qsl_qst_flush(struct flow_api_backend_s *be, int start_idx, int count) { if (count == ALL_ENTRIES) @@ -117,6 +225,73 @@ int hw_mod_qsl_qst_flush(struct flow_api_backend_s *be, int start_idx, int count return be->iface->qsl_qst_flush(be->be_dev, &be->qsl, start_idx, count); } +static int hw_mod_qsl_qst_mod(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index, + uint32_t *value, int get) +{ + if (index >= be->qsl.nb_qst_entries) { + INDEX_TOO_LARGE_LOG; + return INDEX_TOO_LARGE; + } + + switch (_VER_) { + case 7: + switch (field) { + case HW_QSL_QST_PRESET_ALL: + if (get) { + UNSUP_FIELD_LOG; + return UNSUP_FIELD; + } + + memset(&be->qsl.v7.qst[index], (uint8_t)*value, + sizeof(struct qsl_v7_qst_s)); + break; + + case HW_QSL_QST_QUEUE: + GET_SET(be->qsl.v7.qst[index].queue, value); + break; + + case HW_QSL_QST_EN: + GET_SET(be->qsl.v7.qst[index].en, value); + break; + + case HW_QSL_QST_TX_PORT: + GET_SET(be->qsl.v7.qst[index].tx_port, value); + break; + + case HW_QSL_QST_LRE: + GET_SET(be->qsl.v7.qst[index].lre, value); + break; + + case HW_QSL_QST_TCI: + GET_SET(be->qsl.v7.qst[index].tci, value); + break; + + case HW_QSL_QST_VEN: + GET_SET(be->qsl.v7.qst[index].ven, value); + break; + + default: + UNSUP_FIELD_LOG; + return UNSUP_FIELD; + } + + break; + + /* end case 7 */ + default: + UNSUP_VER_LOG; + return UNSUP_VER; + } + + return 0; +} + +int hw_mod_qsl_qst_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index, + uint32_t value) +{ + return hw_mod_qsl_qst_mod(be, field, index, &value, 0); +} + int hw_mod_qsl_qen_flush(struct flow_api_backend_s *be, int start_idx, int count) { if (count == ALL_ENTRIES) @@ -130,6 +305,49 @@ int hw_mod_qsl_qen_flush(struct flow_api_backend_s *be, int start_idx, int count return be->iface->qsl_qen_flush(be->be_dev, &be->qsl, start_idx, count); } +static int hw_mod_qsl_qen_mod(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index, + uint32_t *value, int get) +{ + if (index >= QSL_QEN_ENTRIES) { + INDEX_TOO_LARGE_LOG; + return INDEX_TOO_LARGE; + } + + switch (_VER_) { + case 7: + switch (field) { + case HW_QSL_QEN_EN: + GET_SET(be->qsl.v7.qen[index].en, value); + break; + + default: + UNSUP_FIELD_LOG; + return UNSUP_FIELD; + } + + break; + + /* end case 7 */ + default: + UNSUP_VER_LOG; + return UNSUP_VER; + } + + return 0; +} + +int hw_mod_qsl_qen_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index, + uint32_t value) +{ + return hw_mod_qsl_qen_mod(be, field, index, &value, 0); +} + +int hw_mod_qsl_qen_get(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index, + uint32_t *value) +{ + return hw_mod_qsl_qen_mod(be, field, index, value, 1); +} + int hw_mod_qsl_unmq_flush(struct flow_api_backend_s *be, int start_idx, int count) { if (count == ALL_ENTRIES) diff --git a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.c b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.c index b17bce3745..5572662647 100644 --- a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.c +++ b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.c @@ -20,12 +20,18 @@ struct hw_db_inline_resource_db { int ref; } *cot; + struct hw_db_inline_resource_db_qsl { + struct hw_db_inline_qsl_data data; + int qst_idx; + } *qsl; + struct hw_db_inline_resource_db_slc_lr { struct hw_db_inline_slc_lr_data data; int ref; } *slc_lr; uint32_t nb_cot; + uint32_t nb_qsl; uint32_t nb_slc_lr; /* Items */ @@ -61,6 +67,14 @@ int hw_db_inline_create(struct flow_nic_dev *ndev, void **db_handle) return -1; } + db->nb_qsl = ndev->be.qsl.nb_rcp_categories; + db->qsl = calloc(db->nb_qsl, sizeof(struct hw_db_inline_resource_db_qsl)); + + if (db->qsl == NULL) { + hw_db_inline_destroy(db); + return -1; + } + db->nb_slc_lr = ndev->be.max_categories; db->slc_lr = calloc(db->nb_slc_lr, sizeof(struct hw_db_inline_resource_db_slc_lr)); @@ -86,6 +100,7 @@ void hw_db_inline_destroy(void *db_handle) struct hw_db_inline_resource_db *db = (struct hw_db_inline_resource_db *)db_handle; free(db->cot); + free(db->qsl); free(db->slc_lr); free(db->cat); @@ -110,6 +125,10 @@ void hw_db_inline_deref_idxs(struct flow_nic_dev *ndev, void *db_handle, struct hw_db_inline_cot_deref(ndev, db_handle, *(struct hw_db_cot_idx *)&idxs[i]); break; + case HW_DB_IDX_TYPE_QSL: + hw_db_inline_qsl_deref(ndev, db_handle, *(struct hw_db_qsl_idx *)&idxs[i]); + break; + case HW_DB_IDX_TYPE_SLC_LR: hw_db_inline_slc_lr_deref(ndev, db_handle, *(struct hw_db_slc_lr_idx *)&idxs[i]); @@ -145,6 +164,13 @@ int hw_db_inline_setup_mbr_filter(struct flow_nic_dev *ndev, uint32_t cat_hw_id, const int offset = ((int)ndev->be.cat.cts_num + 1) / 2; (void)offset; + /* QSL for traffic policing */ + if (hw_mod_qsl_rcp_set(&ndev->be, HW_QSL_RCP_DROP, qsl_hw_id, 0x3) < 0) + return -1; + + if (hw_mod_qsl_rcp_flush(&ndev->be, qsl_hw_id, 1) < 0) + return -1; + /* Select and enable QSL recipe */ if (hw_mod_cat_cts_set(&ndev->be, HW_CAT_CTS_CAT_B, offset * cat_hw_id + 1, qsl_hw_id)) return -1; @@ -255,6 +281,175 @@ void hw_db_inline_cot_deref(struct flow_nic_dev *ndev __rte_unused, void *db_han } } +/******************************************************************************/ +/* QSL */ +/******************************************************************************/ + +/* Calculate queue mask for QSL TBL_MSK for given number of queues. + * NOTE: If number of queues is not power of two, then queue mask will be created + * for nearest smaller power of two. + */ +static uint32_t queue_mask(uint32_t nr_queues) +{ + nr_queues |= nr_queues >> 1; + nr_queues |= nr_queues >> 2; + nr_queues |= nr_queues >> 4; + nr_queues |= nr_queues >> 8; + nr_queues |= nr_queues >> 16; + return nr_queues >> 1; +} + +static int hw_db_inline_qsl_compare(const struct hw_db_inline_qsl_data *data1, + const struct hw_db_inline_qsl_data *data2) +{ + if (data1->discard != data2->discard || data1->drop != data2->drop || + data1->table_size != data2->table_size || data1->retransmit != data2->retransmit) { + return 0; + } + + for (int i = 0; i < HW_DB_INLINE_MAX_QST_PER_QSL; ++i) { + if (data1->table[i].queue != data2->table[i].queue || + data1->table[i].queue_en != data2->table[i].queue_en || + data1->table[i].tx_port != data2->table[i].tx_port || + data1->table[i].tx_port_en != data2->table[i].tx_port_en) { + return 0; + } + } + + return 1; +} + +struct hw_db_qsl_idx hw_db_inline_qsl_add(struct flow_nic_dev *ndev, void *db_handle, + const struct hw_db_inline_qsl_data *data) +{ + struct hw_db_inline_resource_db *db = (struct hw_db_inline_resource_db *)db_handle; + struct hw_db_qsl_idx qsl_idx = { .raw = 0 }; + uint32_t qst_idx = 0; + int res; + + qsl_idx.type = HW_DB_IDX_TYPE_QSL; + + if (data->discard) { + qsl_idx.ids = 0; + return qsl_idx; + } + + for (uint32_t i = 1; i < db->nb_qsl; ++i) { + if (hw_db_inline_qsl_compare(data, &db->qsl[i].data)) { + qsl_idx.ids = i; + hw_db_inline_qsl_ref(ndev, db, qsl_idx); + return qsl_idx; + } + } + + res = flow_nic_alloc_resource(ndev, RES_QSL_RCP, 1); + + if (res < 0) { + qsl_idx.error = 1; + return qsl_idx; + } + + qsl_idx.ids = res & 0xff; + + if (data->table_size > 0) { + res = flow_nic_alloc_resource_config(ndev, RES_QSL_QST, data->table_size, 1); + + if (res < 0) { + flow_nic_deref_resource(ndev, RES_QSL_RCP, qsl_idx.ids); + qsl_idx.error = 1; + return qsl_idx; + } + + qst_idx = (uint32_t)res; + } + + memcpy(&db->qsl[qsl_idx.ids].data, data, sizeof(struct hw_db_inline_qsl_data)); + db->qsl[qsl_idx.ids].qst_idx = qst_idx; + + hw_mod_qsl_rcp_set(&ndev->be, HW_QSL_RCP_PRESET_ALL, qsl_idx.ids, 0x0); + + hw_mod_qsl_rcp_set(&ndev->be, HW_QSL_RCP_DISCARD, qsl_idx.ids, data->discard); + hw_mod_qsl_rcp_set(&ndev->be, HW_QSL_RCP_DROP, qsl_idx.ids, data->drop * 0x3); + hw_mod_qsl_rcp_set(&ndev->be, HW_QSL_RCP_LR, qsl_idx.ids, data->retransmit * 0x3); + + if (data->table_size == 0) { + hw_mod_qsl_rcp_set(&ndev->be, HW_QSL_RCP_TBL_LO, qsl_idx.ids, 0x0); + hw_mod_qsl_rcp_set(&ndev->be, HW_QSL_RCP_TBL_HI, qsl_idx.ids, 0x0); + hw_mod_qsl_rcp_set(&ndev->be, HW_QSL_RCP_TBL_IDX, qsl_idx.ids, 0x0); + hw_mod_qsl_rcp_set(&ndev->be, HW_QSL_RCP_TBL_MSK, qsl_idx.ids, 0x0); + + } else { + const uint32_t table_start = qst_idx; + const uint32_t table_end = table_start + data->table_size - 1; + + hw_mod_qsl_rcp_set(&ndev->be, HW_QSL_RCP_TBL_LO, qsl_idx.ids, table_start); + hw_mod_qsl_rcp_set(&ndev->be, HW_QSL_RCP_TBL_HI, qsl_idx.ids, table_end); + + /* Toeplitz hash function uses TBL_IDX and TBL_MSK. */ + uint32_t msk = queue_mask(table_end - table_start + 1); + hw_mod_qsl_rcp_set(&ndev->be, HW_QSL_RCP_TBL_IDX, qsl_idx.ids, table_start); + hw_mod_qsl_rcp_set(&ndev->be, HW_QSL_RCP_TBL_MSK, qsl_idx.ids, msk); + + for (uint32_t i = 0; i < data->table_size; ++i) { + hw_mod_qsl_qst_set(&ndev->be, HW_QSL_QST_PRESET_ALL, table_start + i, 0x0); + + hw_mod_qsl_qst_set(&ndev->be, HW_QSL_QST_TX_PORT, table_start + i, + data->table[i].tx_port); + hw_mod_qsl_qst_set(&ndev->be, HW_QSL_QST_LRE, table_start + i, + data->table[i].tx_port_en); + + hw_mod_qsl_qst_set(&ndev->be, HW_QSL_QST_QUEUE, table_start + i, + data->table[i].queue); + hw_mod_qsl_qst_set(&ndev->be, HW_QSL_QST_EN, table_start + i, + data->table[i].queue_en); + } + + hw_mod_qsl_qst_flush(&ndev->be, table_start, data->table_size); + } + + hw_mod_qsl_rcp_flush(&ndev->be, qsl_idx.ids, 1); + + return qsl_idx; +} + +void hw_db_inline_qsl_ref(struct flow_nic_dev *ndev, void *db_handle, struct hw_db_qsl_idx idx) +{ + (void)db_handle; + + if (!idx.error && idx.ids != 0) + flow_nic_ref_resource(ndev, RES_QSL_RCP, idx.ids); +} + +void hw_db_inline_qsl_deref(struct flow_nic_dev *ndev, void *db_handle, struct hw_db_qsl_idx idx) +{ + struct hw_db_inline_resource_db *db = (struct hw_db_inline_resource_db *)db_handle; + + if (idx.error || idx.ids == 0) + return; + + if (flow_nic_deref_resource(ndev, RES_QSL_RCP, idx.ids) == 0) { + const int table_size = (int)db->qsl[idx.ids].data.table_size; + + hw_mod_qsl_rcp_set(&ndev->be, HW_QSL_RCP_PRESET_ALL, idx.ids, 0x0); + hw_mod_qsl_rcp_flush(&ndev->be, idx.ids, 1); + + if (table_size > 0) { + const int table_start = db->qsl[idx.ids].qst_idx; + + for (int i = 0; i < (int)table_size; ++i) { + hw_mod_qsl_qst_set(&ndev->be, HW_QSL_QST_PRESET_ALL, + table_start + i, 0x0); + flow_nic_free_resource(ndev, RES_QSL_QST, table_start + i); + } + + hw_mod_qsl_qst_flush(&ndev->be, table_start, table_size); + } + + memset(&db->qsl[idx.ids].data, 0x0, sizeof(struct hw_db_inline_qsl_data)); + db->qsl[idx.ids].qst_idx = 0; + } +} + /******************************************************************************/ /* SLC_LR */ /******************************************************************************/ diff --git a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.h b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.h index ef63336b1c..d0435acaef 100644 --- a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.h +++ b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.h @@ -36,6 +36,10 @@ struct hw_db_cot_idx { HW_DB_IDX; }; +struct hw_db_qsl_idx { + HW_DB_IDX; +}; + struct hw_db_cat_idx { HW_DB_IDX; }; @@ -48,6 +52,7 @@ enum hw_db_idx_type { HW_DB_IDX_TYPE_NONE = 0, HW_DB_IDX_TYPE_COT, HW_DB_IDX_TYPE_CAT, + HW_DB_IDX_TYPE_QSL, HW_DB_IDX_TYPE_SLC_LR, }; @@ -113,6 +118,7 @@ struct hw_db_inline_action_set_data { int jump; struct { struct hw_db_cot_idx cot; + struct hw_db_qsl_idx qsl; }; }; }; @@ -131,6 +137,11 @@ struct hw_db_cot_idx hw_db_inline_cot_add(struct flow_nic_dev *ndev, void *db_ha void hw_db_inline_cot_ref(struct flow_nic_dev *ndev, void *db_handle, struct hw_db_cot_idx idx); void hw_db_inline_cot_deref(struct flow_nic_dev *ndev, void *db_handle, struct hw_db_cot_idx idx); +struct hw_db_qsl_idx hw_db_inline_qsl_add(struct flow_nic_dev *ndev, void *db_handle, + const struct hw_db_inline_qsl_data *data); +void hw_db_inline_qsl_ref(struct flow_nic_dev *ndev, void *db_handle, struct hw_db_qsl_idx idx); +void hw_db_inline_qsl_deref(struct flow_nic_dev *ndev, void *db_handle, struct hw_db_qsl_idx idx); + struct hw_db_slc_lr_idx hw_db_inline_slc_lr_add(struct flow_nic_dev *ndev, void *db_handle, const struct hw_db_inline_slc_lr_data *data); void hw_db_inline_slc_lr_ref(struct flow_nic_dev *ndev, void *db_handle, 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 index 1eab579142..6d72f8d99b 100644 --- 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 @@ -2277,9 +2277,55 @@ static int convert_fh_to_fh_flm(struct flow_handle *fh, const uint32_t *packet_d return 0; } + +static void setup_db_qsl_data(struct nic_flow_def *fd, struct hw_db_inline_qsl_data *qsl_data, + uint32_t num_dest_port, uint32_t num_queues) +{ + memset(qsl_data, 0x0, sizeof(struct hw_db_inline_qsl_data)); + + if (fd->dst_num_avail <= 0) { + qsl_data->drop = 1; + + } else { + assert(fd->dst_num_avail < HW_DB_INLINE_MAX_QST_PER_QSL); + + uint32_t ports[fd->dst_num_avail]; + uint32_t queues[fd->dst_num_avail]; + + uint32_t port_index = 0; + uint32_t queue_index = 0; + uint32_t max = num_dest_port > num_queues ? num_dest_port : num_queues; + + memset(ports, 0, fd->dst_num_avail); + memset(queues, 0, fd->dst_num_avail); + + qsl_data->table_size = max; + qsl_data->retransmit = num_dest_port > 0 ? 1 : 0; + + for (int i = 0; i < fd->dst_num_avail; ++i) + if (fd->dst_id[i].type == PORT_PHY) + ports[port_index++] = fd->dst_id[i].id; + + else if (fd->dst_id[i].type == PORT_VIRT) + queues[queue_index++] = fd->dst_id[i].id; + + for (uint32_t i = 0; i < max; ++i) { + if (num_dest_port > 0) { + qsl_data->table[i].tx_port = ports[i % num_dest_port]; + qsl_data->table[i].tx_port_en = 1; + } + + if (num_queues > 0) { + qsl_data->table[i].queue = queues[i % num_queues]; + qsl_data->table[i].queue_en = 1; + } + } + } +} + static int setup_flow_flm_actions(struct flow_eth_dev *dev, const struct nic_flow_def *fd, - const struct hw_db_inline_qsl_data *qsl_data __rte_unused, + const struct hw_db_inline_qsl_data *qsl_data, const struct hw_db_inline_hsh_data *hsh_data __rte_unused, uint32_t group __rte_unused, uint32_t local_idxs[], @@ -2289,6 +2335,17 @@ static int setup_flow_flm_actions(struct flow_eth_dev *dev, uint32_t *flm_scrub __rte_unused, struct rte_flow_error *error) { + /* Finalize QSL */ + struct hw_db_qsl_idx qsl_idx = + hw_db_inline_qsl_add(dev->ndev, dev->ndev->hw_db_handle, qsl_data); + local_idxs[(*local_idx_counter)++] = qsl_idx.raw; + + if (qsl_idx.error) { + NT_LOG(ERR, FILTER, "Could not reference QSL resource"); + flow_nic_set_error(ERR_MATCH_RESOURCE_EXHAUSTION, error); + return -1; + } + /* Setup SLC LR */ struct hw_db_slc_lr_idx slc_lr_idx = { .raw = 0 }; @@ -2329,6 +2386,7 @@ static struct flow_handle *create_flow_filter(struct flow_eth_dev *dev, struct n fh->caller_id = caller_id; struct hw_db_inline_qsl_data qsl_data; + setup_db_qsl_data(fd, &qsl_data, num_dest_port, num_queues); struct hw_db_inline_hsh_data hsh_data; @@ -2399,6 +2457,19 @@ static struct flow_handle *create_flow_filter(struct flow_eth_dev *dev, struct n flow_nic_set_error(ERR_MATCH_RESOURCE_EXHAUSTION, error); goto error_out; } + + /* Finalize QSL */ + struct hw_db_qsl_idx qsl_idx = + hw_db_inline_qsl_add(dev->ndev, dev->ndev->hw_db_handle, + &qsl_data); + fh->db_idxs[fh->db_idx_counter++] = qsl_idx.raw; + action_set_data.qsl = qsl_idx; + + if (qsl_idx.error) { + NT_LOG(ERR, FILTER, "Could not reference QSL resource"); + flow_nic_set_error(ERR_MATCH_RESOURCE_EXHAUSTION, error); + goto error_out; + } } /* Setup CAT */ @@ -2470,6 +2541,24 @@ int initialize_flow_management_of_ndev_profile_inline(struct flow_nic_dev *ndev) if (hw_mod_cat_cot_flush(&ndev->be, 0, 1) < 0) goto err_exit0; + /* Initialize QSL with unmatched recipe index 0 - discard */ + if (hw_mod_qsl_rcp_set(&ndev->be, HW_QSL_RCP_DISCARD, 0, 0x1) < 0) + goto err_exit0; + + if (hw_mod_qsl_rcp_flush(&ndev->be, 0, 1) < 0) + goto err_exit0; + + flow_nic_mark_resource_used(ndev, RES_QSL_RCP, 0); + + /* Initialize QST with default index 0 */ + if (hw_mod_qsl_qst_set(&ndev->be, HW_QSL_QST_PRESET_ALL, 0, 0x0) < 0) + goto err_exit0; + + if (hw_mod_qsl_qst_flush(&ndev->be, 0, 1) < 0) + goto err_exit0; + + flow_nic_mark_resource_used(ndev, RES_QSL_QST, 0); + /* SLC LR index 0 is reserved */ flow_nic_mark_resource_used(ndev, RES_SLC_LR_RCP, 0); @@ -2488,6 +2577,7 @@ int initialize_flow_management_of_ndev_profile_inline(struct flow_nic_dev *ndev) /* Setup filter using matching all packets violating traffic policing parameters */ flow_nic_mark_resource_used(ndev, RES_CAT_CFN, NT_VIOLATING_MBR_CFN); + flow_nic_mark_resource_used(ndev, RES_QSL_RCP, NT_VIOLATING_MBR_QSL); if (hw_db_inline_setup_mbr_filter(ndev, NT_VIOLATING_MBR_CFN, NT_FLM_VIOLATING_MBR_FLOW_TYPE, @@ -2534,6 +2624,10 @@ int done_flow_management_of_ndev_profile_inline(struct flow_nic_dev *ndev) hw_mod_cat_cot_flush(&ndev->be, 0, 1); flow_nic_free_resource(ndev, RES_CAT_CFN, 0); + hw_mod_qsl_rcp_set(&ndev->be, HW_QSL_RCP_PRESET_ALL, 0, 0); + hw_mod_qsl_rcp_flush(&ndev->be, 0, 1); + flow_nic_free_resource(ndev, RES_QSL_RCP, 0); + hw_mod_slc_lr_rcp_set(&ndev->be, HW_SLC_LR_RCP_PRESET_ALL, 0, 0); hw_mod_slc_lr_rcp_flush(&ndev->be, 0, 1); flow_nic_free_resource(ndev, RES_SLC_LR_RCP, 0); -- 2.45.0