regex/mlx5: support info query
[dpdk.git] / drivers / regex / mlx5 / mlx5_rxp.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2020 Mellanox Technologies, Ltd
3  */
4
5 #include <rte_log.h>
6 #include <rte_errno.h>
7 #include <rte_regexdev.h>
8 #include <rte_regexdev_core.h>
9 #include <rte_regexdev_driver.h>
10
11 #include "mlx5_regex.h"
12
13 #define MLX5_REGEX_MAX_MATCHES 255
14 #define MLX5_REGEX_MAX_PAYLOAD_SIZE UINT16_MAX
15 #define MLX5_REGEX_MAX_RULES_PER_GROUP UINT16_MAX
16 #define MLX5_REGEX_MAX_GROUPS UINT16_MAX
17
18 int
19 mlx5_regex_info_get(struct rte_regexdev *dev __rte_unused,
20                     struct rte_regexdev_info *info)
21 {
22         info->max_matches = MLX5_REGEX_MAX_MATCHES;
23         info->max_payload_size = MLX5_REGEX_MAX_PAYLOAD_SIZE;
24         info->max_rules_per_group = MLX5_REGEX_MAX_RULES_PER_GROUP;
25         info->max_groups = MLX5_REGEX_MAX_GROUPS;
26         info->regexdev_capa = RTE_REGEXDEV_SUPP_PCRE_GREEDY_F;
27         info->rule_flags = 0;
28         return 0;
29 }