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 7ECDA432E1; Thu, 9 Nov 2023 09:41:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 99B5E42E43; Thu, 9 Nov 2023 09:41:30 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2053.outbound.protection.outlook.com [40.107.223.53]) by mails.dpdk.org (Postfix) with ESMTP id 7999842E3F; Thu, 9 Nov 2023 09:41:29 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aMBNQGOnulU7HQgKsvIu8loAz7z2qH2V4jOfxRo47hpt/exCDb6DzSzx0H21nRcxW7BNyp6SUP9OJz5/uM/U0ZS9NEMemJk4Gt66IwIA6iBjMXohzhl/bxu2abiEfzVw6/mCRo9zazFhL6+5jj5QTHsWXf4bbngDiZmpH3wuq14zykhmPV56mYEg1QVVMqfBkevUgYlExXw3I+NAIc+XJGqvU6KfyeNITQmId11Xy8b5saVQL+A8j7Ctcq5qllODkAJXwTQdzwbzlVdG85OpYRe0MP3rVUi7fX437iwMehrR5M05/Dwdsp+rbuRU5i5BfbLLqx8IFFZMb+WGBUyUZA== 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=XLxJLkcY4vxf9jSgTbh3JQfT245zv/e/TXGhnqUdRfs=; b=KahYcXe+wtOFIvM6rpeFyB7t0wFrxCQi29ox7ulOPfZbtwEtog8DCKwgjueoiLrb1bw5kvBd8MbhW10Wog08WN+mrOAb9Z8Q/iBDjCdFJ0WfVvupa/2Z1zAap6F/PmhcpHSoQ8CHipONqfJ0PfsqmD0Vehc7LegfB83IvpuoppZnfRHaD/r0JbXlcFnjsn9fxpq2Ng+L4tHJshhIjfUkZTdSQqAvvm6MxCl9Fwz5icWj4xpQ6tKbmWJ7BL/VbBXq4hjG4I7IdjtXzKf/wUGWUcfuIFbjtAr/W96x5AhPK9wS+Z+QvhOmjOPOv7iT7j66fCwshHzNKbI7AG9r3BzIGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=XLxJLkcY4vxf9jSgTbh3JQfT245zv/e/TXGhnqUdRfs=; b=kB4Z6EY5nemOdWTuKlWhQdujk/TZAYWLupIjZQr84fJzF/eVD+mQVEL1LtvgCWV0dsqybzmqJhGQuASUifU4evnnlfUmbjyGbu/KRnAGA4h7rsTsvTIRzQW9xMuLpjF6pBBM7O/S7Ft9FRyKlCUaKQe5Ddv2PztOzpUaBvBsvt0EFgi71st++7yXfdWeBkq7ibQt1GbGN+1oebvThlhkq1KqgF0vRlEoe7tE4LNHtUBhJvEQAX2ZXK7bsbFn5BuSJR1KNK6x/JLDC8qH9DkmNeqmGXeC32RW16CVh6h5+2fsklXYjDuPtTI0F2o4F5rXT+e8QvoNpCZFN6KdkLeMsw== Received: from DM6PR03CA0067.namprd03.prod.outlook.com (2603:10b6:5:100::44) by CH3PR12MB8457.namprd12.prod.outlook.com (2603:10b6:610:154::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.18; Thu, 9 Nov 2023 08:41:28 +0000 Received: from DS3PEPF000099D8.namprd04.prod.outlook.com (2603:10b6:5:100:cafe::c4) by DM6PR03CA0067.outlook.office365.com (2603:10b6:5:100::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.18 via Frontend Transport; Thu, 9 Nov 2023 08:41:28 +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 DS3PEPF000099D8.mail.protection.outlook.com (10.167.17.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.16 via Frontend Transport; Thu, 9 Nov 2023 08:41:27 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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; Thu, 9 Nov 2023 00:41:17 -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.986.41; Thu, 9 Nov 2023 00:41:14 -0800 From: Rongwei Liu To: , , , , , CC: , Erez Shitrit , Alex Vesker Subject: [PATCH v1 2/2] net/mlx5/hws: fix srv6 mismatching Date: Thu, 9 Nov 2023 10:40:57 +0200 Message-ID: <20231109084057.452476-3-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20231109084057.452476-1-rongweil@nvidia.com> References: <20231109084057.452476-1-rongweil@nvidia.com> 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: DS3PEPF000099D8:EE_|CH3PR12MB8457:EE_ X-MS-Office365-Filtering-Correlation-Id: b8e6c9db-bf75-48ba-a212-08dbe0ffaa32 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: eP5q0VOS9PrTmlCV87Ix8OvbQ0O2hddYTLCJ7ueJ62Jml2fclVEql3L+vIY36O6o3VnfWB3689s5xl4O+uGEvmZGyQ1fzu2OG+s6fPcBVJD4uex6tscYLBVXCklVv5HdNeAO49igH035jpl3Zp6FNdJo/EY80huXVazbMFBDV1+FuDItU2D8p7tOBiCH9/RxbJr7q2+QsY2q/jCXGtDQKbwN5IcfMaA4oRQSmSZvYeLlcG1TxKzFVTLzsP4JpzKdzih0pSdzPe7QAM1NqUaJWKpAZ0aBqtcJiXnvmgPwQT5c7T+H+PW4Ra5nQrnIdnxHH3Mj7PvoqHoL0TxDpdbzma7Di4hm6fQc7viwhnNXiwDts67EYsjD35SFRP5fKeRDlTC9SPwMJQJkQKEFTzFSKaI2UvgJpkS6HKSsUId+IhXhyyl96yTMUsqzLiuodTXioln+v7ikAB+/Wzrs+/hk3HsOWMGf/gEFlnC1ZM8+d5NtPG9oZEPW+N9ATtLYlaApUQUBk3wX46Bv3qLRIirM5vl5G3t0CDuaJIHuHGg1U11XgwyaR5eHfEMG4GmQy1mhlbjY8256xSmvYYtbN2dN1gs2RDIa0B88n96YnnnyJY8+Ss3Rcu+v0GtTAUfUeVpxkjyzoGi3j29rXRWHn7hSYLzOON6xLF0ariWmQgUsy+qSV+BZBOAMSBhV+0AdS3p0TFLTAgK/AJnkfaMO24Fz10kksgxBhzSlc7GIuopAq4SGwBEeconEXcmNre6XC0DV 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)(376002)(396003)(346002)(136003)(230922051799003)(1800799009)(82310400011)(451199024)(64100799003)(186009)(36840700001)(40470700004)(46966006)(336012)(8676002)(8936002)(40460700003)(426003)(4326008)(36756003)(7696005)(5660300002)(1076003)(107886003)(86362001)(6666004)(2616005)(2906002)(16526019)(26005)(6286002)(36860700001)(7636003)(356005)(82740400003)(55016003)(83380400001)(70206006)(70586007)(54906003)(110136005)(47076005)(316002)(478600001)(41300700001)(40480700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2023 08:41:27.8221 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b8e6c9db-bf75-48ba-a212-08dbe0ffaa32 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: DS3PEPF000099D8.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8457 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 When matching srv6 packets, the IPv6 protocol is set to 0x2b by srv6 callback in fc[IP_PROTO]. In the next layer, TCP/UDP callback reset the fc again to the corresponding values: 0x11/0x6. Signed-off-by: Rongwei Liu Fixes: 00e579166cc0 ("net/mlx5: support IPv6 routing extension matching") Cc: stable@dpdk.org Reviewed-by: Erez Shitrit Acked-by: Suanming Mou --- drivers/net/mlx5/hws/mlx5dr_definer.c | 21 +++++++++++++-------- drivers/net/mlx5/hws/mlx5dr_definer.h | 1 + 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c index c0ccde64e1..0b60479406 100644 --- a/drivers/net/mlx5/hws/mlx5dr_definer.c +++ b/drivers/net/mlx5/hws/mlx5dr_definer.c @@ -1069,10 +1069,12 @@ mlx5dr_definer_conv_item_udp(struct mlx5dr_definer_conv_data *cd, /* Set match on L4 type UDP */ if (!cd->relaxed) { fc = &cd->fc[DR_CALC_FNAME(IP_PROTOCOL, inner)]; - fc->item_idx = item_idx; - fc->tag_set = &mlx5dr_definer_udp_protocol_set; - fc->tag_mask_set = &mlx5dr_definer_ones_set; - DR_CALC_SET(fc, eth_l2, l4_type_bwc, inner); + if (!fc->not_overwrite) { + fc->item_idx = item_idx; + fc->tag_set = &mlx5dr_definer_udp_protocol_set; + fc->tag_mask_set = &mlx5dr_definer_ones_set; + DR_CALC_SET(fc, eth_l2, l4_type_bwc, inner); + } } if (!m) @@ -1115,10 +1117,12 @@ mlx5dr_definer_conv_item_tcp(struct mlx5dr_definer_conv_data *cd, /* Overwrite match on L4 type TCP */ if (!cd->relaxed) { fc = &cd->fc[DR_CALC_FNAME(IP_PROTOCOL, inner)]; - fc->item_idx = item_idx; - fc->tag_set = &mlx5dr_definer_tcp_protocol_set; - fc->tag_mask_set = &mlx5dr_definer_ones_set; - DR_CALC_SET(fc, eth_l2, l4_type_bwc, inner); + if (!fc->not_overwrite) { + fc->item_idx = item_idx; + fc->tag_set = &mlx5dr_definer_tcp_protocol_set; + fc->tag_mask_set = &mlx5dr_definer_ones_set; + DR_CALC_SET(fc, eth_l2, l4_type_bwc, inner); + } } if (!m) @@ -2141,6 +2145,7 @@ mlx5dr_definer_conv_item_ipv6_routing_ext(struct mlx5dr_definer_conv_data *cd, fc->item_idx = item_idx; fc->tag_set = &mlx5dr_definer_ipv6_routing_hdr_set; fc->tag_mask_set = &mlx5dr_definer_ones_set; + fc->not_overwrite = 1; DR_CALC_SET(fc, eth_l3, protocol_next_header, inner); } } else { diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.h b/drivers/net/mlx5/hws/mlx5dr_definer.h index 791154a7dc..6f1c99e37a 100644 --- a/drivers/net/mlx5/hws/mlx5dr_definer.h +++ b/drivers/net/mlx5/hws/mlx5dr_definer.h @@ -166,6 +166,7 @@ struct mlx5dr_definer_fc { int bit_off; uint32_t bit_mask; enum mlx5dr_definer_fname fname; + uint8_t not_overwrite; void (*tag_set)(struct mlx5dr_definer_fc *fc, const void *item_spec, uint8_t *tag); -- 2.27.0