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 1C83643913; Tue, 13 Feb 2024 10:51:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC8F1402AD; Tue, 13 Feb 2024 10:51:08 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2050.outbound.protection.outlook.com [40.107.94.50]) by mails.dpdk.org (Postfix) with ESMTP id 712774027B for ; Tue, 13 Feb 2024 10:51:07 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RxvdkkLxAybtWMmUN9Elu6TdpiYnws7GzhM1EJz131/kNWUSYuCRpl06yH7YKvXmdLUSC7ODw+5bi/fpsMfBVV0pRZQnG5pHxgl6QUCdkt4Xrs4Nc5QllekDV7HhWFHKc2fAPyCFoN5LoVYJPM7QwWC1L40xV5btTKSEttFvYOQL6ZYm2MR1igzzC6YsNQFUd2I6iD+Cr1LRzDwXajDPLo9TXlWopbE3cl+xqxrdcxBviVCTJmOBQK/4porPxjv88VUJSvsyrE9dSXEdZ4u0zj8NYRluUSUzEOynREX3MajwrjD5HhLMgO+4DdizwwY+qf03TvsmdzMtYQEVRsAUMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=vX9yHiG0CjxRRdh4trYDFDChph44rOoEhQjrR7FTWQ0=; b=Xo4zNKSlPh7KWVw9P7zV5uVnJXajNHhr1QxztWwv9j9RN95s9ibCZw4VWk8E0ZA9dZV9O+CeOhAHi7JWaJZhQDGpJ9jU4Oiph/C8GP8yhL7mZDlrYSlT4QIgpj7vOErYwDoUJ6Rg0yO6YqHkuYM4v3NZBxBbuhaW1rujxtJX4u0u6VVeJ588a2tKLrDTDbRFEHT19EszTwGGKbIZrqCtYCSmWVdt/SsWw5iZPCl+MI88YEJeAwyBH6Z5X9vMrFJVaJRi+Z7T7LfCbT6evtGYVf75jioKiH8ke06ZGCwlpaH1XsmGBawnOmWcOpbBlzttZor5O9T6A6OTY++tgWsJcQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vX9yHiG0CjxRRdh4trYDFDChph44rOoEhQjrR7FTWQ0=; b=J5nS084u2oIGX3+CdUY7+U02zKwWWO0ka8gWXgZw0bEdHyOU2IY9HGgV/MRWuAegYhAW6+ceqJCh9KyXE1fmU8Lf8mpIBFczaXTFw7ezfxMtQ0qivTLem/VhAhAEXqbqSKsoWoFGjChbJ89TdUIRFG9wT3Znr74ABrSpT7KRiCpLCZyCHWDeWkh8oa9P6kwqVaGy8Ms2LdiDUs0AMYvh8jBiJwHokfTd/hYXqXzWB6GsZrXkInRIvzFhmF3CrUvx6hokBycbxW36saef8Mw2cqm7AjkChTAHn00knXtmAaUqFKDvn3Tyoar3jlMQpd89xPs3oh4P8eelTNv+4ngAKQ== Received: from BN6PR17CA0027.namprd17.prod.outlook.com (2603:10b6:405:75::16) by LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.23; Tue, 13 Feb 2024 09:51:04 +0000 Received: from BN2PEPF000044A3.namprd02.prod.outlook.com (2603:10b6:405:75:cafe::45) by BN6PR17CA0027.outlook.office365.com (2603:10b6:405:75::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.39 via Frontend Transport; Tue, 13 Feb 2024 09:51:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BN2PEPF000044A3.mail.protection.outlook.com (10.167.243.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25 via Frontend Transport; Tue, 13 Feb 2024 09:51:04 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 13 Feb 2024 01:50:50 -0800 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Tue, 13 Feb 2024 01:50:49 -0800 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41 via Frontend Transport; Tue, 13 Feb 2024 01:50:46 -0800 From: Itamar Gozlan To: , , , , , , , Dariusz Sosnowski , Ori Kam , Matan Azrad , Alex Vesker CC: Subject: [PATCH 1/9] net/mlx5/hws: skip RTE item when inserting rules by index Date: Tue, 13 Feb 2024 11:50:29 +0200 Message-ID: <20240213095038.451299-1-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000044A3:EE_|LV2PR12MB5990:EE_ X-MS-Office365-Filtering-Correlation-Id: f7ddd36a-5d01-49f5-69b7-08dc2c794b5a X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Hl08RQNKb9BZX8tFDKU3716qcZadXZ43I4VZqP51PDmjLSxnU3UlJzHLw4+xlOGlOh3AA9x0XM3HXlcm6firmhxi3PpyehY3xR8NRmA/ShA0hxTXkcdPWN+9VrajdiqIGGXtcoDNhSEv6S75hP9vtevUaBhUEfjZ33SYBydo+9Wzb0tHdb6ZpB/AQuNIg0cDOIwUlHl19+16MJ9f8UUkmh4MX70KTkgFkgd3nsPEa6fRgj5uhf9m8BB61rBozfwdHXGGiDPorucjdBKBtdcghG22b5DyyjMO8FoWX1Osv4kBE82Xt6aUWFOE4XmjbeHJK0bdsl4rQLiRawrVDzU6Gf/U949Uj3XHf3KKtDa77amkbLEDfPlya9+e/vMsOHDkMyKpDfRSjMoqqxJPT4pqTHduwSg79eYTTj8YU3Hk2UjhMd1M4aPgSQrP8V+1iX6UA1J9liIkWUabQFARHqOa2l3wwvfOSldC/eWbx8DlojLpLvuDJS+2cDMSxyzY22SMqOiEHAbhi88xlRVHoRe5pKcc75/fb/vKRSFkdqt+/tngpYR1gFE4NmhKo8gP4sglhupfnk1cMQ/dnNJ+cxS1oyrO9ldsZjoypGn0HD6R+tT0hUDPaoFtCTyyx/9Mf6fZYL0+Sss3oiaj4HV6Z38jtA== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(136003)(396003)(346002)(376002)(39860400002)(230922051799003)(186009)(64100799003)(1800799012)(82310400011)(451199024)(36840700001)(46966006)(40470700004)(55016003)(921011)(7696005)(36756003)(2906002)(5660300002)(4326008)(86362001)(7636003)(356005)(2616005)(426003)(6636002)(316002)(4744005)(6286002)(336012)(110136005)(6666004)(478600001)(83380400001)(82740400003)(1076003)(70586007)(8676002)(8936002)(70206006)(41300700001)(26005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2024 09:51:04.4618 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f7ddd36a-5d01-49f5-69b7-08dc2c794b5a X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000044A3.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5990 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 The location of indexed rules is determined by the index, not the item hash. A matcher test is added to prevent access to non-existent items. This avoids unnecessary processing and potential segmentation faults. Fixes: 405242c ("net/mlx5/hws: add rule object") Signed-off-by: Itamar Gozlan Acked-by: Matan Azrad --- drivers/net/mlx5/hws/mlx5dr_rule.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/mlx5/hws/mlx5dr_rule.c b/drivers/net/mlx5/hws/mlx5dr_rule.c index fa19303b91..e39137a6ee 100644 --- a/drivers/net/mlx5/hws/mlx5dr_rule.c +++ b/drivers/net/mlx5/hws/mlx5dr_rule.c @@ -23,6 +23,9 @@ static void mlx5dr_rule_skip(struct mlx5dr_matcher *matcher, *skip_rx = false; *skip_tx = false; + if (unlikely(mlx5dr_matcher_is_insert_by_idx(matcher))) + return; + if (mt->item_flags & MLX5_FLOW_ITEM_REPRESENTED_PORT) { v = items[mt->vport_item_id].spec; vport = flow_hw_conv_port_id(v->port_id); -- 2.39.3