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

Function check_device_support_cipher_algo

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

Source from the content-addressed store, hash-verified

1840}
1841
1842static const struct rte_cryptodev_capabilities *
1843check_device_support_cipher_algo(const struct l2fwd_crypto_options *options,
1844 const struct rte_cryptodev_info *dev_info,
1845 uint8_t cdev_id)
1846{
1847 unsigned int i = 0;
1848 const struct rte_cryptodev_capabilities *cap = &dev_info->capabilities[0];
1849 enum rte_crypto_cipher_algorithm cap_cipher_algo;
1850 enum rte_crypto_cipher_algorithm opt_cipher_algo =
1851 options->cipher_xform.cipher.algo;
1852
1853 while (cap->op != RTE_CRYPTO_OP_TYPE_UNDEFINED) {
1854 cap_cipher_algo = cap->sym.cipher.algo;
1855 if (cap->sym.xform_type == RTE_CRYPTO_SYM_XFORM_CIPHER) {
1856 if (cap_cipher_algo == opt_cipher_algo) {
1857 if (check_type(options, dev_info) == 0)
1858 break;
1859 }
1860 }
1861 cap = &dev_info->capabilities[++i];
1862 }
1863
1864 if (cap->op == RTE_CRYPTO_OP_TYPE_UNDEFINED) {
1865 printf("Algorithm %s not supported by cryptodev %u"
1866 " or device not of preferred type (%s)\n",
1867 rte_cryptodev_get_cipher_algo_string(opt_cipher_algo),
1868 cdev_id,
1869 options->string_type);
1870 return NULL;
1871 }
1872
1873 return cap;
1874}
1875
1876static const struct rte_cryptodev_capabilities *
1877check_device_support_auth_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