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 83039460D6; Tue, 21 Jan 2025 18:11:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 28A4B402E1; Tue, 21 Jan 2025 18:09:01 +0100 (CET) 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 025ED40685 for ; Tue, 21 Jan 2025 18:08:44 +0100 (CET) Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02lp2041.outbound.protection.outlook.com [104.47.11.41]) by mx-outbound11-0.eu-central-1a.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 21 Jan 2025 17:08:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=E+nyfRooZ506unioHPLx9ltapKyVVP5LR9PxdgllkKL4selTCbK80xgobO0XGzNcZHwKE88nrKJtZ9AY8wzkMTlGYGl6PoeJ/OJSnGxHKsSHUbMMJj54eMx6sSaIUTq1dQNh/hoZ5+sqYjLpJIOrU0jkO4OVzrV4cSTosBuFYS9997W1ZwvTDTAVFEmDFnyn+jle3W90/kzD/usRRjzLGzMoVBgLqS0aJFqn/MJ+Uyn3qICewwPhjm6lNowLxgwuzrUtQ7iIZI2qiY4uwLSrfSfTF+mKiUAFH4hGogCjUnzTyTHTd077J7w7sziMMoWpXpKB4hDBn2F4YnRSdWxZQA== 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=XG0jMfQh/DWx1b53rlN7LGLeXBBmH9xldmz+tbA9+iY=; b=hY4HRXnRJl7+bgSxNk/b4QmmV78szaszHx6UT7zvEv4J7L0z6HfHogDhfxFmiYEzQED4MLvKxCIVm85kd9CD8otK3CUXag0/j+FkjD+GaSGxmMUuzannBq9bYhmXk7b7sJqptRza4+Nfys75Oqe6Bqxl9GVIAhYgDWmVIbWXtiCp2WQQX82IGfY7/dx5pGdt/ynYj/XQsqMxza9iYungfbympg+1y2CjBfq2winpF2ApsgEikid21iM48aKanwJ8EwIaadcCmAuQeMoIMdFga2s3s7JR48iSYfl+6VuvtWWF80hqsolzzp3ssq52AHUIFH7LAfvjfaj2QEXvmY1DTQ== 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=XG0jMfQh/DWx1b53rlN7LGLeXBBmH9xldmz+tbA9+iY=; b=aPESUzCCelTtWESUtnpAdSr0/6pVW6P74J1LMwSQetTmShKCuKwLjRI3IkErtQweWkKrKy4hIcVRIOB8w8thB6uGYPeTzrTS4r/T6oKQdYiBtb8ChVBtDLXHHXSoT9UTYdTEmTRiXtbMldGaZrPfOIcmvEW6z3wU9CeI2L9aQ+M= Received: from AS4P251CA0026.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:5d3::15) by PR3P190MB0972.EURP190.PROD.OUTLOOK.COM (2603:10a6:102:80::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.20; Tue, 21 Jan 2025 17:08:42 +0000 Received: from AM2PEPF0001C70A.eurprd05.prod.outlook.com (2603:10a6:20b:5d3:cafe::e6) by AS4P251CA0026.outlook.office365.com (2603:10a6:20b:5d3::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.21 via Frontend Transport; Tue, 21 Jan 2025 17:08:42 +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 AM2PEPF0001C70A.mail.protection.outlook.com (10.167.16.198) with Microsoft SMTP Server id 15.20.8377.8 via Frontend Transport; Tue, 21 Jan 2025 17:08:42 +0000 From: Serhii Iliushyk To: dev@dpdk.org Cc: mko-plv@napatech.com, sil-plv@napatech.com, ckm@napatech.com, stephen@networkplumber.org, Danylo Vodopianov Subject: [PATCH v1 26/31] net/ntnic: fix age timeout recalculation into fpga unit Date: Tue, 21 Jan 2025 18:08:04 +0100 Message-ID: <20250121170814.3252171-27-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20250121170814.3252171-1-sil-plv@napatech.com> References: <20250121170814.3252171-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM2PEPF0001C70A:EE_|PR3P190MB0972:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 5cdf8d5a-8cee-4a0d-8a0a-08dd3a3e41dd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|36860700013|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?7siU9CKwRS9q0DtOTn930J4pT51ilR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xoFsaxQi45E1GQp43HwCshSm+erwFjnWDOeIYoM/Kngfnt1h?= =?us-ascii?Q?IaaJfX9KWngU5p4q6/w4bCQllIu8714JVvpUmhKOtiQHAG8H9UzTiSNO9I2W?= =?us-ascii?Q?wYLiNJro9XUIQmK27mZW0W6CQOFaqEm0FMe8bkZ7l4Lx8+E9GacYRE2Ahqce?= =?us-ascii?Q?z5Z0dI2pndEHK4nWM3TY+6gQeDoDlKOW2MalUpr8dgvVcjX+z1l63hDV27lO?= =?us-ascii?Q?psDTClCfGfbFAU2ycMOuMPaguMVg4BPU2M/AX1jOqjwZT5w26DlkVf6qTz7S?= =?us-ascii?Q?niPrkVbATkXxS+Vy5Q5iQSQVyLy+/ePol6G8hHfgdMtXBic56p93yc38lwjj?= =?us-ascii?Q?b1i18HJbXU3gXUN//V/c7CwBLzsMXwfDLSo1REnRpW9D6gLreZVrjQwfvTzk?= =?us-ascii?Q?z/z7zYAg/UIEVgcnFDPUfoEy/Gi2wiiHgR1K4iEVHVYiV8ddkDYiydCnuIbl?= =?us-ascii?Q?+Zfe2tL4tKkuW+lS5CIaCMeIXV7lPKgiHpckqx8JrPZ9C1+xgiLwyxoetUMo?= =?us-ascii?Q?pt86H46zq48FxpVR7sGf9YbHi7PMHDAa1PSVn3xLJOkqUpl6vU4crxGDbzkM?= =?us-ascii?Q?RBkXemCKyFsuiN0=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)(36860700013)(1800799024)(82310400026); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: mfB7mTqNP23Q7slpHgKMTYhJQduKBGmnU0dJD+PKhmDAMlqNilKCNxlONrURaQA9ulCoJAk90VCsn7znUQyH8uGQ2cuU9ZNV9chRO0ElJk00d0B86vb6aid7m89cqlob9rBwVvV2dyRraqUPvKejccCF1WECslBeXWPyDSfHWoNX2rBhXR59h+P8ZNhAmc1fwUDGG/JShQHNgjiUAwE4BRw5EfpX7KraZpogudBv5Z+ekc/vONo9p4joVDz9d4BUblRkAmDT1sGs/jL+iUyV4v3grXppDMfg+4NtmvDHxVxNaOv6S0x+zhVzwfuI7csqpKK9zu0QzC7HxM8gAwEYnPYTN3PSLqbbxflD6nW9PhYhM5BTvJBfGAOt6O80iOdFy0tkkvCdXmi7qyT+Fxt9wlFQtFYdKME0gaBBNnQQbRrFJyiYS1HcT8O8V/WrNGgUxin8J7NaZqLYvIV3qUCPz1y4CS/88ZlsqJGgMTCxwREL/AlgU8wWwrAfWpri3t+7e5+X3Y2jLUPDddsm9vw2+OjhcUrtx9NPoZJCr934Bs4qmBDmUwHOtbOo+UL3YYkmahKNYBO3IDfyFLrrmw3Rcn5yhf6GmQ2VZCcVoQhXI/OEv3HQl+eW7H/489C2uDRmkmNxrkKuqrt5yJyM8FY+4g== X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2025 17:08:42.2649 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5cdf8d5a-8cee-4a0d-8a0a-08dd3a3e41dd 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: AM2PEPF0001C70A.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3P190MB0972 X-BESS-ID: 1737479324-302816-13350-7986-1 X-BESS-VER: 2019.1_20250117.1903 X-BESS-Apparent-Source-IP: 104.47.11.41 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVkYGJoZAVgZQ0DjJ0sTIEAjNki 0NklMMLMyNk8wMDA1NDAxNUswtU5VqYwG0A2rUQQAAAA== X-BESS-Outbound-Spam-Score: 0.50 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.261957 [from cloudscan12-69.eu-central-1a.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.50 BSF_RULE7568M META: Custom Rule 7568M 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.50 using account:ESS113687 scores of KILL_LEVEL=7.0 tests=BSF_RULE7568M, 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 FPGA scrub T parameter shall be encoded timeout using internal unit, which is measured in 2^30 nanoseconds. It is approx 1.074 times longer than age timeout specified in seconds. Internal method hw_mod_flm_inf_sta_data_update_get() was updated to perform conversion between age time and internal FPGA scrub T time unit. Fixes: c0d44442b831 ("net/ntnic: add flow aging event") Signed-off-by: Danylo Vodopianov --- .../net/ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c b/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c index 14dd95a150..5cf8264909 100644 --- a/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c +++ b/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c @@ -969,16 +969,22 @@ int hw_mod_flm_inf_sta_data_update_get(struct flow_api_backend_s *be, enum hw_fl * * (T[7:3] != 0) ? ((8 + T[2:0]) shift-left (T[7:3] - 1)) : T[2:0] * - * The maximum allowed value is 0xEF (127 years). + * The maximum allowed value is 0xEF (137 years). * * Note that this represents a lower bound on the timeout, depending on the flow * scanner interval and overall load, the timeout can be substantially longer. */ uint32_t hw_mod_flm_scrub_timeout_decode(uint32_t t_enc) { - uint8_t t_bits_2_0 = t_enc & 0x07; - uint8_t t_bits_7_3 = (t_enc >> 3) & 0x1F; - return t_bits_7_3 != 0 ? ((8 + t_bits_2_0) << (t_bits_7_3 - 1)) : t_bits_2_0; + uint32_t t_bits_2_0 = t_enc & 0x07; + uint32_t t_bits_7_3 = (t_enc >> 3) & 0x1F; + uint32_t t_dec = t_bits_7_3 != 0 ? ((8U + t_bits_2_0) << (t_bits_7_3 - 1U)) + : t_bits_2_0; + /* convert internal FPGA scrub time unit into seconds, i.e. 2^30/1e9 is + * approx 1.074 sec per internal unit + */ + uint64_t t_sec = (uint64_t)t_dec * 1074UL / 1000UL; + return t_sec > UINT32_MAX ? UINT32_MAX : (uint32_t)t_sec; } uint32_t hw_mod_flm_scrub_timeout_encode(uint32_t t) -- 2.45.0