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 D07C543B05; Tue, 13 Feb 2024 10:51:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8DA4F427D9; Tue, 13 Feb 2024 10:51:25 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2070.outbound.protection.outlook.com [40.107.102.70]) by mails.dpdk.org (Postfix) with ESMTP id DA02D427D7 for ; Tue, 13 Feb 2024 10:51:23 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aBuzYo0IFdmDgtyKT6NaF/kTNimMW8xxMzlLdMKTRkBCt/qCm1I3hOUkoGSylDXBtx0UXcGgwc+2U5JofWe9sVyb5sh3PE1/oVJJjJ46oszX9ba4Q3FodEfd3laUZEmEC5gioxbWHiZYPAY6PF7OC3DZ7woywouHKnRiwdQin/t81jyVUFwe11rhRlPj3xk4TBDRzi40aFClfHElLUW+c191E6fCU7yhyycxSWkbhGrol3Q0NqiFX9G62ao58rhQbklyvEeGIbG6GhaMJGQ9UEX1OHXkHfg88xRpXnvt2MeJoNyOZSQWw7DTNW8FL0rH9eYB1k+h3/vL6a1oZfRtIw== 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=SNXfWskHkTXYMgUx6UeGaCB8wi4DEUc69SOuYJ7s8Q7iAOOkkmIakIeY6i4uajPZWeBY435ikesX6txeV4xQwEyqT2uWpkuR2VbCOLaLGirZqQbxUl2AiKWEZKUpAa9ewwjUkn7/n40NBqRlagrLbYVA3Lmg/WofIF3R3+6DHjPG+KA1qmD8e/6tk//67DiBse3AhcLyVA8sUsFLkAagmtmjEUWjWW2On5rJc9Q/8Txpg8q+erLcJdxVHG60lm1ea4OJjAJFkqDT/F2S6rJBhTx7qaZaFLOKJojnLVE2Um9zF0iNRS5G4fc1yVNsXt/fmIK9p2TWp5X+cTXUoVIKaA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=JIvtAqSbYAFfdUkPeco+wN6RfbxylUTlSHtU4JbEZHpt/7m4dewTPDj1xWBCqdvAYZSYiDR1GYnRXcT/la2YE20DfiBasGgWXMv5vA48cFv+2pGeM72riFFJuRQj6fOdBfrvAktTpVHKPupjRh0JlCEYWdfRHdDqvG+Ic0FcKhPX/H6vWYxXgCbE/H0VAnO/rSdPmQvIQ82Ng9+j6tK2GX+B6RSEIWjHBJgh8TOLzAGYWqMuHt5hQSnLQzjivdqIsOqRGt5oHwG30YqMZFi0R5gsamgIPbK8neogHFPKiQiUhQADXGSGyKZ3fTc5/xTiR0ZxWoP2rw0h/cCKQmiIsg== Received: from CH5P221CA0006.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:1f2::19) by DM4PR12MB6349.namprd12.prod.outlook.com (2603:10b6:8:a4::8) 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:21 +0000 Received: from CH2PEPF00000099.namprd02.prod.outlook.com (2603:10b6:610:1f2:cafe::1e) by CH5P221CA0006.outlook.office365.com (2603:10b6:610:1f2::19) 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:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CH2PEPF00000099.mail.protection.outlook.com (10.167.244.20) 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:21 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.66) 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:51:07 -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:51:07 -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:51:04 -0800 From: Itamar Gozlan To: , , , , , , , Dariusz Sosnowski , Ori Kam , Matan Azrad , Mark Bloch , Alex Vesker CC: Subject: [PATCH 6/9] net/mlx5/hws: fix VLAN item handling on non relaxed mode Date: Tue, 13 Feb 2024 11:50:34 +0200 Message-ID: <20240213095038.451299-6-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240213095038.451299-1-igozlan@nvidia.com> References: <20240213095038.451299-1-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: CH2PEPF00000099:EE_|DM4PR12MB6349:EE_ X-MS-Office365-Filtering-Correlation-Id: db4ed65a-f2f9-44d3-2ff0-08dc2c79557e 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: Dbfrs3c/oxqixLdEwEfiFCZ+Xz0lCWE2yMQCQx3fAkovqwvDsby1+4CzXPOUHvhM9qn+Xb3I9CNPy1ihOhaEA7HVbAkYfp2H9VhU3oJ4d4KBXw0ndLQGRfvNnIQPjqaaipwT/j8dh49ypcv13zV1e+Hq8DPuwzLLn9lBOJn1cHoOegpKXZTpU4jFGEv+b//q0Ozqr/Qw1KYQNphArx/YpJu3YHc4u6RFq7anhHnEtLXq8FYFrMbgOHsqPISv92fsC7k9kIA3p3SJ7/AuAg6b5dr18/1kvCc7qdFgwDqh3KAXxTOYAp4fSw7znPzfxcQvFsIrp+4jouOlPSWY6yYMlYw50iAWsoWILRffMeDjV4cFrdWOHMEvENTCrYpTjVEm2NOznFMcYU5A8lfR6L4xuc65OgyD2eDb1MYsdjAlAW6LHPK35MF3k6kr87+zPO1AhbRUPHePbWEKJXUHsiOmE0NxtXaZLLxY8v/0KM7bIUJi6IGpFJTn7iB52bzFOtaNCPEfHgr7XJ7DQ0whki24AB8WRUNdCIsBOaKpu57iY4f3Qs8LDuU3dIVdbr99DBxPNQGNYVIi+yja9FghCNCOhf34HxsDBINtB/ryIYXezEQX8q4tGI7EvpVNQGg840SyuAjlLISmsNcdoz/UKYXVqQ== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(39860400002)(136003)(376002)(396003)(346002)(230922051799003)(186009)(82310400011)(1800799012)(64100799003)(451199024)(46966006)(40470700004)(36840700001)(921011)(36756003)(4326008)(110136005)(8676002)(26005)(2616005)(8936002)(41300700001)(336012)(478600001)(426003)(1076003)(6286002)(70586007)(83380400001)(70206006)(5660300002)(6636002)(7696005)(6666004)(316002)(86362001)(82740400003)(356005)(7636003)(55016003)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2024 09:51:21.5203 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: db4ed65a-f2f9-44d3-2ff0-08dc2c79557e 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF00000099.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6349 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; -- 2.39.3