From: Shy Shyman Date: Sun, 28 Jun 2020 09:36:31 +0000 (+0300) Subject: net/mlx5: fix flow META item validation X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5f3541724e0812e23532fa7e9e89254b3e0c87c6;p=dpdk.git net/mlx5: fix flow META item validation 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: 9bf26e1318e3 ("ethdev: move egress metadata to dynamic field") Cc: stable@dpdk.org Signed-off-by: Shy Shyman Acked-by: Matan Azrad --- diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 0bd1c99e67..8b5b6838fa 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -1483,6 +1483,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;