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 51C44A0C47; Mon, 26 Jul 2021 08:22:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3897D410D8; Mon, 26 Jul 2021 08:22:55 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2058.outbound.protection.outlook.com [40.107.92.58]) by mails.dpdk.org (Postfix) with ESMTP id 0415740DDA; Mon, 26 Jul 2021 08:22:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VSVh9t8Ndm3IdjgLw9Nu0jBWx58Wm7dMtDAfBOQl8g8v7yYGYx6q/CRtyBXwplpepdPLLBoLzxn70ozSjsNa3m/b2TAjmGpS0ELXV+cYCrTRlvPCeNWhUA7k6XVV+pFKa5R1tRSwa+ABdLUjCR/u7YfvI2aZTyuE2vHuoJFhD27FGHQd0/LIWeYZiLlMEVbIF6hB/bPMi9/Ra0WzHKbraRwQFx4J5tXStNPhZZWNjjBoq06M8mBfWgq5dEC2akgJtTDcThgLU2DXByfElpqcKdCIQD/ZWC8KDzcHWq/iIk2wv3TIpYR2PjXwxegAhpNVzmaw7wQnX97a0ZKjNFjQxw== 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=bc/2n9d5wQSgz34pwC4TVcDxVaPyWVPIQ9ja9x5FfKo=; b=UUi8/jIicRk2cek6r5rgInxHfLrdgj5LV9FLW+svS1XBRdqyksV/+gCtjHUZAkJxK21osc4XA++Qlkwme+CL2Hs6unLFvTnoaFhhwRvpTgVzuApSssObuKrwmFbmd4oJ881c8AeEiqulkLUaONZZZOLKP3eWbtaouVwCNCOaR2xoSVidO8I+QvlQ0WhHCRptdgA63Fvnjc2Mvz1ussQnTZyKpn73HHTtPOnWdh6yVsv7vM/uANLgjBz2jA6u81wXKfnJL4GrW/VSvxagz5YS/IRjtf7oeXuuOmUih/TdkfxEHO3Uqqqu7kpljqFlCb4OUeEOhxx/T8rcLWulv1btpg== 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=bc/2n9d5wQSgz34pwC4TVcDxVaPyWVPIQ9ja9x5FfKo=; b=d/dPOzEpFnkkpV+nVK66NQyuqQnfaGvgo+zm354xKnK5+qBxDnC13vCvYdCgOnE4/ioeAGwkEaSOdcCh59MLNZWybuOIc9xQ/1itrko89pGhH51YxWtiamlp0w7xa8smfKfjW20ZQOGDYlTDP2rKmp1gVgkMSbhszfUWjJ/lJ47b6/AE3cYgY4Fb/ELD+7NCptDmuTYjs+g8fvijw/qG9zKkGBhPNbupRqbSwHQKf9MLCSJ1pIDgsAUWI7Ky3YnufJZz2SeH+eKPsqzD0cXDQ4MJJnb8fqAyhwykKu8bs90ZxIy9lr7txFax+ZNUmKL7R9UQOTMKkFusGyQYKehaTg== Received: from MW4PR04CA0217.namprd04.prod.outlook.com (2603:10b6:303:87::12) by SN1PR12MB2528.namprd12.prod.outlook.com (2603:10b6:802:28::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.25; Mon, 26 Jul 2021 06:22:51 +0000 Received: from CO1NAM11FT060.eop-nam11.prod.protection.outlook.com (2603:10b6:303:87:cafe::7c) by MW4PR04CA0217.outlook.office365.com (2603:10b6:303:87::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.26 via Frontend Transport; Mon, 26 Jul 2021 06:22:51 +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 CO1NAM11FT060.mail.protection.outlook.com (10.13.175.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4352.24 via Frontend Transport; Mon, 26 Jul 2021 06:22:51 +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; Mon, 26 Jul 2021 06:22:48 +0000 From: Jiawei Wang To: , , , , Shahaf Shuler CC: , , Date: Mon, 26 Jul 2021 09:22:33 +0300 Message-ID: <20210726062233.30657-1-jiaweiw@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20210723124338.18269-1-jiaweiw@nvidia.com> References: <20210723124338.18269-1-jiaweiw@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2764e56e-0732-49e2-2e26-08d94ffdcbce X-MS-TrafficTypeDiagnostic: SN1PR12MB2528: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:556; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wUSLJosSml3M0H2rJiNMboAFgS/odh6cvt9Bnb2pd4Gq+9TQ78z2w+y7P5UU8/5Yz5eWBXR2tHBStHxq+UrLRoxrMpSwcAYSsTmxjPD5FoU9hjja1Vtk5Fj2GebpbEUcZor5ptOhHCY6xIAdRQL0IbwBvNsn7JGkRkvunKkSEIMBKhlcyIeGAQLhHf8hVy87PzbOZmmImGVeHvIpVv7XBV5+4HWKuuHIfNgxXlIM1dvlTbwLAx7nl7uaLQEpxi7T9MfIRbYN0Ejjsinfy1AA08RqZEs9voVS+rakChSEEwKFEQpEFxlN1a+g/GKcIK5Qa3e7CsS6j6a37qCAwiqOXtgrWraeY9tFGRMFBtcl33U7KEUZSNLxd36TW4GbAOstHC4PpKH9D0lVzcPR/jpsna/1PSBE8S0u9DstRHpFFFPIz2EUvI464Q8+gKIrO1Kth1qc5P1MTYRyLiLg5puluMhdwODkFyoth6iacn2ka35qL5GadezKwmQLZKmvNF2cEfOStp8pH8dtZeXeTG3qs10AaO5ZAym5KrRA8WCZfakOgNudO0rKuqTZtAooqZ0enlutFCsV7HMRVv4ZJxgUpbUnK1iRJRSlL38R+PJIGyK+TdNz46fEpNVm7wEvTRwUMDD/K3GeWWJSejPUyb94caIPITTJF6Qc8z8eFsgsAH6sH6o0bZLkGyvxaPt3xz76kSrXqfK0jN1VNd1DEAHaDg== 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)(39860400002)(396003)(376002)(346002)(136003)(36840700001)(46966006)(2616005)(8676002)(426003)(1076003)(2906002)(26005)(36906005)(110136005)(54906003)(5660300002)(8936002)(6636002)(70586007)(70206006)(336012)(316002)(478600001)(55016002)(36860700001)(86362001)(47076005)(356005)(186003)(6286002)(7696005)(7636003)(82310400003)(6666004)(36756003)(83380400001)(82740400003)(4326008)(16526019); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2021 06:22:51.3083 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2764e56e-0732-49e2-2e26-08d94ffdcbce 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: CO1NAM11FT060.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2528 Subject: [dpdk-dev] [PATCH v2] net/mlx5: fix mirror flow split with L3 encapsulation 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 Sender: "dev" Due to hardware limitations, the decap action (such as VXLAN/NVGRE/RAW decap) 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 into two subflows by PMD, the sample action was moved into prefix subflow in the original table, 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 "L3 encapsulation" with mirror actions in the same flow was not handled correctly in the previous commit. The patch checks whether the decap action is 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 --- v2: update commit log --- 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