Session is created and is later attached to the crypto operation. 8< */
| 670 | |
| 671 | /* Session is created and is later attached to the crypto operation. 8< */ |
| 672 | static void * |
| 673 | initialize_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 | |
| 702 | static void |
no test coverage detected