On 4/2/2020 6:19 PM, Stephen Hemminger wrote:
> For applications that want to check if device is owned,
> change the return value of rte_eth_dev_owner_get to return -ENOENT
> if there is no owner for the device.
> 
> Change the two drivers (failsafe and netvsc) that are using
> this experimental API to handle the new return value.
> 
> Signed-off-by: Stephen Hemminger <step...@networkplumber.org>

<...>

> @@ -1685,9 +1685,11 @@ int rte_eth_dev_owner_delete(const uint64_t owner_id);
>   * @param    port_id
>   *  The port identifier.
>   * @param    owner
> - *  The owner structure pointer to fill.
> + *  The owner structure pointer to fill (optional can be NULL)
>   * @return
> - *  0 on success, negative errno value on error..
> + *  0 on success,
> + *  -ENODEV if port_id is not valid
> + *  -ENOENT if the device is ownerless.

Not sure if port not having an owner is error, I understand the motivation but
what about send a special value, like 1, instead of error:
0: get owner success, port owned
1: get owner success, port not owned
-ENODEV: get owner failed, port_id is not valid

Reply via email to