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

Function check_device_support_auth_algo

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

Source from the content-addressed store, hash-verified

1874}
1875
1876static const struct rte_cryptodev_capabilities *
1877check_device_support_auth_algo(const struct l2fwd_crypto_options *options,
1878 const struct rte_cryptodev_info *dev_info,
1879 uint8_t cdev_id)
1880{
1881 unsigned int i = 0;
1882 const struct rte_cryptodev_capabilities *cap = &dev_info->capabilities[0];
1883 enum rte_crypto_auth_algorithm cap_auth_algo;
1884 enum rte_crypto_auth_algorithm opt_auth_algo =
1885 options->auth_xform.auth.algo;
1886
1887 while (cap->op != RTE_CRYPTO_OP_TYPE_UNDEFINED) {
1888 cap_auth_algo = cap->sym.auth.algo;
1889 if (cap->sym.xform_type == RTE_CRYPTO_SYM_XFORM_AUTH) {
1890 if (cap_auth_algo == opt_auth_algo) {
1891 if (check_type(options, dev_info) == 0)
1892 break;
1893 }
1894 }
1895 cap = &dev_info->capabilities[++i];
1896 }
1897
1898 if (cap->op == RTE_CRYPTO_OP_TYPE_UNDEFINED) {
1899 printf("Algorithm %s not supported by cryptodev %u"
1900 " or device not of preferred type (%s)\n",
1901 rte_cryptodev_get_auth_algo_string(opt_auth_algo),
1902 cdev_id,
1903 options->string_type);
1904 return NULL;
1905 }
1906
1907 return cap;
1908}
1909
1910static const struct rte_cryptodev_capabilities *
1911check_device_support_aead_algo(const struct l2fwd_crypto_options *options,

Callers 2

check_capabilitiesFunction · 0.85
initialize_cryptodevsFunction · 0.85

Calls 3

check_typeFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected