MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_compressdev_start

Function rte_compressdev_start

dpdk/lib/compressdev/rte_compressdev.c:451–482  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449}
450
451int
452rte_compressdev_start(uint8_t dev_id)
453{
454 struct rte_compressdev *dev;
455 int diag;
456
457 COMPRESSDEV_LOG(DEBUG, "Start dev_id=%" PRIu8, dev_id);
458
459 if (!rte_compressdev_is_valid_dev(dev_id)) {
460 COMPRESSDEV_LOG(ERR, "Invalid dev_id=%" PRIu8, dev_id);
461 return -EINVAL;
462 }
463
464 dev = &rte_comp_devices[dev_id];
465
466 if (*dev->dev_ops->dev_start == NULL)
467 return -ENOTSUP;
468
469 if (dev->data->dev_started != 0) {
470 COMPRESSDEV_LOG(ERR,
471 "Device with dev_id=%" PRIu8 " already started", dev_id);
472 return 0;
473 }
474
475 diag = (*dev->dev_ops->dev_start)(dev);
476 if (diag == 0)
477 dev->data->dev_started = 1;
478 else
479 return diag;
480
481 return 0;
482}
483
484void
485rte_compressdev_stop(uint8_t dev_id)

Callers 2

generic_ut_setupFunction · 0.85

Calls 1

Tested by 1

generic_ut_setupFunction · 0.68