MCPcopy Create free account
hub / github.com/F-Stack/f-stack / save_start_eval_state

Function save_start_eval_state

dpdk/lib/bpf/bpf_validate.c:2168–2185  ·  view source on GitHub ↗

* try to allocate and initialise new eval state for given node. * later if no errors will be encountered, this state will be accepted as * one of the possible 'safe' states for that node. */

Source from the content-addressed store, hash-verified

2166 * one of the possible 'safe' states for that node.
2167 */
2168static void
2169save_start_eval_state(struct bpf_verifier *bvf, struct inst_node *node)
2170{
2171 RTE_ASSERT(node->evst.start == NULL);
2172
2173 /* limit number of states for one node with some reasonable value */
2174 if (node->evst.nb_safe >= NODE_EVST_MAX)
2175 return;
2176
2177 /* try to get new eval_state */
2178 node->evst.start = pull_eval_state(&bvf->evst_tp_pool);
2179
2180 /* make a copy of current state */
2181 if (node->evst.start != NULL) {
2182 memcpy(node->evst.start, bvf->evst, sizeof(*node->evst.start));
2183 SLIST_NEXT(node->evst.start, next) = NULL;
2184 }
2185}
2186
2187/*
2188 * add @start state to the list of @safe states.

Callers 1

prune_eval_stateFunction · 0.85

Calls 2

pull_eval_stateFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected