Currently we enforce that crypto capabilities retrieval functions always return same value for 'number of capability structures'. This helps one to use following code sequence easily:
int num_caps = odp_crypto_cipher_capability(ODP_CIPHER_ALG_AES_CBC, NULL, 0);
odp_crypto_cipher_capability_t capa[num_caps];
int ret = odp_crypto_cipher_capability(ODP_CIPHER_ALG_AES_CBC, capa, num_caps);
int i;
for (i = 0; i < num_capa; i++)
do_something(&capa[i]);
For ODP-DPDK this might lead to inclusion of duplicate or overlapping entries in capabilties structure.
Options to consider:
leave API as is, document that caps might include overlapping entries
change requirement so that ret <= num_capa, forcing users to loop till ret in the second loop
Currently we enforce that crypto capabilities retrieval functions always return same value for 'number of capability structures'. This helps one to use following code sequence easily:
For ODP-DPDK this might lead to inclusion of duplicate or overlapping entries in capabilties structure. Options to consider:
ret <= num_capa
, forcing users to loop tillret
in the second loop