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

Function rte_vhost_crypto_free

dpdk/lib/vhost/vhost_crypto.c:1466–1493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1464}
1465
1466int
1467rte_vhost_crypto_free(int vid)
1468{
1469 struct virtio_net *dev = get_device(vid);
1470 struct vhost_crypto *vcrypto;
1471
1472 if (unlikely(dev == NULL)) {
1473 VC_LOG_ERR("Invalid vid %i", vid);
1474 return -EINVAL;
1475 }
1476
1477 vcrypto = dev->extern_data;
1478 if (unlikely(vcrypto == NULL)) {
1479 VC_LOG_ERR("Cannot find required data, is it initialized?");
1480 return -ENOENT;
1481 }
1482
1483 rte_hash_free(vcrypto->session_map);
1484 rte_mempool_free(vcrypto->mbuf_pool);
1485 rte_mempool_free(vcrypto->wb_pool);
1486 rte_free(vcrypto);
1487
1488 dev->extern_data = NULL;
1489 dev->extern_ops.pre_msg_handle = NULL;
1490 dev->extern_ops.post_msg_handle = NULL;
1491
1492 return 0;
1493}
1494
1495int
1496rte_vhost_crypto_set_zero_copy(int vid, enum rte_vhost_crypto_zero_copy option)

Callers 1

destroy_deviceFunction · 0.85

Calls 4

get_deviceFunction · 0.85
rte_hash_freeFunction · 0.85
rte_mempool_freeFunction · 0.85
rte_freeFunction · 0.85

Tested by

no test coverage detected