1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 2014-2023 Broadcom 3 * All rights reserved. 4 */ 5 6 #ifndef ULP_MATCHER_H_ 7 #define ULP_MATCHER_H_ 8 9 #include <rte_log.h> 10 #include <rte_hash.h> 11 #include "bnxt.h" 12 #include "ulp_template_db_enum.h" 13 #include "ulp_template_struct.h" 14 #include "bnxt_tf_common.h" 15 16 #define BNXT_ULP_ACT_HASH_LIST_SIZE 1024 17 18 struct ulp_matcher_hash_db_key { 19 struct ulp_rte_hdr_bitmap hdr_bitmap; 20 uint8_t app_id; 21 }; 22 23 struct ulp_matcher_class_db_node { 24 uint8_t in_use; 25 uint16_t match_info_idx; 26 }; 27 28 struct ulp_matcher_action_hash_db_key { 29 struct ulp_rte_act_bitmap act_bitmap; 30 }; 31 32 struct ulp_matcher_act_db_node { 33 uint16_t act_tmpl_idx; 34 }; 35 36 struct bnxt_ulp_matcher_data { 37 struct rte_hash *class_matcher_db; 38 uint16_t class_list_size; 39 struct ulp_matcher_class_db_node *class_list; 40 struct rte_hash *action_matcher_db; 41 struct ulp_matcher_act_db_node *act_list; 42 }; 43 44 int32_t 45 ulp_matcher_pattern_match(struct ulp_rte_parser_params *params, 46 uint32_t *class_id); 47 48 int32_t 49 ulp_matcher_action_match(struct ulp_rte_parser_params *params, 50 uint32_t *act_id); 51 52 int32_t ulp_matcher_init(struct bnxt_ulp_context *ulp_ctx); 53 54 void ulp_matcher_deinit(struct bnxt_ulp_context *ulp_ctx); 55 56 #endif /* ULP_MATCHER_H_ */ 57