* [PATCH] net/mlx5: fix error notification for large patterns
@ 2025-05-06 13:31 Gregory Etelson
0 siblings, 0 replies; only message in thread
From: Gregory Etelson @ 2025-05-06 13:31 UTC (permalink / raw)
To: dev
Cc: getelson, ,
rasland, Dariusz Sosnowski, Viacheslav Ovsiienko, Bing Zhao,
Ori Kam, Suanming Mou, Matan Azrad
HWS has limited resources to translate flow pattern.
When pattern translation does not fit STE, HWS translation fails with
E2BIG error.
The patch verifies that the E2BIG error value is kept during flow
error notification.
Fixes: e38776c36c8a ("net/mlx5: introduce HWS for non-template flow API")
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
drivers/net/mlx5/hws/mlx5dr_bwc.c | 2 +-
drivers/net/mlx5/mlx5_flow_hw.c | 8 ++++++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/mlx5/hws/mlx5dr_bwc.c b/drivers/net/mlx5/hws/mlx5dr_bwc.c
index 9233452118..0086cd2c90 100644
--- a/drivers/net/mlx5/hws/mlx5dr_bwc.c
+++ b/drivers/net/mlx5/hws/mlx5dr_bwc.c
@@ -137,7 +137,7 @@ mlx5dr_bwc_matcher_create(struct mlx5dr_table *table,
bwc_matcher->num_of_at,
&attr);
if (!bwc_matcher->matcher) {
- rte_errno = EINVAL;
+ /* rte_errno must be set */
goto free_at;
}
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 20d38ce414..b79e629d52 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -13894,7 +13894,7 @@ static int flow_hw_register_matcher(struct rte_eth_dev *dev,
if (sub_error.type != RTE_FLOW_ERROR_TYPE_NONE)
rte_memcpy(error, &sub_error, sizeof(sub_error));
}
- return rte_flow_error_set(error, ENOMEM,
+ return rte_flow_error_set(error, rte_errno,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
NULL, "fail to register matcher");
}
@@ -14070,8 +14070,12 @@ flow_hw_create_flow(struct rte_eth_dev *dev, enum mlx5_flow_type type,
goto error;
}
ret = flow_hw_register_matcher(dev, attr, items, external, *flow, &matcher, error);
- if (ret)
+ if (ret) {
+ if (rte_errno == E2BIG)
+ rte_flow_error_set(error, E2BIG, RTE_FLOW_ERROR_TYPE_ITEM, NULL,
+ "flow pattern is too big");
goto error;
+ }
/*
* ASO allocation – iterating on actions list to allocate missing resources.
--
2.48.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-05-06 13:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-06 13:31 [PATCH] net/mlx5: fix error notification for large patterns Gregory Etelson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).