* Set up the DPDK rings which will be used to pass packets, via * pointers, between the multi-process server and node processes. * Each node needs one RX queue. */
| 169 | * Each node needs one RX queue. |
| 170 | */ |
| 171 | static int |
| 172 | init_shm_rings(void) |
| 173 | { |
| 174 | unsigned int i; |
| 175 | unsigned int socket_id; |
| 176 | const char *q_name; |
| 177 | const unsigned int ringsize = NODE_QUEUE_RINGSIZE; |
| 178 | |
| 179 | nodes = rte_malloc("node details", |
| 180 | sizeof(*nodes) * num_nodes, 0); |
| 181 | if (nodes == NULL) |
| 182 | rte_exit(EXIT_FAILURE, "Cannot allocate memory for " |
| 183 | "node program details\n"); |
| 184 | |
| 185 | for (i = 0; i < num_nodes; i++) { |
| 186 | /* Create an RX queue for each node */ |
| 187 | socket_id = rte_socket_id(); |
| 188 | q_name = get_rx_queue_name(i); |
| 189 | nodes[i].rx_q = rte_ring_create(q_name, |
| 190 | ringsize, socket_id, |
| 191 | RING_F_SP_ENQ | RING_F_SC_DEQ); |
| 192 | if (nodes[i].rx_q == NULL) |
| 193 | rte_exit(EXIT_FAILURE, "Cannot create rx ring queue " |
| 194 | "for node %u\n", i); |
| 195 | } |
| 196 | return 0; |
| 197 | } |
| 198 | |
| 199 | /* |
| 200 | * Create EFD table which will contain all the flows |
no test coverage detected