[PATCH v2 1/4] thash: add RSS hash key generation API
Stephen Hemminger
stephen at networkplumber.org
Thu Oct 10 17:04:15 CEST 2024
On Thu, 10 Oct 2024 12:33:28 +0000
Vladimir Medvedkin <vladimir.medvedkin at intel.com> wrote:
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice
> + *
> + * Modify RSS hash key such that subtuple bits corresponding to `entropy_sz`
> + * bits starting from `entropy_start` will have the most even distribution with
> + * this key with a given ReTa size.
> + *
> + * @param key pointer to the RSS hash key
> + * @param key_len length of the key
> + * @param reta_sz_log log2 of the size of RSS redirection table. i.e. number of
> + * bits of the rss hash value used to identify RSS ReTa entry
> + * @param entropy_start bit offset from the beginning of the tuple where user
> + * expects best distribution of the subtuple values.
> + * @param entropy_sz size in bits of the part of subtuple
> + *
> + * @return
> + * 0 on success negative otherwise
> + */
> +__rte_experimental
> +int
> +rte_thash_gen_key(uint8_t *key, int key_len, int reta_sz_log,
> + int entropy_start, int entropy_sz);
Avoid use of int wherever possible.
Unless you want to allow negative offsets.
Maybe something like?
int
rte_thash_gen_key(uint8_t *key, size_t key_len, size_t reta_sz_bits,
uint32_t entropy_start, size_t entropy_sz)
More information about the dev
mailing list