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 B43FE454E9 for ; Tue, 25 Jun 2024 02:03:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF7C3427A3; Tue, 25 Jun 2024 02:03:08 +0200 (CEST) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mails.dpdk.org (Postfix) with ESMTP id 7D27442795 for ; Tue, 25 Jun 2024 02:03:07 +0200 (CEST) Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-366f747705dso893129f8f.2 for ; Mon, 24 Jun 2024 17:03:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719273787; x=1719878587; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/KNjh+7Z1UzRxZ2ZnixwpqlFbm1y3cM/Oos9oS3LNlw=; b=mvd/wbk/kt2S1wHtqLSXfnu7BqZqRrUVe5LYWYMDCcUYXDcBV4/x9rx5H+/HCk1PND bkU2zqiCie8Fjs84uBseYqd/PIDQZE3CO7+mzjxUG5qCsOm4p/15XgNNQlavm7emxr74 LNjlm+FeQc043P4xgXdaD2+7D1ChhoaiSx5aN7l3jS9385jQascZPDIop57OIj0+RkSo VXDHu2myHEx/ZjPKesdPLuIPbUMqEyNrdieQhfymXrDYyYsvPzDCYlgkjAb5+9yFRWBj Hx85Hp6m+6UPzNCjyPJURzIqaUax18yD5pG5vMb3OsGdG8EhWsWB4tkPyafTA/BaBPXs DU/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719273787; x=1719878587; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/KNjh+7Z1UzRxZ2ZnixwpqlFbm1y3cM/Oos9oS3LNlw=; b=hIUPchg1htbM4podyNPTRSG8xLb3DkGqv7pzYsL7HZunQpDUQUpiG/SaCwzKbRB5NU Xs3DX1NJF9cs/00sbXUVjg6cORDfR9gVuaaRuJktJBqN/n+MJJlklwYJbKHiLSUgLc/h Af//ojN6CKMhT6C+Ut/3BB0/MKGVOqZR07LGxevDyXwZTO3FVpSWVzPBvUomRNzVPm45 ytq77kKa5xWD/Vo600on5cQjf0bJgwVP2Gkck8F28HcRKQk15vtzfuDPvgnt9HJfeqeo sr5F8fSf89mm340xZ0lLfWSV7hXBRrcaCvvrlACzol4jHem8NZFdhb08AUHHFVf8m2Te 0ijQ== X-Forwarded-Encrypted: i=1; AJvYcCUJSOkr006gn23t3qwib0YSGX8Zzey+fo8/SkS+o2nWQHrdoYY7TETZzZV19XMLCDbhvJXyeqPEU0+XaAp5TZs= X-Gm-Message-State: AOJu0YwbQS3XZMUfpIvEQ46Tl7w5afMtC/Qmq9luk1kE1E61XDoVbcn/ 9VMvZgSliI0C6kqikzioa5kztJMZAsoktU+0DwoHmHa87COU8687GPDeTKtU X-Google-Smtp-Source: AGHT+IFQcSdYhP5jMtLpJluG2ztHON5Fy45M+j2BXBVPX6yJpZwrHA8kOEO6H+0KEH8HcQS/47nr/w== X-Received: by 2002:a5d:5109:0:b0:363:92e7:bb3 with SMTP id ffacd0b85a97d-366e9492ce1mr3863966f8f.23.1719273787097; Mon, 24 Jun 2024 17:03:07 -0700 (PDT) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4247d0c5485sm189609905e9.21.2024.06.24.17.03.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jun 2024 17:03:06 -0700 (PDT) From: luca.boccassi@gmail.com To: Maayan Kashani Cc: Suanming Mou , dpdk stable Subject: patch 'net/mlx5: fix flow template indirect action failure' has been queued to stable release 22.11.6 Date: Tue, 25 Jun 2024 00:58:59 +0100 Message-Id: <20240624235907.885628-73-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240624235907.885628-1-luca.boccassi@gmail.com> References: <20240624235907.885628-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 22.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/27/24. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/42e1eb6a45859dbc9b51f80ef7344747dfbaef78 Thanks. Luca Boccassi --- >From 42e1eb6a45859dbc9b51f80ef7344747dfbaef78 Mon Sep 17 00:00:00 2001 From: Maayan Kashani Date: Sun, 26 May 2024 16:22:44 +0300 Subject: [PATCH] net/mlx5: fix flow template indirect action failure [ upstream commit b79ac509105a2cf9fce1734a6798632a0414cd1c ] For indirect action type, on error case the function jumped to err but returned zero cause rte_errno was not initialized before the jump. It caused no error in table creation. In case reaching an error, if rte_errno is not initialized, it will be set to EINVAL. Now table creation should fail if the translate of the action fails. Added driver log warnings so it can be easy to track failure on shared actions translate. Fixes: 7ab3962d2d2b ("net/mlx5: add indirect HW steering action") Signed-off-by: Maayan Kashani Acked-by: Suanming Mou --- drivers/net/mlx5/mlx5_flow_hw.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index fd3e51bf0d..5333495a59 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -769,15 +769,19 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev, if (!shared_rss || __flow_hw_act_data_shared_rss_append (priv, acts, (enum rte_flow_action_type)MLX5_RTE_FLOW_ACTION_TYPE_RSS, - action_src, action_dst, idx, shared_rss)) + action_src, action_dst, idx, shared_rss)) { + DRV_LOG(WARNING, "Indirect RSS action index %d translate failed", act_idx); return -1; + } break; case MLX5_INDIRECT_ACTION_TYPE_COUNT: if (__flow_hw_act_data_shared_cnt_append(priv, acts, (enum rte_flow_action_type) MLX5_RTE_FLOW_ACTION_TYPE_COUNT, - action_src, action_dst, act_idx)) + action_src, action_dst, act_idx)) { + DRV_LOG(WARNING, "Indirect count action translate failed"); return -1; + } break; case MLX5_INDIRECT_ACTION_TYPE_AGE: /* Not supported, prevent by validate function. */ @@ -785,15 +789,19 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev, break; case MLX5_INDIRECT_ACTION_TYPE_CT: if (flow_hw_ct_compile(dev, MLX5_HW_INV_QUEUE, - idx, &acts->rule_acts[action_dst])) + idx, &acts->rule_acts[action_dst])) { + DRV_LOG(WARNING, "Indirect CT action translate failed"); return -1; + } break; case MLX5_INDIRECT_ACTION_TYPE_METER_MARK: if (__flow_hw_act_data_shared_mtr_append(priv, acts, (enum rte_flow_action_type) MLX5_RTE_FLOW_ACTION_TYPE_METER_MARK, - action_src, action_dst, idx)) + action_src, action_dst, idx)) { + DRV_LOG(WARNING, "Indirect meter mark action translate failed"); return -1; + } break; default: DRV_LOG(WARNING, "Unsupported shared action type:%d", type); @@ -1758,6 +1766,9 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev, } return 0; err: + /* If rte_errno was not initialized and reached error state. */ + if (!rte_errno) + rte_errno = EINVAL; err = rte_errno; __flow_hw_action_template_destroy(dev, acts); return rte_flow_error_set(error, err, -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-06-25 00:22:17.314201284 +0100 +++ 0073-net-mlx5-fix-flow-template-indirect-action-failure.patch 2024-06-25 00:22:13.265187280 +0100 @@ -1 +1 @@ -From b79ac509105a2cf9fce1734a6798632a0414cd1c Mon Sep 17 00:00:00 2001 +From 42e1eb6a45859dbc9b51f80ef7344747dfbaef78 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit b79ac509105a2cf9fce1734a6798632a0414cd1c ] + @@ -17 +18,0 @@ -Cc: stable@dpdk.org @@ -26 +27 @@ -index d9140dbf23..463f7b87a3 100644 +index fd3e51bf0d..5333495a59 100644 @@ -29 +30 @@ -@@ -1106,15 +1106,19 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev, +@@ -769,15 +769,19 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev, @@ -51 +52 @@ -@@ -1122,15 +1126,19 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev, +@@ -785,15 +789,19 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev, @@ -71,3 +72,3 @@ - case MLX5_INDIRECT_ACTION_TYPE_QUOTA: - flow_hw_construct_quota(priv, &acts->rule_acts[action_dst], idx); -@@ -2645,6 +2653,9 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev, + default: + DRV_LOG(WARNING, "Unsupported shared action type:%d", type); +@@ -1758,6 +1766,9 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,