regexdev: add maximum number of mbuf segments field
RFC 1/1 regexdev: add maximum number of mbuf segments field
Allows application to query maximum number of mbuf segments that can be chained together.
Signed-off-by Gerry Gribbon <[email protected]>
--- drivers/regex/mlx5/mlx5_regex.h | 1 + drivers/regex/mlx5/mlx5_regex_fastpath.c | 43 ++++++++++++++++++++++++ drivers/regex/mlx5/mlx5_rxp.c | 1 + lib/regexdev/rte_regexdev.h | 2 ++ 4 files changed, 47 insertions(+)
drivers/regex/mlx5/mlx5_regex.h +1 -0
@@ -94,4 +94,5 @@ uint16_t mlx5_regexdev_dequeue(struct rte_regexdev *dev, uint16_t qp_id, struct rte_regex_ops **ops, uint16_t nb_ops);uint16_t mlx5_regexdev_enqueue_gga (struct rte_regexdev *dev,uint16_t qp_id,struct rte_regex_ops **ops,uint16_t nb_ops); +uint16_t mlx5_regexdev_max_segs_get (void );#endif /* MLX5_REGEX_H */
drivers/regex/mlx5/mlx5_regex_fastpath.c +43 -0
61 lines not on this page · raw message
drivers/regex/mlx5/mlx5_rxp.c +1 -0
@@ -45,6 +45,7 @@ mlx5_regex_info_get(struct rte_regexdev *dev __rte_unused,RTE_REGEXDEV_CAPA_QUEUE_PAIR_OOS_F ; info->rule_flags =0 ; info->max_queue_pairs =UINT16_MAX ; + info->max_num_mbuf_segs =mlx5_regexdev_max_segs_get ();return 0 ; }
lib/regexdev/rte_regexdev.h +2 -0
@@ -622,6 +622,8 @@ struct rte_regexdev_info {/**< Supported compiler rule flags. * @see RTE_REGEX_PCRE_RULE_*, struct rte_regexdev_rule::rule_flags */ +uint16_t max_num_mbuf_segs; +/**< Maximum number of mbuf segments that can be chained together. */ };/**
Signature · 1 line
2.25.1
lib/regexdev/rte_regexdev.h struct rte_regexdev_info { · line 629
Quoted 13 lines · On Tue, 26 Jul 2022 10:47:07 +0000 Gerry Gribbon <[email protected]> wrote:
lib/regexdev/rte_regexdev.h +2
-0@@ -622,6 +622,8 @@ struct rte_regexdev_info {/**< Supported compiler rule flags. * @see RTE_REGEX_PCRE_RULE_*, struct rte_regexdev_rule::rule_flags */ +uint16_t max_num_mbuf_segs; +/**< Maximum number of mbuf segments that can be chained together. */ };/**
Did you notice that that struct is sparse and there is already an existing hole that could be reused. This is going to be an API/ABI breakage already so reusing the hole will be ok.
Also, please update the release notes for this.