The device operation .dev_close was returning void.
This driver interface is changed to return an int.
Note that the API rte_eth_dev_close() is still returning void,
although a deprecation notice is pending to change it as well.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
Reviewed-by: Sachin Saxena <sachin.saxena@oss.nxp.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
rte_pktmbuf_free(pkt);
}
-static void
+static int
virtual_ethdev_close(struct rte_eth_dev *dev __rte_unused)
-{}
+{
+ return 0;
+}
static int
virtual_ethdev_configure_success(struct rte_eth_dev *dev __rte_unused)
return 0;
}
-static void
+static int
eth_dev_close(struct rte_eth_dev *dev __rte_unused)
{
+ return 0;
}
static void
umem = NULL;
}
-static void
+static int
eth_dev_close(struct rte_eth_dev *dev)
{
struct pmd_internals *internals = dev->data->dev_private;
rte_free(list);
}
}
+
+ return 0;
}
static void
static int eth_ark_dev_configure(struct rte_eth_dev *dev);
static int eth_ark_dev_start(struct rte_eth_dev *dev);
static void eth_ark_dev_stop(struct rte_eth_dev *dev);
-static void eth_ark_dev_close(struct rte_eth_dev *dev);
+static int eth_ark_dev_close(struct rte_eth_dev *dev);
static int eth_ark_dev_info_get(struct rte_eth_dev *dev,
struct rte_eth_dev_info *dev_info);
static int eth_ark_dev_link_update(struct rte_eth_dev *dev,
}
}
-static void
+static int
eth_ark_dev_close(struct rte_eth_dev *dev)
{
struct ark_adapter *ark = dev->data->dev_private;
rte_free(dev->data->mac_addrs);
dev->data->mac_addrs = 0;
+
+ return 0;
}
static int
static void atl_dev_stop(struct rte_eth_dev *dev);
static int atl_dev_set_link_up(struct rte_eth_dev *dev);
static int atl_dev_set_link_down(struct rte_eth_dev *dev);
-static void atl_dev_close(struct rte_eth_dev *dev);
+static int atl_dev_close(struct rte_eth_dev *dev);
static int atl_dev_reset(struct rte_eth_dev *dev);
static int atl_dev_promiscuous_enable(struct rte_eth_dev *dev);
static int atl_dev_promiscuous_disable(struct rte_eth_dev *dev);
/*
* Reset and stop device.
*/
-static void
+static int
atl_dev_close(struct rte_eth_dev *dev)
{
PMD_INIT_FUNC_TRACE();
atl_dev_stop(dev);
atl_free_queues(dev);
+
+ return 0;
}
static int
static int avp_dev_configure(struct rte_eth_dev *dev);
static int avp_dev_start(struct rte_eth_dev *dev);
static void avp_dev_stop(struct rte_eth_dev *dev);
-static void avp_dev_close(struct rte_eth_dev *dev);
+static int avp_dev_close(struct rte_eth_dev *dev);
static int avp_dev_info_get(struct rte_eth_dev *dev,
struct rte_eth_dev_info *dev_info);
static int avp_vlan_offload_set(struct rte_eth_dev *dev, int mask);
rte_spinlock_unlock(&avp->lock);
}
-static void
+static int
avp_dev_close(struct rte_eth_dev *eth_dev)
{
struct avp_dev *avp = AVP_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
unlock:
rte_spinlock_unlock(&avp->lock);
+ return 0;
}
static int
static int axgbe_dev_start(struct rte_eth_dev *dev);
static void axgbe_dev_stop(struct rte_eth_dev *dev);
static void axgbe_dev_interrupt_handler(void *param);
-static void axgbe_dev_close(struct rte_eth_dev *dev);
+static int axgbe_dev_close(struct rte_eth_dev *dev);
static int axgbe_dev_promiscuous_enable(struct rte_eth_dev *dev);
static int axgbe_dev_promiscuous_disable(struct rte_eth_dev *dev);
static int axgbe_dev_allmulticast_enable(struct rte_eth_dev *dev);
}
/* Clear all resources like TX/RX queues. */
-static void
+static int
axgbe_dev_close(struct rte_eth_dev *dev)
{
axgbe_dev_clear_queues(dev);
+ return 0;
}
static int
return;
}
-static void
+static int
bnx2x_dev_close(struct rte_eth_dev *dev)
{
struct bnx2x_softc *sc = dev->data->dev_private;
/* free ilt */
bnx2x_free_ilt_mem(sc);
+
+ return 0;
}
static int
bp->flow_stat->flow_count = 0;
}
-static void bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
+static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
{
struct bnxt *bp = eth_dev->data->dev_private;
rte_free(bp->grp_info);
bp->grp_info = NULL;
+
+ return 0;
}
static void bnxt_mac_addr_remove_op(struct rte_eth_dev *eth_dev,
bnxt_rep_free_rx_mbufs(vfr_bp);
}
-void bnxt_rep_dev_close_op(struct rte_eth_dev *eth_dev)
+int bnxt_rep_dev_close_op(struct rte_eth_dev *eth_dev)
{
BNXT_TF_DBG(DEBUG, "BNXT Port:%d VFR close\n", eth_dev->data->port_id);
bnxt_representor_uninit(eth_dev);
+ return 0;
}
int bnxt_rep_dev_info_get_op(struct rte_eth_dev *eth_dev,
void bnxt_rep_rx_queue_release_op(void *rx_queue);
void bnxt_rep_tx_queue_release_op(void *tx_queue);
void bnxt_rep_dev_stop_op(struct rte_eth_dev *eth_dev);
-void bnxt_rep_dev_close_op(struct rte_eth_dev *eth_dev);
+int bnxt_rep_dev_close_op(struct rte_eth_dev *eth_dev);
int bnxt_rep_stats_get_op(struct rte_eth_dev *eth_dev,
struct rte_eth_stats *stats);
int bnxt_rep_stats_reset_op(struct rte_eth_dev *eth_dev);
void
bond_ethdev_stop(struct rte_eth_dev *eth_dev);
-void
+int
bond_ethdev_close(struct rte_eth_dev *dev);
#endif
}
}
-void
+int
bond_ethdev_close(struct rte_eth_dev *dev)
{
struct bond_dev_private *internals = dev->data->dev_private;
bond_flow_ops.flush(dev, &ferror);
bond_ethdev_free_queues(dev);
rte_bitmap_reset(internals->vlan_filter_bmp);
+
+ return 0;
}
/* forward declaration */
/*
* Stop device.
*/
-void cxgbe_dev_close(struct rte_eth_dev *eth_dev)
+int cxgbe_dev_close(struct rte_eth_dev *eth_dev)
{
struct port_info *temp_pi, *pi = eth_dev->data->dev_private;
struct adapter *adapter = pi->adapter;
CXGBE_FUNC_TRACE();
if (!(adapter->flags & FULL_INIT_DONE))
- return;
+ return 0;
if (!pi->viid)
- return;
+ return 0;
cxgbe_down(pi);
t4_sge_eth_release_queues(pi);
for_each_port(adapter, i) {
temp_pi = adap2pinfo(adapter, i);
if (temp_pi->viid)
- return;
+ return 0;
}
cxgbe_close(adapter);
rte_free(adapter);
+
+ return 0;
}
/* Start the device.
void cxgbe_dev_rx_queue_release(void *q);
void cxgbe_dev_tx_queue_release(void *q);
void cxgbe_dev_stop(struct rte_eth_dev *eth_dev);
-void cxgbe_dev_close(struct rte_eth_dev *eth_dev);
+int cxgbe_dev_close(struct rte_eth_dev *eth_dev);
int cxgbe_dev_info_get(struct rte_eth_dev *eth_dev,
struct rte_eth_dev_info *device_info);
int cxgbe_dev_promiscuous_enable(struct rte_eth_dev *eth_dev);
dev->tx_pkt_burst = dpaa_eth_tx_drop_all;
}
-static void dpaa_eth_dev_close(struct rte_eth_dev *dev)
+static int dpaa_eth_dev_close(struct rte_eth_dev *dev)
{
struct fman_if *fif = dev->process_private;
struct __fman_if *__fif;
dpaa_interrupt_handler,
(void *)dev);
}
+
+ return 0;
}
static int
rte_eth_linkstatus_set(dev, &link);
}
-static void
+static int
dpaa2_dev_close(struct rte_eth_dev *dev)
{
struct dpaa2_dev_priv *priv = dev->data->dev_private;
ret = dpni_reset(dpni, CMD_PRI_LOW, priv->token);
if (ret) {
DPAA2_PMD_ERR("Failure cleaning dpni device: err=%d", ret);
- return;
+ return -1;
}
memset(&link, 0, sizeof(link));
rte_eth_linkstatus_set(dev, &link);
+
+ return 0;
}
static int
static int eth_em_configure(struct rte_eth_dev *dev);
static int eth_em_start(struct rte_eth_dev *dev);
static void eth_em_stop(struct rte_eth_dev *dev);
-static void eth_em_close(struct rte_eth_dev *dev);
+static int eth_em_close(struct rte_eth_dev *dev);
static int eth_em_promiscuous_enable(struct rte_eth_dev *dev);
static int eth_em_promiscuous_disable(struct rte_eth_dev *dev);
static int eth_em_allmulticast_enable(struct rte_eth_dev *dev);
}
}
-static void
+static int
eth_em_close(struct rte_eth_dev *dev)
{
struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
rte_intr_disable(intr_handle);
rte_intr_callback_unregister(intr_handle,
eth_em_interrupt_handler, dev);
+
+ return 0;
}
static int
static void eth_igb_stop(struct rte_eth_dev *dev);
static int eth_igb_dev_set_link_up(struct rte_eth_dev *dev);
static int eth_igb_dev_set_link_down(struct rte_eth_dev *dev);
-static void eth_igb_close(struct rte_eth_dev *dev);
+static int eth_igb_close(struct rte_eth_dev *dev);
static int eth_igb_reset(struct rte_eth_dev *dev);
static int eth_igb_promiscuous_enable(struct rte_eth_dev *dev);
static int eth_igb_promiscuous_disable(struct rte_eth_dev *dev);
static int igbvf_dev_configure(struct rte_eth_dev *dev);
static int igbvf_dev_start(struct rte_eth_dev *dev);
static void igbvf_dev_stop(struct rte_eth_dev *dev);
-static void igbvf_dev_close(struct rte_eth_dev *dev);
+static int igbvf_dev_close(struct rte_eth_dev *dev);
static int igbvf_promiscuous_enable(struct rte_eth_dev *dev);
static int igbvf_promiscuous_disable(struct rte_eth_dev *dev);
static int igbvf_allmulticast_enable(struct rte_eth_dev *dev);
return 0;
}
-static void
+static int
eth_igb_close(struct rte_eth_dev *dev)
{
struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
/* clear all the filters list */
igb_filterlist_flush(dev);
+
+ return 0;
}
/*
adapter->stopped = true;
}
-static void
+static int
igbvf_dev_close(struct rte_eth_dev *dev)
{
struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
rte_intr_callback_unregister(&pci_dev->intr_handle,
eth_igbvf_interrupt_handler,
(void *)dev);
+
+ return 0;
}
static int
static int ena_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
static int ena_start(struct rte_eth_dev *dev);
static void ena_stop(struct rte_eth_dev *dev);
-static void ena_close(struct rte_eth_dev *dev);
+static int ena_close(struct rte_eth_dev *dev);
static int ena_dev_reset(struct rte_eth_dev *dev);
static int ena_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats);
static void ena_rx_queue_release_all(struct rte_eth_dev *dev);
ena_com_delete_debug_area(&adapter->ena_dev);
}
-static void ena_close(struct rte_eth_dev *dev)
+static int ena_close(struct rte_eth_dev *dev)
{
struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
* release of the resource in the rte_eth_dev_release_port().
*/
dev->data->mac_addrs = NULL;
+
+ return 0;
}
static int
return 0;
}
-static void
+static int
enetc_dev_close(struct rte_eth_dev *dev)
{
uint16_t i;
dev->data->tx_queues[i] = NULL;
}
dev->data->nb_tx_queues = 0;
+
+ return 0;
}
static int
/*
* Stop device.
*/
-static void enicpmd_dev_close(struct rte_eth_dev *eth_dev)
+static int enicpmd_dev_close(struct rte_eth_dev *eth_dev)
{
struct enic *enic = pmd_priv(eth_dev);
ENICPMD_FUNC_TRACE();
enic_remove(enic);
+
+ return 0;
}
static int enicpmd_dev_link_update(struct rte_eth_dev *eth_dev,
* "close" is no-op for now and solely exists so that rte_eth_dev_close()
* can finish its own cleanup without errors.
*/
-static void enic_vf_dev_close(struct rte_eth_dev *eth_dev __rte_unused)
+static int enic_vf_dev_close(struct rte_eth_dev *eth_dev __rte_unused)
{
ENICPMD_FUNC_TRACE();
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
- return;
+ return 0;
+ return 0;
}
static int
}
static void fs_dev_free_queues(struct rte_eth_dev *dev);
-static void
+static int
fs_dev_close(struct rte_eth_dev *dev)
{
struct sub_device *sdev;
}
fs_dev_free_queues(dev);
fs_unlock(dev, 0);
+ return 0;
}
static int
hw->mbx.ops.disconnect(hw, &hw->mbx);
}
-static void
+static int
fm10k_dev_close(struct rte_eth_dev *dev)
{
struct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);
rte_intr_callback_unregister(intr_handle,
fm10k_dev_interrupt_handler_vf, (void *)dev);
}
+
+ return 0;
}
static const struct eth_dev_ops fm10k_eth_dev_ops = {
* @param dev
* Pointer to Ethernet device structure.
*/
-static void hinic_dev_close(struct rte_eth_dev *dev)
+static int hinic_dev_close(struct rte_eth_dev *dev)
{
struct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);
&nic_dev->dev_status)) {
PMD_DRV_LOG(WARNING, "Device %s already closed",
dev->data->name);
- return;
+ return 0;
}
/* stop device first */
/* deinit nic hardware device */
hinic_nic_dev_destroy(dev);
+
+ return 0;
}
static const struct eth_dev_ops hinic_pmd_ops = {
rte_spinlock_unlock(&hw->lock);
}
-static void
+static int
hns3_dev_close(struct rte_eth_dev *eth_dev)
{
struct hns3_adapter *hns = eth_dev->data->dev_private;
if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
rte_free(eth_dev->process_private);
eth_dev->process_private = NULL;
- return;
+ return 0;
}
if (hw->adapter_state == HNS3_NIC_STARTED)
eth_dev->process_private = NULL;
hns3_mp_uninit_primary();
hns3_warn(hw, "Close port %d finished", hw->data->port_id);
+
+ return 0;
}
static int
rte_spinlock_unlock(&hw->lock);
}
-static void
+static int
hns3vf_dev_close(struct rte_eth_dev *eth_dev)
{
struct hns3_adapter *hns = eth_dev->data->dev_private;
struct hns3_hw *hw = &hns->hw;
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
- return;
+ return 0;
if (hw->adapter_state == HNS3_NIC_STARTED)
hns3vf_dev_stop(eth_dev);
eth_dev->process_private = NULL;
hns3_mp_uninit_primary();
hns3_warn(hw, "Close port %d finished", hw->data->port_id);
+
+ return 0;
}
static int
static int i40e_dev_configure(struct rte_eth_dev *dev);
static int i40e_dev_start(struct rte_eth_dev *dev);
static void i40e_dev_stop(struct rte_eth_dev *dev);
-static void i40e_dev_close(struct rte_eth_dev *dev);
+static int i40e_dev_close(struct rte_eth_dev *dev);
static int i40e_dev_reset(struct rte_eth_dev *dev);
static int i40e_dev_promiscuous_enable(struct rte_eth_dev *dev);
static int i40e_dev_promiscuous_disable(struct rte_eth_dev *dev);
pf->adapter->rss_reta_updated = 0;
}
-static void
+static int
i40e_dev_close(struct rte_eth_dev *dev)
{
struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
i40e_tm_conf_uninit(dev);
hw->adapter_closed = 1;
+ return 0;
}
/*
static int i40evf_vlan_filter_set(struct rte_eth_dev *dev,
uint16_t vlan_id, int on);
static int i40evf_vlan_offload_set(struct rte_eth_dev *dev, int mask);
-static void i40evf_dev_close(struct rte_eth_dev *dev);
+static int i40evf_dev_close(struct rte_eth_dev *dev);
static int i40evf_dev_reset(struct rte_eth_dev *dev);
static int i40evf_check_vf_reset_done(struct rte_eth_dev *dev);
static int i40evf_dev_promiscuous_enable(struct rte_eth_dev *dev);
return ret;
}
-static void
+static int
i40evf_dev_close(struct rte_eth_dev *dev)
{
struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
vf->aq_resp = NULL;
hw->adapter_closed = 1;
+ return 0;
}
/*
static int iavf_dev_configure(struct rte_eth_dev *dev);
static int iavf_dev_start(struct rte_eth_dev *dev);
static void iavf_dev_stop(struct rte_eth_dev *dev);
-static void iavf_dev_close(struct rte_eth_dev *dev);
+static int iavf_dev_close(struct rte_eth_dev *dev);
static int iavf_dev_reset(struct rte_eth_dev *dev);
static int iavf_dev_info_get(struct rte_eth_dev *dev,
struct rte_eth_dev_info *dev_info);
return 0;
}
-static void
+static int
iavf_dev_close(struct rte_eth_dev *dev)
{
struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(dev->data->dev_private);
rte_free(vf->aq_resp);
vf->aq_resp = NULL;
+
+ return 0;
}
static int
return 0;
}
-static void
+static int
ice_dcf_dev_close(struct rte_eth_dev *dev)
{
struct ice_dcf_adapter *adapter = dev->data->dev_private;
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
- return;
+ return 0;
dev->dev_ops = NULL;
dev->rx_pkt_burst = NULL;
ice_dcf_uninit_parent_adapter(dev);
ice_dcf_uninit_hw(dev, &adapter->real_hw);
+
+ return 0;
}
static int
static int ice_dev_configure(struct rte_eth_dev *dev);
static int ice_dev_start(struct rte_eth_dev *dev);
static void ice_dev_stop(struct rte_eth_dev *dev);
-static void ice_dev_close(struct rte_eth_dev *dev);
+static int ice_dev_close(struct rte_eth_dev *dev);
static int ice_dev_reset(struct rte_eth_dev *dev);
static int ice_dev_info_get(struct rte_eth_dev *dev,
struct rte_eth_dev_info *dev_info);
pf->adapter_stopped = true;
}
-static void
+static int
ice_dev_close(struct rte_eth_dev *dev)
{
struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
/* unregister callback func from eal lib */
rte_intr_callback_unregister(intr_handle,
ice_interrupt_handler, dev);
+
+ return 0;
}
static int
static int eth_igc_start(struct rte_eth_dev *dev);
static int eth_igc_set_link_up(struct rte_eth_dev *dev);
static int eth_igc_set_link_down(struct rte_eth_dev *dev);
-static void eth_igc_close(struct rte_eth_dev *dev);
+static int eth_igc_close(struct rte_eth_dev *dev);
static int eth_igc_reset(struct rte_eth_dev *dev);
static int eth_igc_promiscuous_enable(struct rte_eth_dev *dev);
static int eth_igc_promiscuous_disable(struct rte_eth_dev *dev);
dev->data->nb_tx_queues = 0;
}
-static void
+static int
eth_igc_close(struct rte_eth_dev *dev)
{
struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
/* Reset any pending lock */
igc_reset_swfw_lock(hw);
+
+ return 0;
}
static void
static int ionic_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
static int ionic_dev_start(struct rte_eth_dev *dev);
static void ionic_dev_stop(struct rte_eth_dev *dev);
-static void ionic_dev_close(struct rte_eth_dev *dev);
+static int ionic_dev_close(struct rte_eth_dev *dev);
static int ionic_dev_set_link_up(struct rte_eth_dev *dev);
static int ionic_dev_set_link_down(struct rte_eth_dev *dev);
static int ionic_dev_link_update(struct rte_eth_dev *eth_dev,
/*
* Reset and stop device.
*/
-static void
+static int
ionic_dev_close(struct rte_eth_dev *eth_dev)
{
struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
err = ionic_lif_stop(lif);
if (err) {
IONIC_PRINT(ERR, "Cannot stop LIF: %d", err);
- return;
+ return -1;
}
err = eth_ionic_dev_uninit(eth_dev);
if (err) {
IONIC_PRINT(ERR, "Cannot destroy LIF: %d", err);
- return;
+ return -1;
}
+
+ return 0;
}
static int
}
}
-static void
+static int
ipn3ke_rpst_dev_close(struct rte_eth_dev *dev)
{
struct ipn3ke_hw *hw = IPN3KE_DEV_PRIVATE_TO_HW(dev);
/* Disable the RX path */
ipn3ke_xmac_rx_disable(hw, rpst->port_id, 0);
}
+
+ return 0;
}
/*
static void ixgbe_dev_stop(struct rte_eth_dev *dev);
static int ixgbe_dev_set_link_up(struct rte_eth_dev *dev);
static int ixgbe_dev_set_link_down(struct rte_eth_dev *dev);
-static void ixgbe_dev_close(struct rte_eth_dev *dev);
+static int ixgbe_dev_close(struct rte_eth_dev *dev);
static int ixgbe_dev_reset(struct rte_eth_dev *dev);
static int ixgbe_dev_promiscuous_enable(struct rte_eth_dev *dev);
static int ixgbe_dev_promiscuous_disable(struct rte_eth_dev *dev);
static int ixgbevf_dev_link_update(struct rte_eth_dev *dev,
int wait_to_complete);
static void ixgbevf_dev_stop(struct rte_eth_dev *dev);
-static void ixgbevf_dev_close(struct rte_eth_dev *dev);
+static int ixgbevf_dev_close(struct rte_eth_dev *dev);
static int ixgbevf_dev_reset(struct rte_eth_dev *dev);
static void ixgbevf_intr_disable(struct rte_eth_dev *dev);
static void ixgbevf_intr_enable(struct rte_eth_dev *dev);
/*
* Reset and stop device.
*/
-static void
+static int
ixgbe_dev_close(struct rte_eth_dev *dev)
{
struct ixgbe_hw *hw =
rte_free(dev->security_ctx);
#endif
+ return 0;
}
/*
adapter->rss_reta_updated = 0;
}
-static void
+static int
ixgbevf_dev_close(struct rte_eth_dev *dev)
{
struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
rte_intr_disable(intr_handle);
rte_intr_callback_unregister(intr_handle,
ixgbevf_dev_interrupt_handler, dev);
+
+ return 0;
}
/*
dev->data->dev_link.link_status = 0;
}
-static void
+static int
eth_kni_close(struct rte_eth_dev *eth_dev)
{
struct pmd_internals *internals;
if (ret)
PMD_LOG(WARNING, "Not able to release kni for %s",
eth_dev->data->name);
+
+ return 0;
}
static int
* @return
* - nothing
*/
-static void
+static int
lio_dev_close(struct rte_eth_dev *eth_dev)
{
struct lio_device *lio_dev = LIO_DEV(eth_dev);
/* Delete all queues */
lio_dev_clear_queues(eth_dev);
+
+ return 0;
}
/**
return ret;
}
-static void
+static int
memif_dev_close(struct rte_eth_dev *dev)
{
struct pmd_internals *pmd = dev->data->dev_private;
}
rte_free(dev->process_private);
+
+ return 0;
}
static int
* @param dev
* Pointer to Ethernet device structure.
*/
-static void
+static int
mlx4_dev_close(struct rte_eth_dev *dev)
{
struct mlx4_priv *priv = dev->data->dev_private;
MLX4_ASSERT(priv->ctx == NULL);
mlx4_intr_uninstall(priv);
memset(priv, 0, sizeof(*priv));
+ return 0;
}
static const struct eth_dev_ops mlx4_dev_ops = {
* @param dev
* Pointer to Ethernet device structure.
*/
-void
+int
mlx5_dev_close(struct rte_eth_dev *dev)
{
struct mlx5_priv *priv = dev->data->dev_private;
if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
/* Check if process_private released. */
if (!dev->process_private)
- return;
+ return 0;
mlx5_tx_uar_uninit_secondary(dev);
mlx5_proc_priv_uninit(dev);
rte_eth_dev_release_port(dev);
- return;
+ return 0;
}
if (!priv->sh)
- return;
+ return 0;
DRV_LOG(DEBUG, "port %u closing device \"%s\"",
dev->data->port_id,
((priv->sh->ctx != NULL) ?
* it is freed when dev_private is freed.
*/
dev->data->mac_addrs = NULL;
+ return 0;
}
/**
int mlx5_udp_tunnel_port_add(struct rte_eth_dev *dev,
struct rte_eth_udp_tunnel *udp_tunnel);
uint16_t mlx5_eth_find_next(uint16_t port_id, struct rte_pci_device *pci_dev);
-void mlx5_dev_close(struct rte_eth_dev *dev);
+int mlx5_dev_close(struct rte_eth_dev *dev);
/* Macro to iterate over all valid ports for mlx5 driver. */
#define MLX5_ETH_FOREACH_DEV(port_id, pci_dev) \
* @param dev
* Pointer to Ethernet device structure.
*/
-static void
+static int
mvneta_dev_close(struct rte_eth_dev *dev)
{
struct mvneta_priv *priv = dev->data->dev_private;
mvneta_neta_deinit();
rte_mvep_deinit(MVEP_MOD_T_NETA);
}
+
+ return 0;
}
/**
* @param dev
* Pointer to Ethernet device structure.
*/
-static void
+static int
mrvl_dev_close(struct rte_eth_dev *dev)
{
struct mrvl_priv *priv = dev->data->dev_private;
mrvl_deinit_pp2();
rte_mvep_deinit(MVEP_MOD_T_PP2);
}
+
+ return 0;
}
/**
hn_vf_stop(dev);
}
-static void
+static int
hn_dev_close(struct rte_eth_dev *dev)
{
PMD_INIT_FUNC_TRACE();
hn_vf_close(dev);
hn_dev_free_queues(dev);
+
+ return 0;
}
static const struct eth_dev_ops hn_eth_dev_ops = {
* @param dev
* Pointer to Ethernet device structure.
*/
-static void
+static int
nfb_eth_dev_close(struct rte_eth_dev *dev)
{
struct pmd_internals *internals = dev->data->dev_private;
rte_free(dev->data->mac_addrs);
dev->data->mac_addrs = NULL;
+
+ return 0;
}
/**
#include <errno.h>
/* Prototypes */
-static void nfp_net_close(struct rte_eth_dev *dev);
+static int nfp_net_close(struct rte_eth_dev *dev);
static int nfp_net_configure(struct rte_eth_dev *dev);
static void nfp_net_dev_interrupt_handler(void *param);
static void nfp_net_dev_interrupt_delayed_handler(void *param);
}
/* Reset and stop device. The device can not be restarted. */
-static void
+static int
nfp_net_close(struct rte_eth_dev *dev)
{
struct nfp_net_hw *hw;
* The ixgbe PMD driver disables the pcie master on the
* device. The i40e does not...
*/
+
+ return 0;
}
static int
return 0;
}
-static void
+static int
octeontx_dev_close(struct rte_eth_dev *dev)
{
struct octeontx_txq *txq = NULL;
dev->tx_pkt_burst = NULL;
dev->rx_pkt_burst = NULL;
+
+ return 0;
}
static int
}
static int otx2_nix_dev_reset(struct rte_eth_dev *eth_dev);
-static void otx2_nix_dev_close(struct rte_eth_dev *eth_dev);
+static int otx2_nix_dev_close(struct rte_eth_dev *eth_dev);
/* Initialize and register driver with DPDK Application */
static const struct eth_dev_ops otx2_eth_dev_ops = {
return 0;
}
-static void
+static int
otx2_nix_dev_close(struct rte_eth_dev *eth_dev)
{
otx2_eth_dev_uninit(eth_dev, true);
+ return 0;
}
static int
return 0;
}
-static void
+static int
eth_dev_close(struct rte_eth_dev *dev)
{
unsigned int i;
}
}
+ return 0;
}
static void
pfe->nb_devs--;
}
-static void
+static int
pfe_eth_close(struct rte_eth_dev *dev)
{
if (!dev)
- return;
+ return -1;
if (!g_pfe)
- return;
+ return -1;
pfe_eth_exit(dev, g_pfe);
rte_free(g_pfe);
g_pfe = NULL;
}
+
+ return 0;
}
static int
}
}
-static void qede_dev_close(struct rte_eth_dev *eth_dev)
+static int qede_dev_close(struct rte_eth_dev *eth_dev)
{
struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
if (ECORE_IS_CMT(edev))
rte_eal_alarm_cancel(qede_poll_sp_sb_cb, (void *)eth_dev);
+
+ return 0;
}
static int
return 0;
}
-static void
+static int
sfc_dev_close(struct rte_eth_dev *dev)
{
struct sfc_adapter *sa = sfc_adapter_by_eth_dev(dev);
dev->process_private = NULL;
free(sa);
+
+ return 0;
}
static int
softnic_mtr_free(p);
}
-static void
+static int
pmd_dev_close(struct rte_eth_dev *dev __rte_unused)
{
- return;
+ return 0;
}
static int
}
}
-static void
+static int
eth_dev_close(struct rte_eth_dev *dev)
{
struct pmd_internals *internals = dev->data->dev_private;
rte_free(dev->data->mac_addrs);
dev->data->mac_addrs = NULL;
+
+ return 0;
}
static int
return 0;
}
-static void
+static int
tap_dev_close(struct rte_eth_dev *dev)
{
int i;
* Since TUN device has no more opened file descriptors
* it will be removed from kernel
*/
+
+ return 0;
}
static void
}
}
-static void
+static int
nicvf_dev_close(struct rte_eth_dev *dev)
{
size_t i;
nicvf_periodic_alarm_stop(nicvf_vf_interrupt, nic->snicvf[i]);
}
+
+ return 0;
}
static int
update_queuing_status(dev);
}
-static void
+static int
eth_dev_close(struct rte_eth_dev *dev)
{
struct pmd_internal *internal;
internal = dev->data->dev_private;
if (!internal)
- return;
+ return 0;
eth_dev_stop(dev);
rte_free(vring_states[dev->data->port_id]);
vring_states[dev->data->port_id] = NULL;
+
+ return 0;
}
static int
static void virtio_queues_unbind_intr(struct rte_eth_dev *dev);
-static void
+static int
virtio_dev_close(struct rte_eth_dev *dev)
{
struct virtio_hw *hw = dev->data->dev_private;
PMD_INIT_LOG(DEBUG, "virtio_dev_close");
if (!hw->opened)
- return;
+ return 0;
hw->opened = false;
/* reset the NIC */
if (!hw->modern)
rte_pci_ioport_unmap(VTPCI_IO(hw));
}
+
+ return 0;
}
static int
static int vmxnet3_dev_configure(struct rte_eth_dev *dev);
static int vmxnet3_dev_start(struct rte_eth_dev *dev);
static void vmxnet3_dev_stop(struct rte_eth_dev *dev);
-static void vmxnet3_dev_close(struct rte_eth_dev *dev);
+static int vmxnet3_dev_close(struct rte_eth_dev *dev);
static void vmxnet3_dev_set_rxmode(struct vmxnet3_hw *hw, uint32_t feature, int set);
static int vmxnet3_dev_promiscuous_enable(struct rte_eth_dev *dev);
static int vmxnet3_dev_promiscuous_disable(struct rte_eth_dev *dev);
/*
* Reset and stop device.
*/
-static void
+static int
vmxnet3_dev_close(struct rte_eth_dev *dev)
{
PMD_INIT_FUNC_TRACE();
vmxnet3_dev_stop(dev);
vmxnet3_free_queues(dev);
+
+ return 0;
}
static void
typedef int (*eth_dev_set_link_down_t)(struct rte_eth_dev *dev);
/**< @internal Function used to link down a configured Ethernet device. */
-typedef void (*eth_dev_close_t)(struct rte_eth_dev *dev);
+typedef int (*eth_dev_close_t)(struct rte_eth_dev *dev);
/**< @internal Function used to close a configured Ethernet device. */
typedef int (*eth_dev_reset_t)(struct rte_eth_dev *dev);