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

Function rte_cryptodev_close

dpdk/lib/cryptodev/rte_cryptodev.c:1336–1376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1334}
1335
1336int
1337rte_cryptodev_close(uint8_t dev_id)
1338{
1339 struct rte_cryptodev *dev;
1340 int retval;
1341
1342 if (!rte_cryptodev_is_valid_dev(dev_id)) {
1343 CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
1344 return -1;
1345 }
1346
1347 dev = &rte_crypto_devices[dev_id];
1348
1349 /* Device must be stopped before it can be closed */
1350 if (dev->data->dev_started == 1) {
1351 CDEV_LOG_ERR("Device %u must be stopped before closing",
1352 dev_id);
1353 return -EBUSY;
1354 }
1355
1356 /* We can't close the device if there are outstanding sessions in use */
1357 if (dev->data->session_pool != NULL) {
1358 if (!rte_mempool_full(dev->data->session_pool)) {
1359 CDEV_LOG_ERR("dev_id=%u close failed, session mempool "
1360 "has sessions still in use, free "
1361 "all sessions before calling close",
1362 (unsigned)dev_id);
1363 return -EBUSY;
1364 }
1365 }
1366
1367 if (*dev->dev_ops->dev_close == NULL)
1368 return -ENOTSUP;
1369 retval = (*dev->dev_ops->dev_close)(dev);
1370 rte_cryptodev_trace_close(dev_id, retval);
1371
1372 if (retval < 0)
1373 return retval;
1374
1375 return 0;
1376}
1377
1378int
1379rte_cryptodev_get_qp_status(uint8_t dev_id, uint16_t queue_pair_id)

Callers 9

mainFunction · 0.85
testsuite_teardownFunction · 0.85
perf_cryptodev_setupFunction · 0.85
perf_cryptodev_destroyFunction · 0.85
cryptodev_finiFunction · 0.85
mainFunction · 0.85

Calls 2

rte_mempool_fullFunction · 0.85

Tested by 4

testsuite_teardownFunction · 0.68
perf_cryptodev_setupFunction · 0.68
perf_cryptodev_destroyFunction · 0.68
cryptodev_finiFunction · 0.68