[dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
Thomas Monjalon
thomas at monjalon.net
Thu Oct 31 14:58:37 CET 2019
29/10/2019 16:37, pbhagavatula at marvell.com:
> From: Pavan Nikhilesh <pbhagavatula at marvell.com>
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> +static int
> +_rte_eth_dev_validate_offloads(uint16_t port_id, uint64_t req_offloads,
> + uint64_t set_offloads,
> + const char *(*f)(uint64_t))
Please do not call "f" a function parameter.
This function has a purpose, please name it.
Overall, I feel it would be easier to understand this function
with a comment on top, explaining each parameter. Thanks
> +{
> + uint64_t offloads_diff = req_offloads ^ set_offloads;
> + uint64_t offloads_req_diff, offloads_set_diff;
> + uint64_t offload;
> + uint8_t err = 0;
> +
> + /* Check if any offload is advertised but not enabled. */
Not sure "advertised" is the right word here.
More information about the dev
mailing list