On 9/13/2020 11:06 PM, Thomas Monjalon wrote:
The flag RTE_ETH_DEV_CLOSE_REMOVE is set so all port resources
can be freed by rte_eth_dev_close().

Freeing of private port resources is moved
from the ".remove(device)" to the ".dev_close(port)" operation.

Signed-off-by: Thomas Monjalon <tho...@monjalon.net>

<...>

@@ -721,12 +687,32 @@ atl_dev_set_link_down(struct rte_eth_dev *dev)
  static int
  atl_dev_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;
+       struct aq_hw_s *hw;
+
        PMD_INIT_FUNC_TRACE();
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+               return -EPERM;

Is this case an error, or should it return 0.

+
+       hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+
        atl_dev_stop(dev);
atl_free_queues(dev); + dev->dev_ops = NULL;
+       dev->rx_pkt_burst = NULL;
+       dev->tx_pkt_burst = NULL;

What do you think moving above cleanup to 'rte_eth_dev_release_port()'?

Reply via email to