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 C6B23460D6; Tue, 21 Jan 2025 18:10:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0AC1B40A76; Tue, 21 Jan 2025 18:08:50 +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 D173B4066A for ; Tue, 21 Jan 2025 18:08:37 +0100 (CET) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05lp2176.outbound.protection.outlook.com [104.47.17.176]) 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:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Se7yRiz8RlaicKGeRafrZQUY1yq/ap5Xso5IpP7quFDhh8XIVxuqAZfz8fTv3K8ZVFY2OVuxHGcwlDACsn0knWZpUM4TdaTq71e8cwPUWdJXId7lcylUS3fQx01Wfx5s3omvx813HkORYv6W4ivEOmwaXDef23WFCokTrI/xbKcAYe6XjZ/56vSdYvPEXUYE0qCjIHlPlA5ppHfja9fiqsgslL9z563FfeBquIJKaPpZ29QDLeT3edxPwh7r5fo1L/TO4JmwPlsAmpGxqK0XF9y/f4fmTVwv436SshBetz4oRryKFMa+EchAVpHxHqbwyzcskQjriyv8EqoVZEaRwQ== 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=ltqb21JYm1MpJEQhjOgKjNB97hOyn82rFa0dgEZtzFU=; b=AW12SVhPgVC+tWbwYHBMcPEq9nWH1hLkcacrya0baawPe69GdMkLhVnMoFXKOIR3YawadsJZWqroYz6eAkiyqJJW20/lF88Ka2b/XiR029LNddl3EpE0F2lnKIjAp0ta/yJ9SW6iPChPdiS8iS8k0GztFmfrNmRd6ufnH5vNWYg5i8YHzpxHTkJ7rSn/2VPXBr/rK2vsrCr2mkIimSNEUvWtUPIMa1LstVRC/I4aS2w+F+2oUq2Ue1YdD3M6enXnb4vlM2o7CqWQS6bOxXutMBD+QjdNtR08V1LIL7OCc4YVe/Q+S9acZgdPyB79JTQBxNwpTTP2/lzCxkAHjkGlgw== 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=ltqb21JYm1MpJEQhjOgKjNB97hOyn82rFa0dgEZtzFU=; b=BYiYY4jKKzrE+4i0jE2rc7UAEn48sOHJ8nAszZ4aJwzHwaPp5QDGBZ9v2+P43RaAN85aGvdwf98OPYIvXax8zTW0iWqg7NXxKWzw2CFvbDS2yK/OgtXbB65PygKmnZtaIvwtxYVpbaMYOGyjR1z6NbdYNKYhJhRSt6wsbVVcpy8= Received: from AS4P251CA0021.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:5d3::11) by VE1P190MB0941.EURP190.PROD.OUTLOOK.COM (2603:10a6:800:1a4::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.22; Tue, 21 Jan 2025 17:08:34 +0000 Received: from AM2PEPF0001C70A.eurprd05.prod.outlook.com (2603:10a6:20b:5d3:cafe::4c) by AS4P251CA0021.outlook.office365.com (2603:10a6:20b:5d3::11) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.20 via Frontend Transport; Tue, 21 Jan 2025 17:08:33 +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:33 +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 16/31] net/ntnic: fix var size Date: Tue, 21 Jan 2025 18:07:54 +0100 Message-ID: <20250121170814.3252171-17-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_|VE1P190MB0941:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: f3414696-90a7-4e35-9ef9-08dd3a3e3cc0 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?2MFpPVXhiF++/Kj5f2C+eKbu1mwzp7itgCHdD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HL9L+6dWPBVRlxor0Dpqv1ZSX1iMBFnapoKhcYXytBP8MjamjwrC?= =?us-ascii?Q?DqwTnp5GmJnHTeIfOUGWlF8CyxX3C0QdpWuPtQ8UWv0u35CxHbnJAO6egDh9?= =?us-ascii?Q?Re5Aoz4AHJnYHLNucZDbSSA5p4MhYfSqGVWM3ThGErJKNilF7R/RyuB70J7j?= =?us-ascii?Q?PYJ0hsHoPUATeJPX5qbElIDZIXLBA/dZv/AQxmakbEfPfXQRAadFpL7+cdEv?= =?us-ascii?Q?DV3lNZnFjk0Ra5eykNeD5PXveI0qtonGjs5tCp4r/lmaFOPxzuRWqLvurdXG?= =?us-ascii?Q?PZ8Z2ORhybOmI+UjpH/WjwVXXHde8mA9xbqgTnJxoSva4e0rbJlimzo94/Ac?= =?us-ascii?Q?D20jTdaX64gFQgvYodOCF8t8mMNivDxBbSsrUEB5QobqfUzS8pbQoCOsE5c7?= =?us-ascii?Q?Xfyp6QO8HC4Oz0Esw+4hEcaJalW0AqgcCOnJupNiPaVGJIdQkBuzZBDfWeG1?= =?us-ascii?Q?PYsKrHg+Wor0BSp12UGCdmmoe02hB96KxavIFjUP0wSnzQDIgyZpewTekEsv?= =?us-ascii?Q?K+JKHx6vXP6z7OxhQN8wDD2Qho9DBPLgy8LjIrHCtrjZU+C1jbnO6YjxiroQ?= =?us-ascii?Q?/fnXrt7EFgwYUg4=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: BzuRA9+7DPSQNE7ZtUUV7qXuNXY+o6lnm3CgMM70S685/5CM2UuDLoRlu6DVFf2BRW15svKG6X8mOLz01pEh+4HBtaZsy4qqivlobkFaJowpltzcs2EKfVMd7Z/YMlWydA1dO9YsthP0S11shuWsAbUww89Gh7eHLPTDGIQ+kTzhxSLEhVeODrcybTTKtlg3FKugaBDZ1LZhjXrXRSAoL97Ztm1YKfe8emS8u1T4UZo81WtgtJGd44sr7167wqNiKETci/0ZZ2qGrqDP9bSrH3uZQPJ3g3GOb4CNPtbbdFcSFgIMvNgxOjBZxBWSW7feQdAJvsy8uPr0zmCFEeZsGeRHAJSUpVVjBNxWSQRrq0O31lt3o1Vg+4oVqsNo1piK0dpyUlluCrRu1Tjoybqfug3OhQTxD5tuB4M521hI6Cr9UEvRyxs+1NwYT63ZdCSpRxJ8LsJXXJv96rjJXAWNSKeytytlW0hiZCliqNqTmlTn2eyySgRCOTaB3zKaGuTNaUlZJ9GL3VoMNkudkKpnyljycHhi5YFo3215kWDtcCbr9qf8gYmlXXJpTSIj1Ccu/o6/B6gZeU74Xq+hGoSvfalLHFXsPOEZwJUv+nd60VCzQCgaf+2Bn6jcyHJp0KlEDWpEATAEkn1dMomqDAZZ2A== X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2025 17:08:33.6868 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f3414696-90a7-4e35-9ef9-08dd3a3e3cc0 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: VE1P190MB0941 X-BESS-ID: 1737479317-302816-13354-7955-1 X-BESS-VER: 2019.1_20250117.1903 X-BESS-Apparent-Source-IP: 104.47.17.176 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVoYGJgZAVgZQ0MDY0DI1xcLSIM nY2MDUzMTCyNIoycTS0Mgy0dzQ0NJcqTYWAKhOugtBAAAA X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.261957 [from cloudscan22-21.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: Danylo Vodopianov Function operate with uint16_r value, meanwhile return value with uint32_t size. This conversion was aligned to the uint8_t as far as max value of the return value could be equal 16. Coverity issue: 446747 Fixes: 67aee0a69665 ("net/ntnic: add used writer data handling") Signed-off-by: Danylo Vodopianov --- drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c b/drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c index 279a852a1c..a2c9ef27f0 100644 --- a/drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c +++ b/drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c @@ -345,9 +345,9 @@ dbs_initialize_virt_queue_structs(void *avail_struct_addr, void *used_struct_add flgs); } -static uint16_t dbs_qsize_log2(uint16_t qsize) +static uint8_t dbs_qsize_log2(uint16_t qsize) { - uint32_t qs = 0; + uint8_t qs = 0; while (qsize) { qsize = qsize >> 1; -- 2.45.0