Change rte_eth_dev_owner_delete() return value from void to int
and return negative errno values in case of error conditions.
Right now there is only one error case for rte_eth_dev_owner_delete() -
invalid owner, but it still makes sense to return error to catch bugs
in the code which uses the function.
Also update the usage of the function in drivers/netvsc
according to the new return type.
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
- ``rte_eth_allmulticast_enable`` and ``rte_eth_allmulticast_disable``
- ``rte_eth_dev_stop``
- ``rte_eth_dev_close``
- - ``rte_eth_dev_owner_delete``
* ethdev: New offload flags ``DEV_RX_OFFLOAD_RSS_HASH`` and
``DEV_RX_OFFLOAD_FLOW_MARK`` will be added in 19.11.
* ethdev: changed ``rte_eth_macaddr_get`` return value from ``void`` to
``int`` to provide a way to report various error conditions.
+* ethdev: changed ``rte_eth_dev_owner_delete`` return value from ``void`` to
+ ``int`` to provide a way to report various error conditions.
+
ABI Changes
-----------
eth_hn_dev_uninit(struct rte_eth_dev *eth_dev)
{
struct hn_data *hv = eth_dev->data->dev_private;
+ int ret;
PMD_INIT_FUNC_TRACE();
hn_tx_pool_uninit(eth_dev);
rte_vmbus_chan_close(hv->primary->chan);
rte_free(hv->primary);
- rte_eth_dev_owner_delete(hv->owner.id);
+ ret = rte_eth_dev_owner_delete(hv->owner.id);
+ if (ret != 0)
+ return ret;
return 0;
}
return ret;
}
-void
+int
rte_eth_dev_owner_delete(const uint64_t owner_id)
{
uint16_t port_id;
+ int ret = 0;
rte_eth_dev_shared_data_prepare();
RTE_ETHDEV_LOG(ERR,
"Invalid owner id=%016"PRIx64"\n",
owner_id);
+ ret = -EINVAL;
}
rte_spinlock_unlock(&rte_eth_dev_shared_data->ownership_lock);
+
+ return ret;
}
int
*
* @param owner_id
* The owner identifier.
+ * @return
+ * 0 on success, negative errno value on error.
*/
__rte_experimental
-void rte_eth_dev_owner_delete(const uint64_t owner_id);
+int rte_eth_dev_owner_delete(const uint64_t owner_id);
/**
* @warning