From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D4E5CA0553 for ; Mon, 17 Feb 2020 18:46:38 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C78861DAA8; Mon, 17 Feb 2020 18:46:38 +0100 (CET) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 7C96C1DA12 for ; Mon, 17 Feb 2020 18:46:37 +0100 (CET) Received: by mail-wr1-f66.google.com with SMTP id c9so20810000wrw.8 for ; Mon, 17 Feb 2020 09:46:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cNfCBYpDaT4gjcekQGfZac0MJONweCFSMpzfXJHa+JE=; b=PO7U+YLtDk4TZZcSjRbR3XtWaOhUoSetyoKRdOqFNDYWjI0r3z2jhOBDNaVA02YEK9 AWp2UpSXWYWRKQDN1ZkE043L1HL/cBvIxS3BrX+qMO0sjTJyYGTTXP/N48eKpQD+CVS5 eynPusm94k7nDIi/z8k2Vhl1aw0H5VR+wlSiSf1n5P8MoheIedPMaB2ILY1dkedu6n8V cvEMS5T4NO6+fR1Em0jM63FjlOIIJjSKLUGMkCTCbClWxisj4oxjkQPlstOBA+UVlhs7 aZgWBsYRakmLuUSauytOHARFjxgbGHFjdTMX418LD+kLnFWs+bOWVzpPGfE4O1uWDHLa WTSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cNfCBYpDaT4gjcekQGfZac0MJONweCFSMpzfXJHa+JE=; b=PwSTJm60LiPNqmM5N7DU5KQGFCYLJc/xl+4U1WjhqvvRxJSkzmWg53jzV30vhQOKlJ quHFVj8oZPccVPIGfimoAY0we3Wl3VoZrH43Bw3UUypVkEMiAGNNqDlYTj6t+o7/4xgg H4m3dqZF6z5XucFhuYrCYKcJARq8/dYiDc3ZRkBQezFuDuyoURWdODiN8CDDh7yYpUBu r6zoT+lixSP1PGpe5fUoC/4K6F+1rUl36g9I0s1/ZD2+wDtIJ+989tRRPiWyKGgJV3R8 AheDB32ijtRdSFITh/hmTom9vfTiJJL4fNPnCwdE+docfZZhno1tkN7x+6+L675w5hYC LT8A== X-Gm-Message-State: APjAAAUSUpde0uIDbyQGQr1BO/co5iKazjXJSM9o5z1v6tO6ssfG1Erg q92g0wCknY0dHqy1+kKDxTM= X-Google-Smtp-Source: APXvYqxtkr/fEDp6aWoLfzEprpz5SoOkdcUcHVLkEr7mb0yb29h41s9SPOsSbID7Vy1FmnJTPJW5ng== X-Received: by 2002:adf:81c2:: with SMTP id 60mr22842393wra.8.1581961597240; Mon, 17 Feb 2020 09:46:37 -0800 (PST) Received: from localhost (userh634.uk.uudial.com. [194.69.103.7]) by smtp.gmail.com with ESMTPSA id s23sm2063916wra.15.2020.02.17.09.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 09:46:36 -0800 (PST) From: luca.boccassi@gmail.com To: Suanming Mou Cc: Tonghao Zhang , Viacheslav Ovsiienko , Matan Azrad , dpdk stable Date: Mon, 17 Feb 2020 17:45:21 +0000 Message-Id: <20200217174546.25334-29-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200217174546.25334-1-luca.boccassi@gmail.com> References: <20200211112216.3929-190-luca.boccassi@gmail.com> <20200217174546.25334-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: fix meter header modify before decap' has been queued to stable release 19.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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" Hi, FYI, your patch has been queued to stable release 19.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/19/20. 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. Thanks. Luca Boccassi --- >From e32739c056ce736ff67511b964181229e6a86d75 Mon Sep 17 00:00:00 2001 From: Suanming Mou Date: Thu, 6 Feb 2020 06:14:25 +0200 Subject: [PATCH] net/mlx5: fix meter header modify before decap [ upstream commit 431f199883e5b7eeea87a2f9f0272daf3354c1da ] The meter flows are split into three subflows each, the prefix subflow with meter action color the packet, the meter subflow filters out the colored packets, the suffix subflow applies all the remaining actions to the passed packets. The tag header modify action is added to the prefix subflow to make the suffix subflow to match the packets from the prefix subflow. Currently, the tag header modify action is added at the beginning in the prefix subflow even before decap action. The header modify action does not make sense to the later decap action, so the flow create will be validated as incorrect flow rule and failed. Move the tag header modify action just before meter action in the prefix subflow to make the flow with decap action to do the decap first, then do the tag and meter to fix that issue. Fixes: 9ea9b049a960 ("net/mlx5: split meter flow") Reported-by: Tonghao Zhang Signed-off-by: Suanming Mou Acked-by: Viacheslav Ovsiienko Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 45df610a91..07979a09cb 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -3471,21 +3471,25 @@ flow_meter_split_prep(struct rte_eth_dev *dev, struct rte_flow_action actions_sfx[], struct rte_flow_action actions_pre[]) { - struct rte_flow_action *tag_action; + struct rte_flow_action *tag_action = NULL; struct mlx5_rte_flow_action_set_tag *set_tag; struct rte_flow_error error; const struct rte_flow_action_raw_encap *raw_encap; const struct rte_flow_action_raw_decap *raw_decap; uint32_t tag_id; - /* Add the extra tag action first. */ - tag_action = actions_pre; - tag_action->type = MLX5_RTE_FLOW_ACTION_TYPE_TAG; - actions_pre++; /* Prepare the actions for prefix and suffix flow. */ for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) { switch (actions->type) { case RTE_FLOW_ACTION_TYPE_METER: + /* Add the extra tag action first. */ + tag_action = actions_pre; + tag_action->type = MLX5_RTE_FLOW_ACTION_TYPE_TAG; + actions_pre++; + memcpy(actions_pre, actions, + sizeof(struct rte_flow_action)); + actions_pre++; + break; case RTE_FLOW_ACTION_TYPE_VXLAN_DECAP: case RTE_FLOW_ACTION_TYPE_NVGRE_DECAP: memcpy(actions_pre, actions, @@ -3540,6 +3544,7 @@ flow_meter_split_prep(struct rte_eth_dev *dev, */ tag_id = flow_qrss_get_id(dev); set_tag->data = rte_cpu_to_be_32(tag_id); + assert(tag_action); tag_action->conf = set_tag; return tag_id; } -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-17 17:00:16.139870279 +0000 +++ 0029-net-mlx5-fix-meter-header-modify-before-decap.patch 2020-02-17 17:00:15.347951022 +0000 @@ -1,8 +1,10 @@ -From 431f199883e5b7eeea87a2f9f0272daf3354c1da Mon Sep 17 00:00:00 2001 +From e32739c056ce736ff67511b964181229e6a86d75 Mon Sep 17 00:00:00 2001 From: Suanming Mou Date: Thu, 6 Feb 2020 06:14:25 +0200 Subject: [PATCH] net/mlx5: fix meter header modify before decap +[ upstream commit 431f199883e5b7eeea87a2f9f0272daf3354c1da ] + The meter flows are split into three subflows each, the prefix subflow with meter action color the packet, the meter subflow filters out the colored packets, the suffix subflow applies all the remaining actions @@ -20,7 +22,6 @@ do the tag and meter to fix that issue. Fixes: 9ea9b049a960 ("net/mlx5: split meter flow") -Cc: stable@dpdk.org Reported-by: Tonghao Zhang Signed-off-by: Suanming Mou @@ -31,10 +32,10 @@ 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c -index e05d7994e2..25482010d8 100644 +index 45df610a91..07979a09cb 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c -@@ -3476,21 +3476,25 @@ flow_meter_split_prep(struct rte_eth_dev *dev, +@@ -3471,21 +3471,25 @@ flow_meter_split_prep(struct rte_eth_dev *dev, struct rte_flow_action actions_sfx[], struct rte_flow_action actions_pre[]) { @@ -65,10 +66,10 @@ case RTE_FLOW_ACTION_TYPE_VXLAN_DECAP: case RTE_FLOW_ACTION_TYPE_NVGRE_DECAP: memcpy(actions_pre, actions, -@@ -3545,6 +3549,7 @@ flow_meter_split_prep(struct rte_eth_dev *dev, +@@ -3540,6 +3544,7 @@ flow_meter_split_prep(struct rte_eth_dev *dev, */ tag_id = flow_qrss_get_id(dev); - set_tag->data = tag_id << MLX5_MTR_COLOR_BITS; + set_tag->data = rte_cpu_to_be_32(tag_id); + assert(tag_action); tag_action->conf = set_tag; return tag_id;