[dpdk-dev] [PATCH] doc: add deprecation notice to fix ethdev API returning void
Andrew Rybchenko
arybchenko at solarflare.com
Tue Jul 23 16:52:42 CEST 2019
On 7/23/19 5:38 PM, Stephen Hemminger wrote:
> 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.
Yes, I agree. But application can always ignore return value.
Long-long time ago it was a surprise to me that libc close() has
non-void return value.
I intentionally provided everything which makes sense to me to
raise discussion. I was unsure in stop, close and owner delete
functions.
More information about the dev
mailing list