| 115 | } |
| 116 | |
| 117 | static int |
| 118 | udp4_input_node_init(const struct rte_graph *graph, struct rte_node *node) |
| 119 | { |
| 120 | uint16_t socket, lcore_id; |
| 121 | static uint8_t init_once; |
| 122 | int rc; |
| 123 | |
| 124 | RTE_SET_USED(graph); |
| 125 | RTE_BUILD_BUG_ON(sizeof(struct udp4_input_node_ctx) > RTE_NODE_CTX_SZ); |
| 126 | |
| 127 | if (!init_once) { |
| 128 | |
| 129 | /* Setup HASH tables for all sockets */ |
| 130 | RTE_LCORE_FOREACH(lcore_id) |
| 131 | { |
| 132 | socket = rte_lcore_to_socket_id(lcore_id); |
| 133 | rc = setup_udp4_dstprt_hash(&udp4_input_nm, socket); |
| 134 | if (rc) { |
| 135 | node_err("udp4_lookup", |
| 136 | "Failed to setup hash tbl for sock %u, rc=%d", |
| 137 | socket, rc); |
| 138 | return rc; |
| 139 | } |
| 140 | } |
| 141 | init_once = 1; |
| 142 | } |
| 143 | |
| 144 | UDP4_INPUT_NODE_HASH(node->ctx) = udp4_input_nm.hash_tbl[graph->socket]; |
| 145 | |
| 146 | node_dbg("udp4_input", "Initialized udp4_input node"); |
| 147 | return 0; |
| 148 | } |
| 149 | |
| 150 | static uint16_t |
| 151 | udp4_input_node_process_scalar(struct rte_graph *graph, struct rte_node *node, |
nothing calls this directly
no test coverage detected