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 B7292A0548 for ; Sun, 28 Nov 2021 15:55:24 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B080642735; Sun, 28 Nov 2021 15:55:24 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2086.outbound.protection.outlook.com [40.107.223.86]) by mails.dpdk.org (Postfix) with ESMTP id 5B0134111B for ; Sun, 28 Nov 2021 15:55:23 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aRB5rXcRWKOzS/NqeHQAgVEyWCB+VN1pIrPWtcEuCbiaz7rN08LctpSA+platEjkHIGOwj7EUsH4ZYDJ/vZeLgvW6AbLVXcfyIYszYxCsG1ZI+2u5Ouv9ZR17/ChIQnqIFwWZOdC+uTWz5T5DU844ZaKw3lWSE4HfT6ydx900YOqyNSENHKKimL+3WJ2kkPsssReBu4fTeWRLNiheBuoV0qPXO5+TbXqH633RMF+//wBISUUfc2Q9lRcA9AtU6aoNrbW8rPpsUq+q6tFCi2pvtPV/Y+GgA4R8mcTtKmTpr8Gibcodu2C50UpfDarrgEKzSrtpmbT6E5AK22hgWphJQ== 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=S/8Q0HQa8EFRLZCuF/uIedWuFaRtTTmj9q3OMcRraRM=; b=b4K0E4CFh3G2Y8EblK6SQnusLXAyvxIogTU6AmFrO8DgTO24E1w6zYl4wXP+4RoLvZddfChfXDgcydX3Er0MJ4m6IwIR4zMEGOcxHYlbrvs/b2f4fmwIuPG4PKvD9MzkjzG5H7HLrTf8N1Nanj+TNXJAc2b6lbpckuZ63xTH9JKapyPJKK3kKyLHU7aKCKTt/S8muQol4dx3GFAMTwTALOj6Yl+YgtQBqtUonxx4+JubvkGCl9VhWUd13zTG4h9tMQy3sTXIMeMNsRTeSYzT0IWtCr8Pks2Gao2/PZK2pFMrsddDzW1Ku0d2wL0+HzK1B4yNo/vmtgEKpp2HeETzww== 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=quarantine 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=S/8Q0HQa8EFRLZCuF/uIedWuFaRtTTmj9q3OMcRraRM=; b=J/8hieaFqbpyB6849ScXMm9QKrcxihyzjzVtm2e3MHNXcH1CWkmhfPMsYSzDEZHF8pY0E+U3I0rVkVBAZBm+LfJebZOy1i4kOEg+T5or1bBT1z+ntfxK1T999n1yEX/a5HLROwpmE8MM+/1OEEmP8ByMpSgcRqYDFkkRf2Qut+VMGkonVrnLJtQNY/vTTqaw4TTzk5/ZLsGzpdAOwPhvwhuw6ZFW5U4q1em2w4qSM2Fm5/BeNltPrDAjAZGPHVNRtkWifw+g27mv0P56c76wVhI8A4VaXu+TnJkIeECNjpQHQHb1VoSd3Yt3VVip4EKiEZIxjPoP85A0xY9ZnkzWcQ== Received: from DM5PR15CA0039.namprd15.prod.outlook.com (2603:10b6:4:4b::25) by DM5PR1201MB0124.namprd12.prod.outlook.com (2603:10b6:4:58::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23; Sun, 28 Nov 2021 14:55:21 +0000 Received: from DM6NAM11FT021.eop-nam11.prod.protection.outlook.com (2603:10b6:4:4b:cafe::75) by DM5PR15CA0039.outlook.office365.com (2603:10b6:4:4b::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.24 via Frontend Transport; Sun, 28 Nov 2021 14:55:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) 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.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 DM6NAM11FT021.mail.protection.outlook.com (10.13.173.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4734.22 via Frontend Transport; Sun, 28 Nov 2021 14:55:21 +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.18; Sun, 28 Nov 2021 14:55:19 +0000 From: Xueming Li To: Gregory Etelson CC: Luca Boccassi , Viacheslav Ovsiienko , dpdk stable Subject: patch 'net/mlx5: fix tunnel offload validation' has been queued to stable release 20.11.4 Date: Sun, 28 Nov 2021 22:53:11 +0800 Message-ID: <20211128145423.3974892-8-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211128145423.3974892-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> <20211128145423.3974892-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: 5a2facff-202f-436f-f660-08d9b27f19e9 X-MS-TrafficTypeDiagnostic: DM5PR1201MB0124: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Abj5f/xvawgHYRWbo7De63xYO5l/l5Hbf7Q5lM+cdXHpXYCmyohPacbLDsWQmcMKwPfFmSc6JzVW7INOmvVBtp21MZdmGgEK6utZ3vy0enZBiygSwFQgd6o2Icgz2aB/VzfnaqUwpUiDZcAR66r7XCRp48qAYxsOAPrMoaQojmZk540z5dqiHNZBVT1/DH+OVzDqcbunAceU42Zs8yGX7u1Ztff3M85zwL9I5+JFZZoMY+Clik4XcacCQfbi1ejRDItYvxeRRTDP2f68/Yyuih+fgW/tkD0McgtGJLtdwxHoBbBbSLkLAO28PCrbL3bLV33Y5bySqVDXDAPkhvkYD2Uj24bHBl6Oc190Ss12zIKDwRL5QFiA1tteBS+jm2XwtWKfytaU7kcBDuq9Wz0gwyTrL9uLFar2tajCVeHAvEVowaSrARngmi8v+Ue3IaaAnMtwBeYK+t9oIB4DILQj5SlSuERqx0eNmEzcTRfyBM8FMYlxxsMvSft/Zp6A1fljwvVc0xEtb34fhMPf/yuRqkUcwEFnxsTh/psYg59LAgsOXegDuIVZjDnsku5g/pEIG+9imDJwxN1anY+TuLA9kIMRps2RDmhmRN3QQWI/t1iydZ1QLGjmF+7za4E+Jj7iq08YKw+S5WfkT8VI1dDyXFyrbed41zppIkNQ5OGO7Gm8ylpMyQi0AEhM5IhI3ZIQKfqUQsUrYFId2NYzYS1wzPdK/M1+sMaykmSgPwqdV3NKnPyGQZrLxYDpw9NcgmysQDZ8gqEWP9snOnd+8YFxMrmrKa0bZnCQh1jMb6332tUSfaD2qnvUPGOnIoF9AttouBLfgR3xXjfYEwCOzilwuQ== 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)(36840700001)(46966006)(54906003)(6666004)(2906002)(6286002)(37006003)(316002)(83380400001)(1076003)(70586007)(82310400004)(55016003)(53546011)(47076005)(508600001)(966005)(6862004)(40140700001)(7696005)(70206006)(8936002)(5660300002)(336012)(86362001)(26005)(36756003)(6636002)(36860700001)(356005)(7636003)(16526019)(4326008)(186003)(8676002)(2616005)(426003)(4001150100001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2021 14:55:21.3890 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5a2facff-202f-436f-f660-08d9b27f19e9 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: DM6NAM11FT021.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0124 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 Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/30/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/5744208d62383b276d955922ad6fb5783ad9451e Thanks. Xueming Li --- >From 5744208d62383b276d955922ad6fb5783ad9451e Mon Sep 17 00:00:00 2001 From: Gregory Etelson Date: Wed, 3 Nov 2021 10:55:56 +0200 Subject: [PATCH] net/mlx5: fix tunnel offload validation Cc: Xueming Li [ upstream commit aaa6a7ec0f3e19388f1262b7af298e6668d401cf ] Tunnel offload API allows the application to restore packet to its original form if the chain of flows is missed after DECAP action. MLX5 PMD provides tunnel offload support only if DV API was enabled. The patch verifies DV availability before processing with tunnel offload tasks. Fixes: 4ec6360de37d ("net/mlx5: implement tunnel offload") Signed-off-by: Gregory Etelson Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow.c | 54 +++++++++++++++------------------ drivers/net/mlx5/mlx5_flow_dv.c | 5 +++ 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 49619d95e1..1fa361b318 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -7736,33 +7736,37 @@ err: return err; } -static inline bool +static inline int mlx5_flow_tunnel_validate(struct rte_eth_dev *dev, struct rte_flow_tunnel *tunnel, - const char *err_msg) + struct rte_flow_error *error) { - err_msg = NULL; - if (!is_tunnel_offload_active(dev)) { - err_msg = "tunnel offload was not activated"; - goto out; - } else if (!tunnel) { - err_msg = "no application tunnel"; - goto out; - } + struct mlx5_priv *priv = dev->data->dev_private; + if (!priv->config.dv_flow_en) + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ACTION_CONF, NULL, + "flow DV interface is off"); + if (!is_tunnel_offload_active(dev)) + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ACTION_CONF, NULL, + "tunnel offload was not activated"); + if (!tunnel) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION_CONF, NULL, + "no application tunnel"); switch (tunnel->type) { default: - err_msg = "unsupported tunnel type"; - goto out; + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION_CONF, NULL, + "unsupported tunnel type"); case RTE_FLOW_ITEM_TYPE_VXLAN: case RTE_FLOW_ITEM_TYPE_GRE: case RTE_FLOW_ITEM_TYPE_NVGRE: case RTE_FLOW_ITEM_TYPE_GENEVE: break; } - -out: - return !err_msg; + return 0; } static int @@ -7772,15 +7776,11 @@ mlx5_flow_tunnel_decap_set(struct rte_eth_dev *dev, uint32_t *num_of_actions, struct rte_flow_error *error) { - int ret; struct mlx5_flow_tunnel *tunnel; - const char *err_msg = NULL; - bool verdict = mlx5_flow_tunnel_validate(dev, app_tunnel, err_msg); + int ret = mlx5_flow_tunnel_validate(dev, app_tunnel, error); - if (!verdict) - return rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_ACTION_CONF, NULL, - err_msg); + if (ret) + return ret; ret = mlx5_get_flow_tunnel(dev, app_tunnel, &tunnel); if (ret < 0) { return rte_flow_error_set(error, ret, @@ -7799,15 +7799,11 @@ mlx5_flow_tunnel_match(struct rte_eth_dev *dev, uint32_t *num_of_items, struct rte_flow_error *error) { - int ret; struct mlx5_flow_tunnel *tunnel; - const char *err_msg = NULL; - bool verdict = mlx5_flow_tunnel_validate(dev, app_tunnel, err_msg); + int ret = mlx5_flow_tunnel_validate(dev, app_tunnel, error); - if (!verdict) - return rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_HANDLE, NULL, - err_msg); + if (ret) + return ret; ret = mlx5_get_flow_tunnel(dev, app_tunnel, &tunnel); if (ret < 0) { return rte_flow_error_set(error, ret, diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index e8d4a006d4..37c5a7eb88 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -5337,6 +5337,11 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, tunnel = is_tunnel_offload_active(dev) ? mlx5_get_tof(items, actions, &tof_rule_type) : NULL; if (tunnel) { + if (!priv->config.dv_flow_en) + return rte_flow_error_set + (error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, + NULL, "tunnel offload requires DV flow interface"); if (priv->representor) return rte_flow_error_set (error, ENOTSUP, -- 2.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-28 22:41:03.903624575 +0800 +++ 0007-net-mlx5-fix-tunnel-offload-validation.patch 2021-11-28 22:41:03.206876365 +0800 @@ -1 +1 @@ -From aaa6a7ec0f3e19388f1262b7af298e6668d401cf Mon Sep 17 00:00:00 2001 +From 5744208d62383b276d955922ad6fb5783ad9451e Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit aaa6a7ec0f3e19388f1262b7af298e6668d401cf ] @@ -15 +17,0 @@ -Cc: stable@dpdk.org @@ -25 +27 @@ -index 40625688b0..29134b4825 100644 +index 49619d95e1..1fa361b318 100644 @@ -28 +30 @@ -@@ -9489,33 +9489,37 @@ err: +@@ -7736,33 +7736,37 @@ err: @@ -81 +83 @@ -@@ -9525,15 +9529,11 @@ mlx5_flow_tunnel_decap_set(struct rte_eth_dev *dev, +@@ -7772,15 +7776,11 @@ mlx5_flow_tunnel_decap_set(struct rte_eth_dev *dev, @@ -100 +102 @@ -@@ -9552,15 +9552,11 @@ mlx5_flow_tunnel_match(struct rte_eth_dev *dev, +@@ -7799,15 +7799,11 @@ mlx5_flow_tunnel_match(struct rte_eth_dev *dev, @@ -120 +122 @@ -index fa017c5521..8fa7829341 100644 +index e8d4a006d4..37c5a7eb88 100644 @@ -123 +125 @@ -@@ -6871,6 +6871,11 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, +@@ -5337,6 +5337,11 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,