| 215 | |
| 216 | |
| 217 | static int |
| 218 | setup_pipeline(int test_type) |
| 219 | { |
| 220 | int ret; |
| 221 | int i; |
| 222 | struct rte_pipeline_params pipeline_params = { |
| 223 | .name = "PIPELINE", |
| 224 | .socket_id = 0, |
| 225 | }; |
| 226 | |
| 227 | RTE_LOG(INFO, PIPELINE, "%s: **** Setting up %s test\n", |
| 228 | __func__, pipeline_test_names[test_type]); |
| 229 | |
| 230 | /* Pipeline configuration */ |
| 231 | p = rte_pipeline_create(&pipeline_params); |
| 232 | if (p == NULL) { |
| 233 | RTE_LOG(INFO, PIPELINE, "%s: Failed to configure pipeline\n", |
| 234 | __func__); |
| 235 | goto fail; |
| 236 | } |
| 237 | |
| 238 | ret = rte_pipeline_free(p); |
| 239 | if (ret != 0) { |
| 240 | RTE_LOG(INFO, PIPELINE, "%s: Failed to free pipeline\n", |
| 241 | __func__); |
| 242 | goto fail; |
| 243 | } |
| 244 | |
| 245 | /* Pipeline configuration */ |
| 246 | p = rte_pipeline_create(&pipeline_params); |
| 247 | if (p == NULL) { |
| 248 | RTE_LOG(INFO, PIPELINE, "%s: Failed to configure pipeline\n", |
| 249 | __func__); |
| 250 | goto fail; |
| 251 | } |
| 252 | |
| 253 | |
| 254 | /* Input port configuration */ |
| 255 | for (i = 0; i < N_PORTS; i++) { |
| 256 | struct rte_port_ring_reader_params port_ring_params = { |
| 257 | .ring = rings_rx[i], |
| 258 | }; |
| 259 | |
| 260 | struct rte_pipeline_port_in_params port_params = { |
| 261 | .ops = &rte_port_ring_reader_ops, |
| 262 | .arg_create = (void *) &port_ring_params, |
| 263 | .f_action = NULL, |
| 264 | .burst_size = BURST_SIZE, |
| 265 | }; |
| 266 | |
| 267 | /* Put in action for some ports */ |
| 268 | if (i) |
| 269 | port_params.f_action = NULL; |
| 270 | |
| 271 | ret = rte_pipeline_port_in_create(p, &port_params, |
| 272 | &port_in_id[i]); |
| 273 | if (ret) { |
| 274 | rte_panic("Unable to configure input port %d, ret:%d\n", |
no test coverage detected