Lines Matching refs:node
60 acl_dfa_gen_idx(const struct rte_acl_node *node, uint32_t index) in acl_dfa_gen_idx() argument
66 for (i = 0; i != RTE_DIM(node->dfa_gr64); i++) { in acl_dfa_gen_idx()
67 RTE_ACL_VERIFY(node->dfa_gr64[i] < RTE_ACL_DFA_GR64_NUM); in acl_dfa_gen_idx()
68 RTE_ACL_VERIFY(node->dfa_gr64[i] < node->fanout); in acl_dfa_gen_idx()
69 idx |= (i - node->dfa_gr64[i]) << in acl_dfa_gen_idx()
73 return idx << (CHAR_BIT * sizeof(index)) | index | node->node_type; in acl_dfa_gen_idx()
77 acl_dfa_fill_gr64(const struct rte_acl_node *node, in acl_dfa_fill_gr64() argument
82 for (i = 0; i != RTE_DIM(node->dfa_gr64); i++) { in acl_dfa_fill_gr64()
83 memcpy(dst + node->dfa_gr64[i] * RTE_ACL_DFA_GR64_SIZE, in acl_dfa_fill_gr64()
112 acl_node_fill_dfa(const struct rte_acl_node *node, in acl_node_fill_dfa() argument
126 for (x = 0; x < node->num_ptrs; x++) { in acl_node_fill_dfa()
128 child = node->ptrs[x].ptr; in acl_node_fill_dfa()
132 bits = &node->ptrs[x].values; in acl_node_fill_dfa()
196 acl_count_fanout(struct rte_acl_node *node) in acl_count_fanout() argument
201 if (node->fanout != 0) in acl_count_fanout()
202 return node->fanout; in acl_count_fanout()
204 ranges = acl_count_sequential_groups(&node->values, 0); in acl_count_fanout()
206 for (n = 0; n < node->num_ptrs; n++) { in acl_count_fanout()
207 if (node->ptrs[n].ptr != NULL) in acl_count_fanout()
209 &node->ptrs[n].values, 1); in acl_count_fanout()
212 node->fanout = ranges; in acl_count_fanout()
213 return node->fanout; in acl_count_fanout()
221 struct rte_acl_node *node, uint64_t no_match, int force_dfa) in acl_count_trie_types() argument
228 if (node->node_type != (uint32_t)RTE_ACL_NODE_UNDEFINED) in acl_count_trie_types()
231 if (node->match_flag != 0 || node->num_ptrs == 0) { in acl_count_trie_types()
233 node->node_type = RTE_ACL_NODE_MATCH; in acl_count_trie_types()
237 num_ptrs = acl_count_fanout(node); in acl_count_trie_types()
246 node->node_type = RTE_ACL_NODE_SINGLE; in acl_count_trie_types()
249 counts->quad_vectors += node->fanout; in acl_count_trie_types()
250 node->node_type = RTE_ACL_NODE_QRANGE; in acl_count_trie_types()
253 node->node_type = RTE_ACL_NODE_DFA; in acl_count_trie_types()
256 for (n = 0; n != RTE_DIM(node->dfa_gr64); n++) in acl_count_trie_types()
257 node->dfa_gr64[n] = n; in acl_count_trie_types()
258 node->fanout = n; in acl_count_trie_types()
260 acl_node_fill_dfa(node, dfa, no_match, 0); in acl_count_trie_types()
261 node->fanout = acl_dfa_count_gr64(dfa, node->dfa_gr64); in acl_count_trie_types()
263 counts->dfa_gr64 += node->fanout; in acl_count_trie_types()
269 for (n = 0; n < node->num_ptrs; n++) { in acl_count_trie_types()
270 if (node->ptrs[n].ptr != NULL) in acl_count_trie_types()
271 acl_count_trie_types(counts, node->ptrs[n].ptr, in acl_count_trie_types()
277 acl_add_ptrs(struct rte_acl_node *node, uint64_t *node_array, uint64_t no_match, in acl_add_ptrs() argument
284 acl_node_fill_dfa(node, dfa, no_match, resolved); in acl_add_ptrs()
291 if (node->node_type == RTE_ACL_NODE_QRANGE) { in acl_add_ptrs()
302 node->transitions[m++] = (uint8_t)(x - 1); in acl_add_ptrs()
310 node->transitions[m++] = (uint8_t)(x - 1); in acl_add_ptrs()
316 node->transitions[m] = INT8_MAX; in acl_add_ptrs()
320 } else if (node->node_type == RTE_ACL_NODE_DFA && resolved) { in acl_add_ptrs()
321 acl_dfa_fill_gr64(node, dfa, node_array); in acl_add_ptrs()
331 acl_gen_node(struct rte_acl_node *node, uint64_t *node_array, in acl_gen_node() argument
338 if (node->node_index != RTE_ACL_NODE_UNDEFINED) in acl_gen_node()
343 switch (node->node_type) { in acl_gen_node()
346 node->node_index = acl_dfa_gen_idx(node, index->dfa_index); in acl_gen_node()
347 sz = node->fanout * RTE_ACL_DFA_GR64_SIZE; in acl_gen_node()
353 node->node_index = RTE_ACL_QUAD_SINGLE | index->single_index | in acl_gen_node()
354 node->node_type; in acl_gen_node()
361 acl_add_ptrs(node, array_ptr, no_match, 0); in acl_gen_node()
362 qtrp = (uint32_t *)node->transitions; in acl_gen_node()
363 node->node_index = qtrp[0]; in acl_gen_node()
364 node->node_index <<= sizeof(index->quad_index) * CHAR_BIT; in acl_gen_node()
365 node->node_index |= index->quad_index | node->node_type; in acl_gen_node()
366 index->quad_index += node->fanout; in acl_gen_node()
373 memcpy(match + index->match_index, node->mrt, in acl_gen_node()
374 sizeof(*node->mrt)); in acl_gen_node()
375 node->node_index = index->match_index | node->node_type; in acl_gen_node()
379 RTE_ACL_VERIFY(node->node_type != in acl_gen_node()
385 for (n = 0; n < node->num_ptrs; n++) { in acl_gen_node()
386 if (node->ptrs[n].ptr != NULL) in acl_gen_node()
387 acl_gen_node(node->ptrs[n].ptr, in acl_gen_node()
395 switch (node->node_type) { in acl_gen_node()
397 acl_add_ptrs(node, array_ptr, no_match, 1); in acl_gen_node()
400 for (n = 0; n < node->num_ptrs; n++) { in acl_gen_node()
401 if (node->ptrs[n].ptr != NULL) in acl_gen_node()
402 array_ptr[0] = node->ptrs[n].ptr->node_index; in acl_gen_node()
406 acl_add_ptrs(node, array_ptr, no_match, 1); in acl_gen_node()
411 RTE_ACL_VERIFY(node->node_type != in acl_gen_node()