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

Function initialize_crypto_session

dpdk/examples/l2fwd-crypto/main.c:672–699  ·  view source on GitHub ↗

Session is created and is later attached to the crypto operation. 8< */

Source from the content-addressed store, hash-verified

670
671/* Session is created and is later attached to the crypto operation. 8< */
672static void *
673initialize_crypto_session(struct l2fwd_crypto_options *options, uint8_t cdev_id)
674{
675 struct rte_crypto_sym_xform *first_xform;
676 int retval = rte_cryptodev_socket_id(cdev_id);
677
678 if (retval < 0)
679 return NULL;
680
681 uint8_t socket_id = (uint8_t) retval;
682
683 if (options->xform_chain == L2FWD_CRYPTO_AEAD) {
684 first_xform = &options->aead_xform;
685 } else if (options->xform_chain == L2FWD_CRYPTO_CIPHER_HASH) {
686 first_xform = &options->cipher_xform;
687 first_xform->next = &options->auth_xform;
688 } else if (options->xform_chain == L2FWD_CRYPTO_HASH_CIPHER) {
689 first_xform = &options->auth_xform;
690 first_xform->next = &options->cipher_xform;
691 } else if (options->xform_chain == L2FWD_CRYPTO_CIPHER_ONLY) {
692 first_xform = &options->cipher_xform;
693 } else {
694 first_xform = &options->auth_xform;
695 }
696
697 return rte_cryptodev_sym_session_create(cdev_id, first_xform,
698 session_pool_socket[socket_id].sess_mp);
699}
700/* >8 End of creation of session. */
701
702static void

Callers 1

l2fwd_main_loopFunction · 0.85

Calls 2

rte_cryptodev_socket_idFunction · 0.85

Tested by

no test coverage detected