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 9637843AFD; Sun, 18 Feb 2024 06:11:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D5C740A8A; Sun, 18 Feb 2024 06:11:56 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2083.outbound.protection.outlook.com [40.107.237.83]) by mails.dpdk.org (Postfix) with ESMTP id 037E840A89 for ; Sun, 18 Feb 2024 06:11:55 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Af4VL5SpauE/ubx/OBhXABx7BStcRPhh3RXWBgAYXPd2x4yUqim9fR92Bqmw6WarQVyDHoaqNK+Sn3GdfAFOsH9ZOufDGCzkrJqnPrRu99VJJ81QiIwJlTN8/I7upNrn9Z2eZJ1VzyxPmN7Cd3aMvyCSt/ksWi3fHFMlKokvBBJaVlAD/WkOE7gNa2aZmxPCWVEGOOweivvuUhYARi4Su+haPKetu4NgUl5RopDRNVU/9CtxkppW+ThgP6n8OeOL2/xoUe0U87MMxMRXS8pC43nBOy4GeN6jm50IW0BgfX3LGpHUtTHEnu834mBH7rHi81CKCgjxUaEY19fpnTDSDw== 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=gPlJ2cLXfOEGvchLAPN0RN3aiuHIzveWl39LXFsTWlAFLBKheQbo58OlLrRf6OnM6R5IW8aySDqcbQKTXONO2ey+PqNBafgiWxzuYopQOSomP/sTFPWipLu6X7NDyfwhzpS9IBc5Y49p17Sgprfqgti1qCC3A/5rsMqkoWM7Pot4rjryH6fvouaCGcHQkHnfEHahhUMYx5WFMpPdemdc+aQnIC7XvT/3prFjQDJGTkn4yJw6YFJYk5S19LgJ46jg8XxpWyL9m9hQy9VpZwnz0OS/90ONjLR3nCc3omvoaSvoepZTeirLfaQ7EtH+EjT7JD9MAmBQIn/vGTAtfU917w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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=tUawOcYaqOyrwOape0FmJZx61ooAyfAyS0U3ykcC3gh41yGwh6NREsi8f7mwC9zLqJiCY2nswck1eDp4m9g1FxOuMDugDkQURqggu59vzWTtm0edwxgMEWvqg5uEnXAnb3G2/ioSrVP9fDEqcZVjaBw7N/XT3gu6z431QtbxQ0Bz7HKegHt/s0SN6asOMpXGDU/vyZWj1fQdcfP7jc3Q4YVHg9phNkW0wRMygk6o3IaZl9vy6Xi3s+m6PE+eVHe2S5DEZPFcZcK3bPy5PP7QIs3riuKLReEsUFbNnbCf8nu7p2mGGJG4Rer8aSogtWJDaOZlzi0yYaNuvjB5gQV5ig== Received: from CH5P223CA0008.NAMP223.PROD.OUTLOOK.COM (2603:10b6:610:1f3::29) by CH2PR12MB5020.namprd12.prod.outlook.com (2603:10b6:610:65::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.15; Sun, 18 Feb 2024 05:11:50 +0000 Received: from CH3PEPF0000000E.namprd04.prod.outlook.com (2603:10b6:610:1f3:cafe::a2) by CH5P223CA0008.outlook.office365.com (2603:10b6:610:1f3::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.34 via Frontend Transport; Sun, 18 Feb 2024 05:11:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by CH3PEPF0000000E.mail.protection.outlook.com (10.167.244.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25 via Frontend Transport; Sun, 18 Feb 2024 05:11:50 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Sat, 17 Feb 2024 21:11:41 -0800 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Sat, 17 Feb 2024 21:11:41 -0800 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12 via Frontend Transport; Sat, 17 Feb 2024 21:11:38 -0800 From: Itamar Gozlan To: , , , , , , , Dariusz Sosnowski , Ori Kam , Matan Azrad , Alex Vesker CC: Subject: [v2 01/10] net/mlx5/hws: skip RTE item when inserting rules by index Date: Sun, 18 Feb 2024 07:11:15 +0200 Message-ID: <20240218051125.717011-1-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240213095038.451299-9-igozlan@nvidia.com> References: <20240213095038.451299-9-igozlan@nvidia.com> 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: CH3PEPF0000000E:EE_|CH2PR12MB5020:EE_ X-MS-Office365-Filtering-Correlation-Id: 68a0991f-9328-4772-0087-08dc30401d0a 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: tCjRSkEyK92btQ6Xh7r/EFvJvYSGSB4JL6M6eUxKCArHMOuU1imfeTfYsb6QFrdw2uSsezprjKNpl0ULhMqYuIo6xdTE/s68d9fFu4MvPNVPaqGdmMEYrVaSoe0sC34HO/yZdzRHYRvlASypHboT/4fK/knm8h3nXQke8S/63CoAMSazBDsn+oaMymeKYB/28KThr3lrnG3SoA+ScOi/hQGJgiVR7i+ce1RJ2HFbMjWFspoF76y4voydxZ+FA7qlkG7fOcRatjmKTI/+6kf5xk6UWwLIPAwRy3jE3YzRW9hJ+aK/h+NbJ2KMMY5RDhmJ6S9kr5P5Skue57/DeT1LuYVT5/iL3EJkiVXqLmB24M/iU1b9ksKwdzPaHQ7WxgHn/1sTNwHUh4qsBsr+bKKBNoKdc+eJ7/6XZNwToEyX0rHovbp0q6DRBBzI6tpQXNhTl0yMYUXTfHvUkKUR5CGzUSZ2J+PfPCjkZ8rGdb1g/Xx8sp0VfiVcjAq9+Up92wYWbO1YkX2OPFD8lKE8FYe9EuJJrs/4w6XlXglggC3jWVUHpBjOyPG2GplidhUrTv9skcN9HajESKB/1nAix1TZDV+6liENEObq/K634THi/0iL9EbEn266SmSu/ypqUBWARMrk4y0p1W2w7VeMbhKoB6Z3qM9CLzc7FuTaKV/duUQ= X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(39860400002)(136003)(346002)(396003)(376002)(230922051799003)(64100799003)(451199024)(1800799012)(36860700004)(82310400011)(186009)(46966006)(40470700004)(5660300002)(4744005)(2906002)(478600001)(2616005)(36756003)(1076003)(26005)(7696005)(356005)(82740400003)(7636003)(6286002)(83380400001)(336012)(426003)(86362001)(8676002)(4326008)(70206006)(70586007)(8936002)(41300700001)(921011)(6636002)(110136005)(6666004)(316002)(55016003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2024 05:11:50.1440 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 68a0991f-9328-4772-0087-08dc30401d0a X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH3PEPF0000000E.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB5020 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