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

Function rte_ml_dev_start

dpdk/lib/mldev/rte_mldev.c:314–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312}
313
314int
315rte_ml_dev_start(int16_t dev_id)
316{
317 struct rte_ml_dev *dev;
318 int ret;
319
320 if (!rte_ml_dev_is_valid_dev(dev_id)) {
321 RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
322 return -EINVAL;
323 }
324
325 dev = rte_ml_dev_pmd_get_dev(dev_id);
326 if (*dev->dev_ops->dev_start == NULL)
327 return -ENOTSUP;
328
329 if (dev->data->dev_started != 0) {
330 RTE_MLDEV_LOG(ERR, "Device %d is already started", dev_id);
331 return -EBUSY;
332 }
333
334 ret = (*dev->dev_ops->dev_start)(dev);
335 if (ret == 0)
336 dev->data->dev_started = 1;
337
338 return ret;
339}
340
341int
342rte_ml_dev_stop(int16_t dev_id)

Callers 1

ml_test_device_startFunction · 0.85

Calls 2

rte_ml_dev_is_valid_devFunction · 0.85
rte_ml_dev_pmd_get_devFunction · 0.85

Tested by 1

ml_test_device_startFunction · 0.68