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

Function vhost_crypto_close_sess

dpdk/lib/vhost/vhost_crypto.c:405–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403}
404
405static int
406vhost_crypto_close_sess(struct vhost_crypto *vcrypto, uint64_t session_id)
407{
408 struct rte_cryptodev_sym_session *session;
409 uint64_t sess_id = session_id;
410 int ret;
411
412 ret = rte_hash_lookup_data(vcrypto->session_map, &sess_id,
413 (void **)&session);
414
415 if (unlikely(ret < 0)) {
416 VC_LOG_ERR("Failed to delete session %"PRIu64".", session_id);
417 return -VIRTIO_CRYPTO_INVSESS;
418 }
419
420 if (rte_cryptodev_sym_session_free(vcrypto->cid, session) < 0) {
421 VC_LOG_DBG("Failed to free session");
422 return -VIRTIO_CRYPTO_ERR;
423 }
424
425 if (rte_hash_del_key(vcrypto->session_map, &sess_id) < 0) {
426 VC_LOG_DBG("Failed to delete session from hash table.");
427 return -VIRTIO_CRYPTO_ERR;
428 }
429
430 VC_LOG_INFO("Session %"PRIu64" deleted for vdev %i.", sess_id,
431 vcrypto->dev->vid);
432
433 return 0;
434}
435
436static enum rte_vhost_msg_result
437vhost_crypto_msg_post_handler(int vid, void *msg)

Callers 1

Calls 3

rte_hash_lookup_dataFunction · 0.85
rte_hash_del_keyFunction · 0.85

Tested by

no test coverage detected