[dpdk-dev] [PATCH] doc: add deprecation notice to fix ethdev API returning void

Stephen Hemminger stephen at networkplumber.org
Tue Jul 23 16:38:21 CEST 2019


On Tue, 23 Jul 2019 15:07:51 +0100
Andrew Rybchenko <arybchenko at solarflare.com> wrote:

> void return value is bad for get API (like rte_eth_dev_info-get())
> since caller does not know if the function does its job or not and
> output value is filled in.
> 
> void return value is bad for state changing API (like
> rte_eth_promiscuous_enable()) since caller should use get API
> to understand if state is really changed.
> 
> Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>

In general this is a good ide, but for some API's it is hard
to think of a way it would help. For example:
void return is ok for close routines because if close() returns
an error the application really has no choice about what to do.


More information about the dev mailing list