From patchwork Sun Feb 18 05:11:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Itamar Gozlan X-Patchwork-Id: 136860 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 086DB43AFD; Sun, 18 Feb 2024 06:12:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4028F40DF6; Sun, 18 Feb 2024 06:12:03 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2060.outbound.protection.outlook.com [40.107.95.60]) by mails.dpdk.org (Postfix) with ESMTP id 1701D40DCB for ; Sun, 18 Feb 2024 06:12:02 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TOb5VNSEupdORxyBhiwUogLz2b/ClI/kSKvum7azdlcAA4t0sKb8iU1QXRLK004cJG4kGKNoHpuVXxh0S0RBK6DDuwZZtLMomE0jsZsvbNHengemAVelQVldQrhztTUexquFtXt+b8QenwEYsNnBugERLXM843uaSPyW6w16J77zekvCiCXAliauZGbNHcRYYu7QJPLc0yJQ1o2GHqgSizUmZnYFAvJtoSJ1y6vJ+wPzT6RuHdxbC13Cs+icxISqimWKCOC+UsbEIJHDErXldu42U6jSAG1UqGGCB7QPPWXbyYJ/fuGe1/AodzFIy7UMskvTagVF9aD8pKwyvxq2iA== 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=NtqDDm1rl5i4vhy156xA482NKv4DAF4kjl/fpdjVIw4=; b=mntjwfyJG3KyR0TzwMautTg0ox4WhE787a9rmtoF9jOYJuWQRmhCZHctHmugJ9ai22OPAx/XPJrRGhF+p3jn6mcOGOQYmv0MTr465Fm4dJPHzTb+zTSQLuvPtvuKvHiLxhY6mxLoht9EAma8DMOSA4k1veQGIUDEC887ykCVFmjYgSBrCTqCuB14hRe0C9xNj+otA1ww8R55HmN6fIRoF3cG/2uX3AKb4X4TTscsEF9JGEdMVWDxB/sjrKAXQU5BsdIxB4QSaLv9qyBpNVitB2tgFPQx6IReyxkaCwGUrR/SRU3GNI1TGqD7HUhH3Vinwd/JjaEZQVlzTbgMrOQwqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) 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=NtqDDm1rl5i4vhy156xA482NKv4DAF4kjl/fpdjVIw4=; b=fm6Kt2hDFZUi50CQTfI+Zx36bRWjroW8FeWVqG3Ec1IBuHdcWoDZQnHiOyuO5XmOzu7smwHF/6IwaTNFxRGQK+6S0QRkIxiQKaeHI8Ctfs+rq0SIpFa4hbHH5lX3c9S0lsu4KaRvdgZfXI19JO5bXQ9zX0HQSKvUDByQoNU7SdTD363XKWiHCy6TXr9dH5vb4QJmp6nKV07IT8z0SxUWvKOPYhJPJYhDwvOQUrKiaX9YH3ycOlkZL3KLsE5Csdwhyp0wjmEZ6jRF8iEx/ggPe7J8vswDdiWsLFmpTbFpylbxn/RTPwU/bAKrHLN7XgiaRuuiLzXZe12WUKTU5J7V3Q== Received: from CH2PR14CA0025.namprd14.prod.outlook.com (2603:10b6:610:60::35) by DM6PR12MB4516.namprd12.prod.outlook.com (2603:10b6:5:2ac::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.12; Sun, 18 Feb 2024 05:11:59 +0000 Received: from DS2PEPF00003447.namprd04.prod.outlook.com (2603:10b6:610:60:cafe::e2) by CH2PR14CA0025.outlook.office365.com (2603:10b6:610:60::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.35 via Frontend Transport; Sun, 18 Feb 2024 05:11:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by DS2PEPF00003447.mail.protection.outlook.com (10.167.17.74) 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:59 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.5) 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:58 -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:58 -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:55 -0800 From: Itamar Gozlan To: , , , , , , , Dariusz Sosnowski , Ori Kam , Matan Azrad , Mark Bloch , Alex Vesker CC: Subject: [v2 06/10] net/mlx5/hws: fix VLAN item handling on non relaxed mode Date: Sun, 18 Feb 2024 07:11:20 +0200 Message-ID: <20240218051125.717011-6-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240218051125.717011-1-igozlan@nvidia.com> References: <20240213095038.451299-9-igozlan@nvidia.com> <20240218051125.717011-1-igozlan@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003447:EE_|DM6PR12MB4516:EE_ X-MS-Office365-Filtering-Correlation-Id: a2986e31-253a-4d28-dd24-08dc30402286 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: tueLqXtV59crSaeKIO//cWvPArqx4mz7+gxpTkXtNlxZ6IG0jWtVxIyvbxDhOpI/m0DGkJagpdbK1dfEqItVNuiq+JnQdsjpQBHkthFiF83d3ngOvRtxwXAt1at/WECv+qqptUDaQP/4QVO11ASQmvKmPTgLtK1EWZZibkCgoZUAlEGCt/PRE20jbr16o+BEBVEzaLSfiiPvC43SR5RcrtyIuh0JULfFvh/2RT9rHs7YRb60h5+EsDhby6AVhtDeyUo/+8kpqCdTldoMXx/0Xszds60ejx794OBnlyx+EXd4Kx6VTLp+FBobBEk0wr/1TZ7As4SGVJBSnw9I1stjShk50RAjQr5fmUHixLD7uOYIOSrXTTzJIgnKn/XklJqj4ZXTrWBWhcvON3sKXosjoZ099aOUHW+JXYx31fFW75iXobs+z3SxhtzTLsTGDr9AT0OwMgi9SBFcZlIQfKXmL78S5MoFrqf72+FCTnNUrWWIg8AYoYNzoZA9Cyg/0fM2nw3ZbzwfuNpZa8h06LhtquTumRoAlM4d//6QjBzZiu9YAVar4Nbtim6J2CTc4iEpxTbWsgsAocE9xOp8vQu5ZcH5VtCUPUnJ/mEe7fX/BuiK2ROvVi0ARYH4bcMeUh38aRf0LY57wiXzVqLal7tlzmwx7AmB8u5bFxZ8f7pGFpo= X-Forefront-Antispam-Report: CIP:216.228.118.232; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge1.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(376002)(346002)(39860400002)(136003)(396003)(230922051799003)(82310400011)(186009)(451199024)(64100799003)(1800799012)(36860700004)(40470700004)(46966006)(5660300002)(41300700001)(110136005)(86362001)(70206006)(2906002)(316002)(83380400001)(426003)(336012)(356005)(2616005)(7636003)(36756003)(1076003)(26005)(921011)(6636002)(8936002)(6286002)(4326008)(8676002)(478600001)(70586007)(82740400003)(6666004)(7696005)(55016003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2024 05:11:59.3665 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a2986e31-253a-4d28-dd24-08dc30402286 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.232]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS2PEPF00003447.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4516 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: Hamdan Igbaria If a VLAN item was passed with null mask, the item handler would return immediately and thus won't set default values for non relax mode. Also change the non relax default set to single-tagged (CVLAN). Fixes: c55c2bf35333 ("net/mlx5/hws: add definer layer") Signed-off-by: Hamdan Igbaria Acked-by: Matan Azrad --- drivers/net/mlx5/hws/mlx5dr_definer.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c index eb788a772a..b8a546989a 100644 --- a/drivers/net/mlx5/hws/mlx5dr_definer.c +++ b/drivers/net/mlx5/hws/mlx5dr_definer.c @@ -223,6 +223,7 @@ struct mlx5dr_definer_conv_data { X(SET, ib_l4_opcode, v->hdr.opcode, rte_flow_item_ib_bth) \ X(SET, random_number, v->value, rte_flow_item_random) \ X(SET, ib_l4_bth_a, v->hdr.a, rte_flow_item_ib_bth) \ + X(SET, cvlan, STE_CVLAN, rte_flow_item_vlan) \ /* Item set function format */ #define X(set_type, func_name, value, item_type) \ @@ -864,6 +865,15 @@ mlx5dr_definer_conv_item_vlan(struct mlx5dr_definer_conv_data *cd, struct mlx5dr_definer_fc *fc; bool inner = cd->tunnel; + if (!cd->relaxed) { + /* Mark packet as tagged (CVLAN) */ + fc = &cd->fc[DR_CALC_FNAME(VLAN_TYPE, inner)]; + fc->item_idx = item_idx; + fc->tag_mask_set = &mlx5dr_definer_ones_set; + fc->tag_set = &mlx5dr_definer_cvlan_set; + DR_CALC_SET(fc, eth_l2, first_vlan_qualifier, inner); + } + if (!m) return 0; @@ -872,8 +882,7 @@ mlx5dr_definer_conv_item_vlan(struct mlx5dr_definer_conv_data *cd, return rte_errno; } - if (!cd->relaxed || m->has_more_vlan) { - /* Mark packet as tagged (CVLAN or SVLAN) even if TCI is not specified.*/ + if (m->has_more_vlan) { fc = &cd->fc[DR_CALC_FNAME(VLAN_TYPE, inner)]; fc->item_idx = item_idx; fc->tag_mask_set = &mlx5dr_definer_ones_set;