regex/mlx5: add check for nb max matches
PATCH 1/1 regex/mlx5: add check for nb max matches
Added check so user gets error if they try to configure the nb_max_matches value when using rte_regexdev_configure().
Signed-off-by Gerry Gribbon <[email protected]>
Acked-by Ori Kam <[email protected]>
--- drivers/regex/mlx5/mlx5_rxp.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/regex/mlx5/mlx5_rxp.c +5 -0
@@ -144,6 +144,11 @@ mlx5_regex_configure(struct rte_regexdev *dev,if (priv->prog_mode ==MLX5_RXP_MODE_NOT_DEFINED )return -1 ; +if (cfg->nb_max_matches !=MLX5_REGEX_MAX_MATCHES ) { +DRV_LOG (ERR ,"nb_max_matches is not configurable." ); + rte_errno =EINVAL ; +return -rte_errno; + } priv->nb_queues = cfg->nb_queue_pairs; dev->data->dev_conf.nb_queue_pairs = priv->nb_queues; priv->qps = rte_zmalloc(NULL, sizeof(struct mlx5_regex_qp) *
Signature · 1 line
2.25.1
Thomas Monjalon
Applied01/09/2022 10:28, Gerry Gribbon:
Quoted 5 lines
Added check so user gets error if they try to configure the
nb_max_matchesvalue when usingrte_regexdev_configure().Signed-off-by Gerry Gribbon <[email protected]>Acked-by Ori Kam <[email protected]>
Applied, thanks.
Note the more explicit title on merge:
regex/mlx5: forbid changing maximum match number