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 BA388A0032; Thu, 1 Sep 2022 04:12:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5676940684; Thu, 1 Sep 2022 04:12:16 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2067.outbound.protection.outlook.com [40.107.237.67]) by mails.dpdk.org (Postfix) with ESMTP id F12FF40395; Thu, 1 Sep 2022 04:12:14 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bfac0PmhSgHw9gQJA3Dc1C62X1moT1+MAIuwvq0xJmhJgwkBNaUu2cgWnuoddk4Fa6wb8uPuH5+bzKSzEbwparOZGrnW+NCwMzFh62XwXCuNgW23igkJ7mpO7VhtI+AcZXuXUsMI4xJllK9tP+9STOBpVxP+DPkK9XLBJg0tpEexDamN6mRwq175CxAf4DJoP2Rzbjnu2C1ERAYjBOwi9wD2DztIGWLkn3Ynk8wu1UwnfbzPWwbUSQTNhlxvwBR+sNKJZhUK/G7EOV8bmNJm+B7iNe5QpkFmVviasTUXJ8SKIL2nj4cpC539PsBHP1CcI/Wq3UT23fdGIFyYcNaaKg== 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=WqTOOCMnP4ZTeRtlu4aT0+DlZnS2H/d5S3CWScFwxzo=; b=OjepwEM07hLf8fEPjtg3HMVgMUMjG4w2sVRqiKSYRlPH+5efvuvxMCh4xBz3pgMMu18nUT5ilpHR0zzvMOU26E+nC+v8pWoV+7fmKR4pG02PIZdycjdsPff2ynATbdQ+1219AWAmFcC5h1kOMV+BYbXE7kV4N5b8b/byvse0jUsN4bZGAmkyrs7hEnIwXpucCSZpY/CP8zz5IMxLLIQsY6kqAKQE9YKeVxwS2DCo6Qp3E6swgNv/xLGPWpHCHEEepfmjct7k/0P861r1ylstX5Wmx45Z9IAKUDxcPSx0kbeEWb9PPgbytLa407etuy21oi3lDYzNfYMgDkfoeYiudw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) 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=WqTOOCMnP4ZTeRtlu4aT0+DlZnS2H/d5S3CWScFwxzo=; b=EbuPw0TFZFD67w35Gf9bWp9hos0df4NqnzCsaFaPI4/lDPSsmNfw609RAypEsUapLOf/83kMWyiKxCqWr50s7AxS4l5j31zPPHR3CnQbiTna3JGhyEwTE8o54IKrIAAGhBnO9DJ/dNIv4tFUAbhNQzDVP9S27GzMMYZ3VIgiNbVfFH3TXco9B5uTrvk2a+uZLNmt1B1zMtqv7OyFIAJLgO84MqYQq9bwtr3nj8OcwtpZNAFBycMQxUar+Gctn2Az86jCYKlNMmh8+6TMV6zfzXQ0yTtxJ2Pwg+sLM8RDJD5SQc4ZJcBDmRGBqz03tCMbQC1R5WqcqGK5Oz8xAtKDpw== Received: from MW2PR2101CA0009.namprd21.prod.outlook.com (2603:10b6:302:1::22) by MW5PR12MB5624.namprd12.prod.outlook.com (2603:10b6:303:19d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.18; Thu, 1 Sep 2022 02:12:13 +0000 Received: from CO1NAM11FT011.eop-nam11.prod.protection.outlook.com (2603:10b6:302:1:cafe::34) by MW2PR2101CA0009.outlook.office365.com (2603:10b6:302:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.6 via Frontend Transport; Thu, 1 Sep 2022 02:12:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) 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.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.234) by CO1NAM11FT011.mail.protection.outlook.com (10.13.175.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5588.10 via Frontend Transport; Thu, 1 Sep 2022 02:12:13 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.38; Thu, 1 Sep 2022 02:12:12 +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 19:12:10 -0700 From: Jiawei Wang To: , , , "Suanming Mou" CC: , , Subject: [PATCH v2] net/mlx5: fix modify action attributes detection Date: Thu, 1 Sep 2022 05:11:56 +0300 Message-ID: <20220901021156.15920-1-jiaweiw@nvidia.com> X-Mailer: git-send-email 2.18.1 MIME-Version: 1.0 Content-Type: text/plain 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: 41401fe3-e1f5-454e-9508-08da8bbf6257 X-MS-TrafficTypeDiagnostic: MW5PR12MB5624:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tVyPL2gtIGDO3Jvit9bX+Mwipv8tl4l7zNprfkiRh4ewCKQJOOEzPy1gzwoJ0gzW/0soYKctABM5lkMCncc1VgSLIciVE67W+E+ItZpMAOyl32XBqA14cehLqyjAw8OF8CVUlU7An3uJlnkboOyOe8XU6UBF4f8EB1yHX6xgY8FUwv3etki+nfvnKuFfq5MPvRlTb5NgEJ22TSuRaR8sagq7V79ZwIe7hxYIm8DL1T7TE1t/43u57bER3PQ5XSIjB4Zh0pXtk4F+RkoeuPXu9ZfIubsK1KOuX7fLNN6NYnjLzR/g29xQ3ozqvg3km0LjzRBxR5fKH/3G/xVbx4vOHkUzzuW48BqPPaN0XjP0oZ4wAeZIs7nTqZqJVuE1MqnXIuyHGcICgIoxpfIYHiVtm/VslZ3qWbdst+YguHzNTSIobaqeuux939//YlHhDK9zzjqmwGqkukoXr8osnCTCGMsdopcxEh2x8MMa1qsD4xUeiA4tsziR3QkYR16nRrVue063eqVnbJdYzwMV860stFe8ltujAqxNMShYzPqMvGNkSjPAoembkugnGN4+yyePAz8iF9wRoFQ8zLiM2NrkKLMSwlwYh6gOlzHjRhOgI82gmbuX2FkbBexoOMrP3gD3Nor5Zm8uQW2c70VhR+ilYE6GKKEvT5tgI+981Tqa0ShJxTu7VEh4nSgojZ8E2yGIGBNH6DBVZmnZK2LdoPop8Lsy6jv3/AZYCV/fhDruijxz3Hozqqatcjv6bIr+9HlfQRl9voR9Ao0pDA19FD85wIaxPwDlpEtJKf1QUGlWLjyZcogG/ILM1WI3/bNYG0/I X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(346002)(396003)(376002)(136003)(40470700004)(46966006)(36840700001)(41300700001)(7696005)(81166007)(2616005)(86362001)(356005)(40460700003)(70586007)(83380400001)(36756003)(1076003)(36860700001)(336012)(70206006)(186003)(54906003)(450100002)(110136005)(8936002)(426003)(5660300002)(47076005)(16526019)(8676002)(478600001)(82740400003)(82310400005)(40480700001)(6666004)(55016003)(6286002)(26005)(2906002)(4326008)(316002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2022 02:12:13.0330 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 41401fe3-e1f5-454e-9508-08da8bbf6257 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.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT011.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR12MB5624 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 --- v2: fix the style warning --- 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..76113785ea 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) -- 2.18.1