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 941BBA0350; Sun, 28 Jun 2020 11:36:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B293B1C1BE; Sun, 28 Jun 2020 11:36:41 +0200 (CEST) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id 307A91C1B1; Sun, 28 Jun 2020 11:36:40 +0200 (CEST) From: Shy Shyman To: dev@dpdk.org Cc: matan@mellanox.com, viacheslavo@mellanox.com, stable@dpdk.org Date: Sun, 28 Jun 2020 12:36:31 +0300 Message-Id: <20200628093631.56672-1-shys@mellanox.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] net/mlx5: fix flow META item validation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" When flow is inserted with meta match item it requires a certain register support. As part of the flow validation of such flows, the validation function is missing a check that the mlx5 driver is not in legacy mode in terms of extended meta data support (MLX5_XMETA_MODE_LEGACY flag). If the driver is in legacy mode it will cause downstream function that allocates needed register for meta data. The fix checks explicitly the conditions for support of meta data in FDB mode. if the conditions are not met an error message will be issued. Fixes: 9bf26e1318 ("ethdev: move egress metadata to dynamic field") Cc: viacheslavo@mellanox.com Cc: stable@dpdk.org Signed-off-by: Shy Shyman --- drivers/net/mlx5/mlx5_flow_dv.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 6318bd99cd..e037643c98 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -1479,6 +1479,13 @@ flow_dv_validate_item_meta(struct rte_eth_dev *dev __rte_unused, "isn't supported"); if (reg != REG_A) nic_mask.data = priv->sh->dv_meta_mask; + } else if (attr->transfer) { + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ITEM, item, + "extended metadata feature " + "should be enabled when " + "meta item is requested " + "with e-switch mode "); } if (!mask) mask = &rte_flow_item_meta_mask; -- 2.21.0