Lines Matching refs:node
61 acl_dfa_gen_idx(const struct rte_acl_node *node, uint32_t index) in acl_dfa_gen_idx() argument
67 for (i = 0; i != RTE_DIM(node->dfa_gr64); i++) { in acl_dfa_gen_idx()
68 RTE_ACL_VERIFY(node->dfa_gr64[i] < RTE_ACL_DFA_GR64_NUM); in acl_dfa_gen_idx()
69 RTE_ACL_VERIFY(node->dfa_gr64[i] < node->fanout); in acl_dfa_gen_idx()
70 idx |= (i - node->dfa_gr64[i]) << in acl_dfa_gen_idx()
74 return idx << (CHAR_BIT * sizeof(index)) | index | node->node_type; in acl_dfa_gen_idx()
78 acl_dfa_fill_gr64(const struct rte_acl_node *node, in acl_dfa_fill_gr64() argument
83 for (i = 0; i != RTE_DIM(node->dfa_gr64); i++) { in acl_dfa_fill_gr64()
84 memcpy(dst + node->dfa_gr64[i] * RTE_ACL_DFA_GR64_SIZE, in acl_dfa_fill_gr64()
113 acl_node_fill_dfa(const struct rte_acl_node *node, in acl_node_fill_dfa() argument
127 for (x = 0; x < node->num_ptrs; x++) { in acl_node_fill_dfa()
129 child = node->ptrs[x].ptr; in acl_node_fill_dfa()
133 bits = &node->ptrs[x].values; in acl_node_fill_dfa()
197 acl_count_fanout(struct rte_acl_node *node) in acl_count_fanout() argument
202 if (node->fanout != 0) in acl_count_fanout()
203 return node->fanout; in acl_count_fanout()
205 ranges = acl_count_sequential_groups(&node->values, 0); in acl_count_fanout()
207 for (n = 0; n < node->num_ptrs; n++) { in acl_count_fanout()
208 if (node->ptrs[n].ptr != NULL) in acl_count_fanout()
210 &node->ptrs[n].values, 1); in acl_count_fanout()
213 node->fanout = ranges; in acl_count_fanout()
214 return node->fanout; in acl_count_fanout()
222 struct rte_acl_node *node, uint64_t no_match, int force_dfa) in acl_count_trie_types() argument
229 if (node->node_type != (uint32_t)RTE_ACL_NODE_UNDEFINED) in acl_count_trie_types()
232 if (node->match_flag != 0 || node->num_ptrs == 0) { in acl_count_trie_types()
234 node->node_type = RTE_ACL_NODE_MATCH; in acl_count_trie_types()
238 num_ptrs = acl_count_fanout(node); in acl_count_trie_types()
247 node->node_type = RTE_ACL_NODE_SINGLE; in acl_count_trie_types()
250 counts->quad_vectors += node->fanout; in acl_count_trie_types()
251 node->node_type = RTE_ACL_NODE_QRANGE; in acl_count_trie_types()
254 node->node_type = RTE_ACL_NODE_DFA; in acl_count_trie_types()
257 for (n = 0; n != RTE_DIM(node->dfa_gr64); n++) in acl_count_trie_types()
258 node->dfa_gr64[n] = n; in acl_count_trie_types()
259 node->fanout = n; in acl_count_trie_types()
261 acl_node_fill_dfa(node, dfa, no_match, 0); in acl_count_trie_types()
262 node->fanout = acl_dfa_count_gr64(dfa, node->dfa_gr64); in acl_count_trie_types()
264 counts->dfa_gr64 += node->fanout; in acl_count_trie_types()
270 for (n = 0; n < node->num_ptrs; n++) { in acl_count_trie_types()
271 if (node->ptrs[n].ptr != NULL) in acl_count_trie_types()
272 acl_count_trie_types(counts, node->ptrs[n].ptr, in acl_count_trie_types()
278 acl_add_ptrs(struct rte_acl_node *node, uint64_t *node_array, uint64_t no_match, in acl_add_ptrs() argument
285 acl_node_fill_dfa(node, dfa, no_match, resolved); in acl_add_ptrs()
292 if (node->node_type == RTE_ACL_NODE_QRANGE) { in acl_add_ptrs()
303 node->transitions[m++] = (uint8_t)(x - 1); in acl_add_ptrs()
311 node->transitions[m++] = (uint8_t)(x - 1); in acl_add_ptrs()
317 node->transitions[m] = INT8_MAX; in acl_add_ptrs()
321 } else if (node->node_type == RTE_ACL_NODE_DFA && resolved) { in acl_add_ptrs()
322 acl_dfa_fill_gr64(node, dfa, node_array); in acl_add_ptrs()
332 acl_gen_node(struct rte_acl_node *node, uint64_t *node_array, in acl_gen_node() argument
339 if (node->node_index != RTE_ACL_NODE_UNDEFINED) in acl_gen_node()
344 switch (node->node_type) { in acl_gen_node()
347 node->node_index = acl_dfa_gen_idx(node, index->dfa_index); in acl_gen_node()
348 sz = node->fanout * RTE_ACL_DFA_GR64_SIZE; in acl_gen_node()
354 node->node_index = RTE_ACL_QUAD_SINGLE | index->single_index | in acl_gen_node()
355 node->node_type; in acl_gen_node()
362 acl_add_ptrs(node, array_ptr, no_match, 0); in acl_gen_node()
363 qtrp = (uint32_t *)node->transitions; in acl_gen_node()
364 node->node_index = qtrp[0]; in acl_gen_node()
365 node->node_index <<= sizeof(index->quad_index) * CHAR_BIT; in acl_gen_node()
366 node->node_index |= index->quad_index | node->node_type; in acl_gen_node()
367 index->quad_index += node->fanout; in acl_gen_node()
374 memcpy(match + index->match_index, node->mrt, in acl_gen_node()
375 sizeof(*node->mrt)); in acl_gen_node()
376 node->node_index = index->match_index | node->node_type; in acl_gen_node()
380 RTE_ACL_VERIFY(node->node_type != in acl_gen_node()
386 for (n = 0; n < node->num_ptrs; n++) { in acl_gen_node()
387 if (node->ptrs[n].ptr != NULL) in acl_gen_node()
388 acl_gen_node(node->ptrs[n].ptr, in acl_gen_node()
396 switch (node->node_type) { in acl_gen_node()
398 acl_add_ptrs(node, array_ptr, no_match, 1); in acl_gen_node()
401 for (n = 0; n < node->num_ptrs; n++) { in acl_gen_node()
402 if (node->ptrs[n].ptr != NULL) in acl_gen_node()
403 array_ptr[0] = node->ptrs[n].ptr->node_index; in acl_gen_node()
407 acl_add_ptrs(node, array_ptr, no_match, 1); in acl_gen_node()
412 RTE_ACL_VERIFY(node->node_type != in acl_gen_node()