From patchwork Wed Aug 31 13:22:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiawei Wang X-Patchwork-Id: 115694 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 50701A034C; Wed, 31 Aug 2022 15:23:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E082140F17; Wed, 31 Aug 2022 15:23:02 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2056.outbound.protection.outlook.com [40.107.244.56]) by mails.dpdk.org (Postfix) with ESMTP id 72BEC40395; Wed, 31 Aug 2022 15:23:01 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I68lV1jxbOawCeejGskGLzRdXNmJHzgrd2/oEGkSgRVpKHTPXMlQ+pnJKzvk6Y4t4TyrAkpsW/8YO9QlyN6a/wC0njn7sHFEmoo5if/reGsc2ZNeUwTeAWU9+HEy1AH8KALopYO40Y55CCAGGTNLz5VNOnJWC4BoPxIxJ00vWZkxZOnUea7Ra40b5OadrkT+E4r/vqDdlQgw9/Gr1GWC+hC/lG+gSuKVCxxFqj10hjp1tySZw2vQYJ9XBHFfq9O8ULR53XGb+3O9KSL/sDm7UB3OFYimJfsEtuQ9a6iJdVrUdxiLiyKqPj8vUaJ4Z/WSdmolZdyyKHUR+coR+4Ragg== 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=KiyH7980VsSo8lq0zqoDkDQHHawx3pKUHqqpPxba6XA=; b=jet/b//bQuyioTN1LtwouYjnW4ZZMbSnhzHpvPmfiCAchJ3s+sNGvfM7uqQijZcjjlSL0FTdpJbdNDx5rXWANGbFM48Baz7MIQeqB1D9sIA4SaAOIBTU0jGiruXtz8iv6mYu2o6yxancvOG0QrXreFiBCwicjbkHQFmQruOALXiMo9DEnvq3/7DIfOqk27X5iiG08AIDVYvhT34TOLDMbIZfJhySSKIdBEL0hjJgX0AneUVTJj+I5zqNeYUP7+6Psk8M6YOy/bi1x0oY+p9grKO0rBOHLUuuX9H2nvvAFKmSi/XCxGhNzfkdH3dzw4BPrJEcbGoxpgCVgwpv5IKFiA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) 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 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=KiyH7980VsSo8lq0zqoDkDQHHawx3pKUHqqpPxba6XA=; b=TecNnLLe03xEy2oCl69NEhufdrOvskg2adNgk0ZXJaPMKa8Z8YNQo8jeFYDWBMr6L0lsWVtXdTf3C0mAuV/G0MLQMPg9+iHond1MdbPAyuoOECdIiKVd9RmPdjR1glM9x5I3jw4ddfXRsVserhL9/XlloZYurPEKW7aCca+mAeZXF4O0ZlAY2SYtAHrd4dBQukzUI7kFEOTb0AbR+XIw+6INNVVzqWtmDoFoHTWKkbkn/2EOQgGh282qhMetwfu3hUKf+3nIoZ99uDtsl356jdckHI2GkQ1TQTztN9kpAtcKoXglR6twSqB2bB9pE7aHsZRq5phSDzbwF6HodYp5Qg== Received: from BN9PR03CA0565.namprd03.prod.outlook.com (2603:10b6:408:138::30) by CH2PR12MB4056.namprd12.prod.outlook.com (2603:10b6:610:a5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Wed, 31 Aug 2022 13:22:59 +0000 Received: from BN8NAM11FT045.eop-nam11.prod.protection.outlook.com (2603:10b6:408:138:cafe::c7) by BN9PR03CA0565.outlook.office365.com (2603:10b6:408:138::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.11 via Frontend Transport; Wed, 31 Aug 2022 13:22:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) 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 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.238) by BN8NAM11FT045.mail.protection.outlook.com (10.13.177.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5588.10 via Frontend Transport; Wed, 31 Aug 2022 13:22:59 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.38; Wed, 31 Aug 2022 13:22:58 +0000 Received: from nvidia.com (10.126.230.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.29; Wed, 31 Aug 2022 06:22:55 -0700 From: Jiawei Wang To: , , , "Suanming Mou" CC: , , Subject: [PATCH] net/mlx5: fix modify action attributes detection Date: Wed, 31 Aug 2022 16:22:30 +0300 Message-ID: <20220831132230.1101-1-jiaweiw@nvidia.com> X-Mailer: git-send-email 2.18.1 MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d8000cd0-a0a3-45c5-3156-08da8b53ec91 X-MS-TrafficTypeDiagnostic: CH2PR12MB4056:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5oyfFE3ZqvEOFbEwa4U8qmTlmVYRzH3ojwJFPCCNpHPLOcs96LdrSARCbZBasZT4V/MrLMBv7elaq2Zo/HxctdZrQwQHcqvBqbsR8E1RvN5gplxaYcZPSYNvQzgz9XNViqek+NWBo16hd7h5FY7Ig4plTmHU75Jad2MEQC0zfJp6/k2LSwi3OJvptKw3qestVj4ief+JAz+zq5zPuTEcy+w/nWw9nR4wuAQk2LlcFEh2BoxNjfCRGpErWUHNxFXR+NloTv+HHxmX6hgjBipKPgLuEyE04/ux3a3ndvZ5rU3XyfeleJe8MgkERE1eBd7scUIXg4JZHVrwNOB9+xYG60TiK6n18yNbfTb9P1W4uxVpSFjWW5goXvljUxc2nFdP5P4JwNUGsx9or18QPGSQ/d3g+OmLNRJgvFg5iX14tBsxtsVX3/jTYyogp0Ec/qyazaWM8nABsgPYFTgUz27qBeurlKUWqkIwdhedp5prWM5NI0+yLCVreyMmJoVB83rDD7D/tE8moSRXO38RMUsBlWZdgoEsaK0Dsz2OqirPUAZ0oZMt9gKsja5znG9SlS1/zla+yPhrKAblxtdWAbrBgO7Itwk4ZllCHy7NUOwnxocOJVmNPIFxIya32C7G3FBxOCjSVqN2MF4moifSSI8tdJBArV3pVlcItqVXt0x34/elj65tHYxugaYrr9lLGLj9rwqiUMucHWKMrp33tb0pQm+VQCixcNNqB4lrB3d/BshfYr4kgPzGL5j7muiE8npwwc+ce/9ys17P6XLFyiELw6mh3Qoli4UNMMO2K67PN4rO+pdseJP3Q9itigqD/Yx6 X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(136003)(346002)(39860400002)(396003)(376002)(46966006)(36840700001)(40470700004)(110136005)(5660300002)(4326008)(8936002)(8676002)(36860700001)(47076005)(1076003)(54906003)(426003)(36756003)(450100002)(26005)(70586007)(2616005)(2906002)(316002)(7696005)(41300700001)(478600001)(6666004)(6286002)(70206006)(40480700001)(82310400005)(86362001)(81166007)(356005)(336012)(186003)(82740400003)(83380400001)(16526019)(40460700003)(55016003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2022 13:22:59.1956 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d8000cd0-a0a3-45c5-3156-08da8b53ec91 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT045.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4056 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 driver splits the flow with sample action into two sub-flows, sub prefix flow and sub suffix flow. In the case of tunnel flow including a decap action, the driver should translate the inner as outer for actions coming after the decap action. In the case of flow splitting, the packet layers, used to detect the attributes, are inherited from the prefix flow to the suffix flow but the driver wrongly didn't handle the decap adjustment and the inner layers didn't shift to the outer. This patch adjusts the inherited layers in case of decap. Fixes: 6e77151286b2 ("net/mlx5: fix match information in meter") Cc: stable@dpdk.org Signed-off-by: Jiawei Wang Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow_dv.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index bee9363515..f0dbc96dc8 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -121,6 +121,13 @@ flow_dv_attr_init(const struct rte_flow_item *item, union flow_dv_attr *attr, * have the user defined items as the flow is split. */ if (layers) { + if (tunnel_decap) { + /* + * If decap action before modify, it means the driver + * should take the inner as outer for the modify actions. + */ + layers = ((layers >> 6) & MLX5_FLOW_LAYER_OUTER); + } if (layers & MLX5_FLOW_LAYER_OUTER_L3_IPV4) attr->ipv4 = 1; else if (layers & MLX5_FLOW_LAYER_OUTER_L3_IPV6)