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 E39C543BB1 for ; Fri, 1 Mar 2024 07:05:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B51C94025C; Fri, 1 Mar 2024 07:05:25 +0100 (CET) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2077.outbound.protection.outlook.com [40.107.100.77]) by mails.dpdk.org (Postfix) with ESMTP id C2B48400D5; Fri, 1 Mar 2024 07:05:24 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dPozDzOoyuEpc9OUbyzHwNsl3KFefikdrpWHrvrkqNCfTI0XPcZDCgH+K8L1CpeRuT3RsRKXCoY5X6QHxEbvJhpLsbzqKIo8Sao578MK0TTCiyrWv4vAJgYWfaBnfhMbTr8VvBYJkPgIYdJPSTALtpS6X9oickGxNZFbQ2lUxKY1SA1/EpFXoD7kGUiKcGV8BDpADIjHYeDwKwDTYsnIytk3znDjqLS3fU7DjmUbfuBl0v7Dnusqu7XzrZT8ZtDO5wPpwd85slXAhL8dHgY5U81eUR62uAB7gHrHS5x5jlXui298EGDUQ4+hFb1lds2MotVrsTFbAq0RqvqrTJLXrw== 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=4jQWXKzKqRgCekDN0mFd697huxtdBBFoX12eITRsaVE=; b=H+CY3JK1tvn1Agu9z4KtdWEE59QuY4B7PLUbOB+mQDYPGX7CW4iSJ99IccIGqsz3sbh3WajVjADMNN3NjndusXyTVXgY5/U5ZIw7ZeOqtrio/7pHQHNpwxp39Rv84KESIAiSezjXCUan70TkvZrWXxWYmTPD/cbWbvBoXsMMi+Yy86tPlAKCC/Afaq4F5ejWN2Y2IiBYvBxGhnkAM5If/ejuP67ww7qYdhMQ4kpJyv4n18FUlhj8/YW+R2v7QJkzemvDVtciupuuW536bvwgnIj0fks0TIua12Htbtaf1Km99SuFoaJWAgCKBkwY4oT2LOKwiQZKzzr5clMIozrq7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org 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=4jQWXKzKqRgCekDN0mFd697huxtdBBFoX12eITRsaVE=; b=fL1/ZYzt6GR6Sv3+CVgKGvo8n4P3LYOd5QinZFHgAH/iRpAFnwRJ4UdWttkRh24L4SmaLwzzYlK8fSwQ6x6zHBiyB3Ae8XC/3ejMV9gba/aMAKW6jOYpD0rlcFFYdRRHEXdCDHv+MquRBSonmIIVssrj3iH6gREJkRoToLbN+YQkzm5l8OJBRXWrLv3RSlM3R8zYlPZNaox/iAqEepR3Fsd6Cjzr8AflLLrCw7WpNAJxs95Irxu0OcL4Vp/Suy4EzMx5S4viOdQyMgG7DQshRQUoZTSy3YKV4dfoilYNbtB83NJhVw2F6n6ZVmT7i1TSdDc932xJTZI+I4J96TBlaA== Received: from CH2PR19CA0023.namprd19.prod.outlook.com (2603:10b6:610:4d::33) by BL1PR12MB5971.namprd12.prod.outlook.com (2603:10b6:208:39a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.41; Fri, 1 Mar 2024 06:05:22 +0000 Received: from CY4PEPF0000E9D5.namprd05.prod.outlook.com (2603:10b6:610:4d:cafe::69) by CH2PR19CA0023.outlook.office365.com (2603:10b6:610:4d::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.33 via Frontend Transport; Fri, 1 Mar 2024 06:05:22 +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 CY4PEPF0000E9D5.mail.protection.outlook.com (10.167.241.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25 via Frontend Transport; Fri, 1 Mar 2024 06:05:21 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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; Thu, 29 Feb 2024 22:05:08 -0800 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Thu, 29 Feb 2024 22:05:05 -0800 From: Gregory Etelson To: CC: , , , , Dariusz Sosnowski , "Viacheslav Ovsiienko" , Ori Kam , Suanming Mou , Matan Azrad Subject: [PATCH] net/mlx5: fix VID assignment in VLAN modify Date: Fri, 1 Mar 2024 08:04:48 +0200 Message-ID: <20240301060448.88350-1-getelson@nvidia.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D5:EE_|BL1PR12MB5971:EE_ X-MS-Office365-Filtering-Correlation-Id: b47ce63c-45a0-40a1-849d-08dc39b59443 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: l5dC7gTwa8FWscuYm0pnzzfdvuy83WLLJ5mFSA5sRlIXpR8HmxapWXQT/WWP205sKUG2LrOFwMWcix42VU7Es02CAmMc22OoiZLt81Ev7463c9U5KgWZilXeMzlAYSL/tGDFygO1NOyLKKbH/oickHKDbOlayQGGVYdfRZPhx4ZtsIUkW7IT215NdeaLy3AwD8baYIX0lfdQNmLyraYVnTLM5etOhqSZ4JN4F4nKTVk2IkcoSzKEpP8tbKjl9bJJ/MvUqm0sPMBph3sAvRT7IlfmKuSuy+XyNOSniHLKjdtltFCJxW1Cojq6Op1nessW8Sp92bWVaXrYJhsIPgJEXMgGytfOt2xgZmQmTy3IB6kyGz2CUNhv51as8hJdTKegA55dMKxDiI7m6QT9bA1/pL48GvDPhYtjH9um89NHC5q7qSYvdbH1QUafCFiD0kVezgbBrcrQYOXZwvuuCvlMrYW2Q2zBKhtcySdlq7cdhbTc8UolUz2oOixXcc7KqEgkMYrNu3OlvB4vAHJPYRVtjdC2R0jaYQhC3n1TKgBwemn/rxVvJqC6uJFtuuUU59Gk/8a5SDUW3HmqrH5Ch7QTfAYAuCaodyMwDAEnDTH77szofbkz3JQTvkMTNKxxOXaR7mvdrrvEa50M8z9/b0cpD42nuw+lOR3kJ22E5A60NRZpLXxJqGDAOyV++o4OGg9tx6W7uODdKYX41IwS3pLlLE4EmxSnlnFeE5krRHw7tvuzEeGjrYKb6vn+q749M7Lj 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)(82310400014)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2024 06:05:21.7990 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b47ce63c-45a0-40a1-849d-08dc39b59443 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: CY4PEPF0000E9D5.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5971 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org PMD uses MODIFY_FIELD to implement standalone OF_SET_VLAN_VID flow action. PMD assigned immediate VLAN Id value to the `.level` member of the `rte_flow_action_modify_data` structure instead of `.value`. That assignment has worked because both members had the same offset in the hosting structure. The patch assigns VLAN Id directly to `.value` Fixes: 773ca0e91ba1 ("net/mlx5: support VLAN push/pop/modify with HWS") Cc: stable@dpdk.org (backport) Signed-off-by: Gregory Etelson Acked-by: Dariusz Sosnowski --- drivers/net/mlx5/mlx5_flow_hw.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index a87bb52c06..027b0e084d 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -6863,7 +6863,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev, rm[set_vlan_vid_ix].conf)->vlan_vid != 0); const struct rte_flow_action_of_set_vlan_vid *conf = ra[set_vlan_vid_ix].conf; - rte_be16_t vid = masked ? conf->vlan_vid : 0; int width = mlx5_flow_item_field_width(dev, RTE_FLOW_FIELD_VLAN_ID, 0, NULL, &error); *spec = (typeof(*spec)) { @@ -6874,8 +6873,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev, }, .src = { .field = RTE_FLOW_FIELD_VALUE, - .level = vid, - .offset = 0, }, .width = width, }; @@ -6887,11 +6884,15 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev, }, .src = { .field = RTE_FLOW_FIELD_VALUE, - .level = masked ? (1U << width) - 1 : 0, - .offset = 0, }, .width = 0xffffffff, }; + if (masked) { + uint32_t mask_val = 0xffffffff; + + rte_memcpy(spec->src.value, &conf->vlan_vid, sizeof(conf->vlan_vid)); + rte_memcpy(mask->src.value, &mask_val, sizeof(mask_val)); + } ra[set_vlan_vid_ix].type = RTE_FLOW_ACTION_TYPE_MODIFY_FIELD; ra[set_vlan_vid_ix].conf = spec; rm[set_vlan_vid_ix].type = RTE_FLOW_ACTION_TYPE_MODIFY_FIELD; @@ -6918,8 +6919,6 @@ flow_hw_set_vlan_vid_construct(struct rte_eth_dev *dev, }, .src = { .field = RTE_FLOW_FIELD_VALUE, - .level = vid, - .offset = 0, }, .width = width, }; @@ -6928,6 +6927,7 @@ flow_hw_set_vlan_vid_construct(struct rte_eth_dev *dev, .conf = &conf }; + rte_memcpy(conf.src.value, &vid, sizeof(vid)); return flow_hw_modify_field_construct(mhdr_cmd, act_data, hw_acts, &modify_action); } -- 2.39.2