static struct graph_head graph_list = STAILQ_HEAD_INITIALIZER(graph_list);
static rte_spinlock_t graph_lock = RTE_SPINLOCK_INITIALIZER;
static rte_graph_t graph_id;
-int rte_graph_logtype;
#define GRAPH_ID_CHECK(id) ID_CHECK(id, graph_id)
node->realloc_count++;
}
+void __rte_noinline
+__rte_node_stream_alloc_size(struct rte_graph *graph, struct rte_node *node,
+ uint16_t req_size)
+{
+ uint16_t size = node->size;
+
+ RTE_VERIFY(size != UINT16_MAX);
+ /* Allocate double amount of size to avoid immediate realloc */
+ size = RTE_MIN(UINT16_MAX, RTE_MAX(RTE_GRAPH_BURST_SIZE, req_size * 2));
+ node->objs = rte_realloc_socket(node->objs, size * sizeof(void *),
+ RTE_CACHE_LINE_SIZE, graph->socket);
+ RTE_VERIFY(node->objs);
+ node->size = size;
+ node->realloc_count++;
+}
+
static int
graph_to_dot(FILE *f, struct graph *graph)
{
return graph_id;
}
-RTE_INIT(rte_graph_init_log)
-{
- rte_graph_logtype = rte_log_register("lib.graph");
- if (rte_graph_logtype >= 0)
- rte_log_set_level(rte_graph_logtype, RTE_LOG_INFO);
-}
+RTE_LOG_REGISTER(rte_graph_logtype, lib.graph, INFO);