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 6EE8F460D6; Tue, 21 Jan 2025 18:09:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BFB834065B; Tue, 21 Jan 2025 18:08:39 +0100 (CET) Received: from egress-ip11a.ess.de.barracuda.com (egress-ip11a.ess.de.barracuda.com [18.184.203.234]) by mails.dpdk.org (Postfix) with ESMTP id A7A6F40657 for ; Tue, 21 Jan 2025 18:08:33 +0100 (CET) Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02lp2240.outbound.protection.outlook.com [104.47.11.240]) 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:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GaeAAT0WX+f3qsRpFXv3RWXgIS6AETazO9e4N6RyI4NceIyTkCg8sFN7BT8o/2X95NO3mrpKvn3kvj70tHQmzzqBNZsct5GpcoCpIUzyNT2j+AXL05gAJTpiVrczzDm0E0XNxwgvT/leIM67OfkRLKu1bWwSLHj11dcJJRGhX/zGZyyK+UGIG4qM4L6NbGFGOew6Mb8arMkboRGK4jEjv6o87CI67m5sMXgz/fwbfRzIePvfzZJ9ElNXjbwSxiEJ+6p7f1iaqFTdUIiDovZADJLQ9KlQNG4a5DFO2dYdhVGwXzMCm6ptLiZj82AvDNX39/JEwUn8WQ0Raeh+ANpRbA== 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=6AUCH6m+k2CsLhnzSjeDrXzMfdw9VfB3he+PABx82gQ=; b=qqWgRMXOyvREEGMIbF3GlWQsY9JSQwmJyLpmeg31SnFMZtacD8p7yyBD34OPm74EuRjP9ASi1P13ZwX9UbJ0qNyPnsoAMuvaHZYtMYcu/jAtsReL1R/1JMrGkPGfsY0W+Kk2wQiE1zKKvtRHwlRdtW6KA/ITEyeOE2G6ncwKTldAcjCLStmPILFsG4GwmNiAD9EMJ7oabJhW3E7TdVXPEjozrlv1oma/JJlAYsN4//JNmMEu7BLv8y8KPo6/7UASQeC9BBkrwBA/deuk5dwAsE1a34wztwCXYyQxeMtyKfqSB98yrV4cPVI6WTCEHXXt1ODJuvitSPfn6KwavyEyDQ== 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=6AUCH6m+k2CsLhnzSjeDrXzMfdw9VfB3he+PABx82gQ=; b=Qel15AQoZQSeZZKybi6mYTI7Qj+6XGNRU9uWqYMhng2oxgpksKlCErRu2YKdhYJi+pb9UXOLlQgtZjkhLD1gonaIaLxFr0rC4biSIBcAIC9+TIg6Co1uzxAjomysTXqXtU51/TANGvHk4csEPQPOyEDu5X7c30JFobcTvGYPrX4= Received: from AS4P251CA0023.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:5d3::20) by AS8P190MB1142.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:2ee::11) 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:31 +0000 Received: from AM2PEPF0001C70A.eurprd05.prod.outlook.com (2603:10a6:20b:5d3:cafe::51) by AS4P251CA0023.outlook.office365.com (2603:10a6:20b:5d3::20) 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: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 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:31 +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 12/31] net/ntnic: fix overflow issue Date: Tue, 21 Jan 2025 18:07:50 +0100 Message-ID: <20250121170814.3252171-13-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_|AS8P190MB1142:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 1dcc8ae3-52f9-4c4e-88de-08dd3a3e3b45 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?TZzZr9C1aIcYbNAf3ocJw339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q?+6mKwmmOsDSgpWYd/U/FQAP+oJ9i9pPwYwd3dbkQJ5a4C2hiEaYW1Lpb8irT?= =?us-ascii?Q?OOEsj2Bb1WJw2O3BqqFmBRvDvf7WSx4ABm8sG2LNGr1UErLSVC06x2An3ibD?= =?us-ascii?Q?yRhBU4f+AXKHr1m2MjCCsMIbMavWnkZq9TJQsF1NoC6NaBo6jRf9Buqn64VM?= =?us-ascii?Q?FOFC6ytYek+iqVjC0A1qGK0rclK6Q9IR4rR+AOxiwN1/ietkeis/b9PfYh9/?= =?us-ascii?Q?T+8amZZOhLJs51op9KNElsjidI0knZ8bamguiLw/a4VVYRH/w5irRkAgPrmd?= =?us-ascii?Q?LzAvY2yi/CAQy92GUhfQoa3K79ggGrhyw3xb20ukkuUOU7oz7RFIQJ+JXv7G?= =?us-ascii?Q?QbRjNlL4yPnRq4frTbVqnL0sYMgvs6NQLpPkt6+lF88KWJVTop++ugkbXsmx?= =?us-ascii?Q?62lnubAgBU3oN+Swx4krJcc5fKBF/eKsTuS7tYO/bGR0pp1ez5+cYo9HTv3A?= =?us-ascii?Q?tlAiJQhmYY24vqCaIN5fLBa+RXeSWWbqD88FEw6jT9qWTPc8MHi8v8aX3EiZ?= =?us-ascii?Q?nNvelsV1jm8PyR/DrgHTT6cGC6pwMigg1fttLNTKY4tEqzCXHaMw+cmJ1GDB?= =?us-ascii?Q?lSojxuIxqcOQjo0=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)(36860700013)(82310400026); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: V35sYKZxJBD+SxiSM7Xhn2qrhY+LsW6mUfZpKFWTrGoF7du5PX4SVl+g5jYGkwGg21fTHScxmCsjwW7C380XmUov1K7KOGVNlq46RcrSJ4DCcXhnEiytf0H0cGwzckew0j5as9VoNu2O2yy9k3vILyoBAW3EDhDKq40aK9L/Urg83oPnpZjrXUivF2oPkwUPQKtzqXbJyvxwIsUWFVvFNZ3pTPBKand9qMDACXXeVyiDnlGf2YguL6r1vANJP2LgZDDxMysXwehJhwmV2r6ThPSyLEGjC08WaBQ7XwPws2rcoqlB0+h9QvDUWoE0H5MtavI5u9EFiv1c3hFVbFqZrIaOBUT5Y0OvFZt9iN1N2x70DPkv+R4SXZ9j/eLVJhno9euCKf0cxbVICCBlNbk6xJK/Eu//hgRpFKEme1L3i9qfU5WdwlSPGjNe5Ln7JMJY+loCvXwhAE5jw6NvV6qIPWGJHRxPIYAitqvQYEJ0VvACTIs7bZn8Oc46pq9P4djvXmnLru2ASsnypZebm0m5iROnTvKyP0azBE8oOsAaNi2VPEPZdJSj7qvnB+nBnOoYhgDXPYjYoVFOMkPUudJbfL5XNxe1/YFROgu4BqPz6an/Y23CNX7/WQmxn9d0PBpmYTlU2ZnuXVOu4wDJKZ0aFg== X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2025 17:08:31.2024 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1dcc8ae3-52f9-4c4e-88de-08dd3a3e3b45 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: AS8P190MB1142 X-BESS-ID: 1737479312-302816-13350-7971-1 X-BESS-VER: 2019.1_20250117.1903 X-BESS-Apparent-Source-IP: 104.47.11.240 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVoaG5iZAVgZQMM3I1CjN2DA5KT XZKNXQ3NjczMwi1cjA3CDJ2NQoOc1QqTYWAMz9zWdBAAAA 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 Fix overflow issue with checking max bit shifting value. Coverity issue: 448921 Fixes: 833962ebb893 ("net/ntnic: add CAT module") Signed-off-by: Danylo Vodopianov --- .../nthw/flow_api/profile_inline/flow_api_profile_inline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a68c3ea702..574e51c2fa 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 @@ -3605,7 +3605,7 @@ static struct flow_handle *create_flow_filter(struct flow_eth_dev *dev, struct n .err_mask_ttl = (fd->ttl_sub_enable && fd->ttl_sub_outer) ? -1 : 0x1, .ptc_mask_tunnel = fd->tunnel_prot != - -1 ? (1 << fd->tunnel_prot) : -1, + -1 ? (1 << (fd->tunnel_prot > 10 ? 10 : fd->tunnel_prot)) : -1, .ptc_mask_l3_tunnel = fd->tunnel_l3_prot != -1 ? (1 << fd->tunnel_l3_prot) : -1, .ptc_mask_l4_tunnel = -- 2.45.0