| 1908 | } |
| 1909 | |
| 1910 | static const struct rte_cryptodev_capabilities * |
| 1911 | check_device_support_aead_algo(const struct l2fwd_crypto_options *options, |
| 1912 | const struct rte_cryptodev_info *dev_info, |
| 1913 | uint8_t cdev_id) |
| 1914 | { |
| 1915 | unsigned int i = 0; |
| 1916 | const struct rte_cryptodev_capabilities *cap = &dev_info->capabilities[0]; |
| 1917 | enum rte_crypto_aead_algorithm cap_aead_algo; |
| 1918 | enum rte_crypto_aead_algorithm opt_aead_algo = |
| 1919 | options->aead_xform.aead.algo; |
| 1920 | |
| 1921 | while (cap->op != RTE_CRYPTO_OP_TYPE_UNDEFINED) { |
| 1922 | cap_aead_algo = cap->sym.aead.algo; |
| 1923 | if (cap->sym.xform_type == RTE_CRYPTO_SYM_XFORM_AEAD) { |
| 1924 | if (cap_aead_algo == opt_aead_algo) { |
| 1925 | if (check_type(options, dev_info) == 0) |
| 1926 | break; |
| 1927 | } |
| 1928 | } |
| 1929 | cap = &dev_info->capabilities[++i]; |
| 1930 | } |
| 1931 | |
| 1932 | if (cap->op == RTE_CRYPTO_OP_TYPE_UNDEFINED) { |
| 1933 | printf("Algorithm %s not supported by cryptodev %u" |
| 1934 | " or device not of preferred type (%s)\n", |
| 1935 | rte_cryptodev_get_aead_algo_string(opt_aead_algo), |
| 1936 | cdev_id, |
| 1937 | options->string_type); |
| 1938 | return NULL; |
| 1939 | } |
| 1940 | |
| 1941 | return cap; |
| 1942 | } |
| 1943 | |
| 1944 | /* Check if the device is enabled by cryptodev_mask */ |
| 1945 | static int |
no test coverage detected