ethdev: remove old close behaviour
[dpdk.git] / drivers / net / fm10k / fm10k_ethdev.c
index e6043e1..3719398 100644 (file)
@@ -1841,9 +1841,10 @@ fm10k_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
        q->tail_ptr = (volatile uint32_t *)
                &((uint32_t *)hw->hw_addr)[FM10K_RDT(queue_id)];
        q->offloads = offloads;
-       if (handle_rxconf(q, conf))
+       if (handle_rxconf(q, conf)) {
+               rte_free(q);
                return -EINVAL;
-
+       }
        /* allocate memory for the software ring */
        q->sw_ring = rte_zmalloc_socket("fm10k sw ring",
                        (nb_desc + q->nb_fake_desc) * sizeof(struct rte_mbuf *),
@@ -2621,7 +2622,7 @@ fm10k_dev_interrupt_handler_pf(void *param)
                                        true);
 
                        dev_info->sm_down = 0;
-                       _rte_eth_dev_callback_process(dev,
+                       rte_eth_dev_callback_process(dev,
                                        RTE_ETH_EVENT_INTR_LSC,
                                        NULL);
                }
@@ -2635,8 +2636,7 @@ fm10k_dev_interrupt_handler_pf(void *param)
        if (err == FM10K_ERR_RESET_REQUESTED) {
                PMD_INIT_LOG(INFO, "INT: Switch is down");
                dev_info->sm_down = 1;
-               _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC,
-                               NULL);
+               rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
        }
 
        /* Handle SRAM error */
@@ -2703,8 +2703,7 @@ fm10k_dev_interrupt_handler_vf(void *param)
 
                /* Setting reset flag */
                dev_info->sm_down = 1;
-               _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC,
-                               NULL);
+               rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
        }
 
        if (dev_info->sm_down == 1 &&
@@ -2732,8 +2731,7 @@ fm10k_dev_interrupt_handler_vf(void *param)
                fm10k_vlan_filter_set(dev, hw->mac.default_vid, true);
 
                dev_info->sm_down = 0;
-               _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC,
-                               NULL);
+               rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
        }
 
        /* Re-enable interrupt from device side */
@@ -2779,7 +2777,7 @@ fm10k_close_mbx_service(struct fm10k_hw *hw)
        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);
@@ -2824,6 +2822,8 @@ fm10k_dev_close(struct rte_eth_dev *dev)
                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 = {
@@ -3130,11 +3130,6 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
                &dev->data->mac_addrs[0]);
        }
 
-       /* Pass the information to the rte_eth_dev_close() that it should also
-        * release the private port resources.
-        */
-       dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        /* Reset the hw statistics */
        diag = fm10k_stats_reset(dev);
        if (diag != 0) {