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 33D3EA0C47 for ; Fri, 23 Jul 2021 14:44:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F095D40DDA; Fri, 23 Jul 2021 14:44:01 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2057.outbound.protection.outlook.com [40.107.223.57]) by mails.dpdk.org (Postfix) with ESMTP id E94704003C; Fri, 23 Jul 2021 14:43:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CzJjqQarr0jSIfwwYwtN68qghZ0V/AgO9xOC7LeVUOBmxGfu+sQ68x/ea30Otn9s1CKwUISF3XSduepPbiQQ516qali4SaYDt1HV7vJipRn9Dnu/jpPYihHf2scqL6Do4fBGBUfPRz4YDeMJprQXuskIZVKphgMsNnjXYRQOl0tpJP/E5uxZ0JgD4PSyYDYfBJWIDUKiavvcub8tHY9vfMHwwmrOsvBfI7h/HybFRfKFiM2Qbkgw7d9RVSliqaeQvfb+rhxq7/wr68pRwzGpjaOCbleis1cLU10aYJbR3MCLhkUVIzgtkeDx2unq+JRNBDlsO71TLyrxcxVQe5JwOA== 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-SenderADCheck; bh=ymCc8b94xJR8dO+NuDzROjKWrSO6HLFnLxFU6LZJy6A=; b=SFPFt7nJnrzZB133X27B5snCtLD1nBsDy92h6/UGMu2KCoI04Fv/rmm359RfchHZAyIvrh8ZBaecUjOG5kpLSo5tgx4MdG1Z8/GQWrhACfhy3XCDyRIVKS9uKpcd1Gxeo6n0cB//xP09DD2C1oUTc6PqXxjouZgaSKDy1xibw8FVMSReeb95Ww1T3NbRLzDxRCsVKANqzbit3KGSJ8xLlQ6tF3OKwkIRuLXUo3pa+RDdmIUpNzp4zWFoWBDUEljxjWPcVJj7LZlMWYWf7E9Fh7hC+6Xfif0xRpG/QmjECVoEnHTb0dPlCFl7hzIegJDy5Qv3cHA10UoUCRrjnnhNqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none 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=ymCc8b94xJR8dO+NuDzROjKWrSO6HLFnLxFU6LZJy6A=; b=PFEV+tQqjRrKC5Jy8kf6iGcuOqEe00YySRb8KX0FaIUO/NYrEC4lLZw1lj7LTQ0C1a0RP74HImlL9/3VILgzPYPBvQzXTvJpk6xflygxE9CJsZlottd1mE7YAwZpZyoINR4b/1NbY0WFtPr/1hxzEKXpNNAag0uUP2uOvS/sG92QSpfs8v6Z/q1CIdf7mss/lpBsV+mn4GBtsqbXHVZv9e9pRDmFf7PmBaXJqXGLUxIL6npA5OT7ezkfTRny9PEO0Ptz+/pMSREKH8xdaG1V14ozHZ/c4yERMfugYQh7byBHxmQWOY2Rmj9sztd//7PK8KvGCt6GAu1nD8VGK/BKbg== Received: from MW4PR03CA0134.namprd03.prod.outlook.com (2603:10b6:303:8c::19) by CH0PR12MB5299.namprd12.prod.outlook.com (2603:10b6:610:d6::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24; Fri, 23 Jul 2021 12:43:57 +0000 Received: from CO1NAM11FT056.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8c:cafe::5c) by MW4PR03CA0134.outlook.office365.com (2603:10b6:303:8c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24 via Frontend Transport; Fri, 23 Jul 2021 12:43:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by CO1NAM11FT056.mail.protection.outlook.com (10.13.175.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4352.24 via Frontend Transport; Fri, 23 Jul 2021 12:43:57 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 23 Jul 2021 12:43:54 +0000 From: Jiawei Wang To: , , , , Shahaf Shuler CC: , , Date: Fri, 23 Jul 2021 15:43:38 +0300 Message-ID: <20210723124338.18269-1-jiaweiw@nvidia.com> X-Mailer: git-send-email 2.18.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fae83313-4628-4586-4582-08d94dd789c4 X-MS-TrafficTypeDiagnostic: CH0PR12MB5299: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fJrLPRigXz93/Hd6GWH4NSI6EYBD1QdsmVoL+8q5OD8Q6q17K6nlM8rs40sAWWrZLZHTA4qrmzbWvoZ+NnkCyU/+/XE1tN/3pjk3TSYiVRN/RGTz3tjMrwHvVFdKsZACT4/QuAGRwIZsFIcvPAWy5oazZpa7HsYuLgEUAJLwE0UeXi04tNFFM+8kKNSBhXKAdynJD3o/s8EC01cHB2ivO2CE4/RffdXXqrCNJhLWeVjW4aKcackXzDKEswHU9rsW9rjZHz3y1bb3nldX4VAYxbHXpOUFiOdNXJuHDcg5tNVihr+oaLFkhYaAimqbq96Qji2Gf1vvTlbtJkVve2BcPe90RfZcxOwXSrMW2lAuDcBvH/f+gYxROECKxEk6eLJ+9EXCn3AYA1IKsrH/QLHX9gmJ/szv903ovsbz9CgjmmdaiQ2blJj4dvgt7BOCyYTbzurqK6MPlgYW+eReGmU7DCE0moGaMEWYO6zErbYHGnfeOZjK2WWw3rnikRWmJhnNKLRz/MDbzAO65vkrBhn9bjgUTzc7QB1pYgk1EqgQAlusHWDJjy2Hj8y0bwmgvgOddid6yV2Syzo8nIqWSQAmgnX43fsfb6DcUBmY/CPqeGV+MmJq4YaNeCkaQL6EiFMHBg+r1pBwYhZN8i+8sAXzQrggTQMSOTqR4sIIt7yk3WRz6sRGbL7ewi3NL93Pc+LRhpocDeVW/R5b4/+xI8T1lw== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(396003)(136003)(376002)(39860400002)(346002)(46966006)(36840700001)(356005)(4326008)(2906002)(82310400003)(5660300002)(47076005)(110136005)(1076003)(8936002)(7696005)(6286002)(478600001)(86362001)(8676002)(26005)(186003)(83380400001)(16526019)(54906003)(316002)(70586007)(70206006)(2616005)(55016002)(36906005)(426003)(6636002)(7636003)(82740400003)(36860700001)(336012)(6666004)(36756003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2021 12:43:57.3095 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fae83313-4628-4586-4582-08d94dd789c4 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT056.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5299 Subject: [dpdk-stable] [PATCH] net/mlx5: fix mirror flow split with L3 encapsulation 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 Sender: "stable" Due to hardware limitations, the decap action can't follow the sample action in the same flow, to keep the original action order of sample and decap actions the flow was internally split by PMD, and decap action was moved into suffix subflow in the new table. There is a specific combination of raw decap and raw encap actions to specify "L3 encapsulation" packet transformation - raw decap action to remove L2 header and raw encap to add the tunnel header. This specific L3 encapsulation is encoded as a single packet reformat hardware transaction and is supported by hardware after sample action (no hardware limitations for packet reformat). The patch checks whether the decap action is the part of "L3 encapsulation" and does not move the decap action into suffix subflow for the case. Fixes: cafd87f62a06 ("net/mlx5: fix VLAN push/pop and decap actions with mirror") Cc: stable@dpdk.org Signed-off-by: Jiawei Wang Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index a3fdce685e..3200a306e9 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -5259,6 +5259,7 @@ flow_check_match_action(const struct rte_flow_action actions[], int *modify_after_mirror) { const struct rte_flow_action_sample *sample; + const struct rte_flow_action_raw_decap *decap; int actions_n = 0; uint32_t ratio = 0; int sub_type = 0; @@ -5311,12 +5312,29 @@ flow_check_match_action(const struct rte_flow_action actions[], case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP: case RTE_FLOW_ACTION_TYPE_VXLAN_DECAP: case RTE_FLOW_ACTION_TYPE_NVGRE_DECAP: - case RTE_FLOW_ACTION_TYPE_RAW_DECAP: case RTE_FLOW_ACTION_TYPE_MODIFY_FIELD: case RTE_FLOW_ACTION_TYPE_METER: if (fdb_mirror) *modify_after_mirror = 1; break; + case RTE_FLOW_ACTION_TYPE_RAW_DECAP: + decap = actions->conf; + while ((++actions)->type == RTE_FLOW_ACTION_TYPE_VOID) + ; + actions_n++; + if (actions->type == RTE_FLOW_ACTION_TYPE_RAW_ENCAP) { + const struct rte_flow_action_raw_encap *encap = + actions->conf; + if (decap->size <= + MLX5_ENCAPSULATION_DECISION_SIZE && + encap->size > + MLX5_ENCAPSULATION_DECISION_SIZE) + /* L3 encap. */ + break; + } + if (fdb_mirror) + *modify_after_mirror = 1; + break; default: break; } -- 2.18.1