Skip to contentSkip to conversation

regexdev: add maximum number of mbuf segments field

RFC In review Gerry Gribbon 2 participants 2 messages Jul 26, 2022

lore
Share & tools
lore
#0 lore raw

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.

---
 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
index 89495301ac..98fe95b781 100644
@@ -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
index ed3af15e40..35a4cfb7ac 100644
@@ -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
index 3bce8090f6..7d2e1ee1d0 100644
@@ -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
#1 lore raw

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
index 3bce8090f6..7d2e1ee1d0 100644
@@ -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.