| 294 | } |
| 295 | |
| 296 | static int |
| 297 | generic_ut_setup(void) |
| 298 | { |
| 299 | /* Configure compressdev (one device, one queue pair) */ |
| 300 | struct rte_compressdev_config config = { |
| 301 | .socket_id = rte_socket_id(), |
| 302 | .nb_queue_pairs = 1, |
| 303 | .max_nb_priv_xforms = NUM_MAX_XFORMS, |
| 304 | .max_nb_streams = 1 |
| 305 | }; |
| 306 | |
| 307 | if (rte_compressdev_configure(0, &config) < 0) { |
| 308 | RTE_LOG(ERR, USER1, "Device configuration failed\n"); |
| 309 | return -1; |
| 310 | } |
| 311 | |
| 312 | if (rte_compressdev_queue_pair_setup(0, 0, NUM_MAX_INFLIGHT_OPS, |
| 313 | rte_socket_id()) < 0) { |
| 314 | RTE_LOG(ERR, USER1, "Queue pair setup failed\n"); |
| 315 | return -1; |
| 316 | } |
| 317 | |
| 318 | if (rte_compressdev_start(0) < 0) { |
| 319 | RTE_LOG(ERR, USER1, "Device could not be started\n"); |
| 320 | return -1; |
| 321 | } |
| 322 | |
| 323 | return 0; |
| 324 | } |
| 325 | |
| 326 | static void |
| 327 | generic_ut_teardown(void) |
nothing calls this directly
no test coverage detected