[dpdk-dev] [PATCH v5 3/5] ipsec: add SAD add/delete/lookup implementation
Akhil Goyal
akhil.goyal at nxp.com
Fri Oct 11 12:42:21 CEST 2019
> int
> -rte_ipsec_sad_lookup(__rte_unused const struct rte_ipsec_sad *sad,
> - __rte_unused const union rte_ipsec_sad_key *keys[],
> - __rte_unused void *sa[], __rte_unused uint32_t n)
> +rte_ipsec_sad_lookup(const struct rte_ipsec_sad *sad,
> + const union rte_ipsec_sad_key *keys[], void *sa[], uint32_t n)
> {
> - return -ENOTSUP;
> + uint32_t num, i = 0;
> + int found = 0;
> +
> + if (unlikely((sad == NULL) || (keys == NULL) || (sa == NULL)))
> + return -EINVAL;
> +
> + do {
> + num = RTE_MIN(n - i,
> (uint32_t)RTE_HASH_LOOKUP_BULK_MAX);
> + found += __ipsec_sad_lookup(sad,
> + &keys[i], &sa[i], num);
> + i += num;
> + } while (i != n);
> +
> + return found;
> }
rte_ipsec_sad_lookup should return 0 or a negative value as per the comments in the declaration.
But here it is returning more than 0. Something is not correct here.
> --
> 2.7.4
More information about the dev
mailing list