ethdev: remove old close behaviour
authorThomas Monjalon <thomas@monjalon.net>
Mon, 28 Sep 2020 23:14:29 +0000 (01:14 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 30 Sep 2020 17:19:14 +0000 (19:19 +0200)
The temporary flag RTE_ETH_DEV_CLOSE_REMOVE is removed.
It was introduced in DPDK 18.11 in order to give time for PMDs to migrate.

The old behaviour was to free only queues when closing a port.
The new behaviour is calling rte_eth_dev_release_port() which does
three more tasks:
- trigger event callback
- reset state and few pointers
- free all generic port resources

The private port resources must be released in the .dev_close callback.

The .remove callback should:
- call .dev_close callback
- call rte_eth_dev_release_port()
- free multi-port device shared resources

Despite waiting two years, some drivers have not migrated,
so they may hit issues with the incompatible new behaviour.
After sending emails, adding logs, and announcing the deprecation,
the only last solution is to declare these drivers as unmaintained:
ionic, liquidio, nfp
Below is a summary of what to implement in those drivers.

* The freeing of private port resources must be moved
from the ".remove(device)" function to the ".dev_close(port)" function.

* If a generic resource (.mac_addrs or .hash_mac_addrs) cannot be freed,
it must be set to NULL in ".dev_close" function to protect from
subsequent rte_eth_dev_release_port() freeing.

* Note 1:
The generic resources are freed in rte_eth_dev_release_port(),
after ".dev_close" is called in rte_eth_dev_close(), but not when
calling ".dev_close" directly from the ".remove" PMD function.
That's why rte_eth_dev_release_port() must still be called explicitly
from ".remove(device)" after calling the ".dev_close" PMD function.

* Note 2:
If a device can have multiple ports, the common resources must be freed
only in the ".remove(device)" function.

* Note 3:
The port is supposed to be in a stopped state when it is closed.
If it is not the case, it is free to the PMD implementation
how to react when trying to close a non-stopped port:
either try to stop it automatically or just return an error.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
58 files changed:
MAINTAINERS
doc/guides/rel_notes/deprecation.rst
drivers/net/af_packet/rte_eth_af_packet.c
drivers/net/af_xdp/rte_eth_af_xdp.c
drivers/net/ark/ark_ethdev.c
drivers/net/atlantic/atl_ethdev.c
drivers/net/avp/avp_ethdev.c
drivers/net/axgbe/axgbe_ethdev.c
drivers/net/bnx2x/bnx2x_ethdev.c
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/bnxt/bnxt_reps.c
drivers/net/bonding/rte_eth_bond_pmd.c
drivers/net/cxgbe/cxgbe_main.c
drivers/net/cxgbe/cxgbevf_main.c
drivers/net/dpaa/dpaa_ethdev.c
drivers/net/dpaa2/dpaa2_ethdev.c
drivers/net/e1000/em_ethdev.c
drivers/net/e1000/igb_ethdev.c
drivers/net/ena/ena_ethdev.c
drivers/net/enetc/enetc_ethdev.c
drivers/net/enic/enic_ethdev.c
drivers/net/enic/enic_vf_representor.c
drivers/net/failsafe/failsafe.c
drivers/net/fm10k/fm10k_ethdev.c
drivers/net/hinic/hinic_pmd_ethdev.c
drivers/net/hns3/hns3_ethdev.c
drivers/net/hns3/hns3_ethdev_vf.c
drivers/net/i40e/i40e_ethdev.c
drivers/net/i40e/i40e_ethdev_vf.c
drivers/net/iavf/iavf_ethdev.c
drivers/net/ice/ice_dcf_ethdev.c
drivers/net/ice/ice_ethdev.c
drivers/net/igc/igc_ethdev.c
drivers/net/ixgbe/ixgbe_ethdev.c
drivers/net/kni/rte_eth_kni.c
drivers/net/memif/rte_eth_memif.c
drivers/net/mlx4/mlx4.c
drivers/net/mlx5/linux/mlx5_os.c
drivers/net/mvneta/mvneta_ethdev.c
drivers/net/mvpp2/mrvl_ethdev.c
drivers/net/netvsc/hn_ethdev.c
drivers/net/nfb/nfb_ethdev.c
drivers/net/null/rte_eth_null.c
drivers/net/octeontx/octeontx_ethdev.c
drivers/net/octeontx2/otx2_ethdev.c
drivers/net/pcap/rte_eth_pcap.c
drivers/net/pfe/pfe_ethdev.c
drivers/net/qede/qede_ethdev.c
drivers/net/ring/rte_eth_ring.c
drivers/net/sfc/sfc_ethdev.c
drivers/net/softnic/rte_eth_softnic.c
drivers/net/szedata2/rte_eth_szedata2.c
drivers/net/tap/rte_eth_tap.c
drivers/net/vhost/rte_eth_vhost.c
drivers/net/virtio/virtio_ethdev.c
drivers/net/vmxnet3/vmxnet3_ethdev.c
lib/librte_ethdev/rte_ethdev.c
lib/librte_ethdev/rte_ethdev.h

index a251340..681093d 100644 (file)
@@ -604,7 +604,7 @@ F: drivers/net/thunderx/
 F: doc/guides/nics/thunderx.rst
 F: doc/guides/nics/features/thunderx.ini
 
-Cavium LiquidIO
+Cavium LiquidIO - UNMAINTAINED
 M: Shijith Thotton <sthotton@marvell.com>
 M: Srisivasubramanian Srinivasan <srinivasan@marvell.com>
 T: git://dpdk.org/next/dpdk-next-net-mrvl
@@ -793,7 +793,7 @@ F: drivers/net/nfb/
 F: doc/guides/nics/nfb.rst
 F: doc/guides/nics/features/nfb.ini
 
-Netronome nfp
+Netronome nfp - UNMAINTAINED
 M: Heinrich Kuhn <heinrich.kuhn@netronome.com>
 F: drivers/net/nfp/
 F: doc/guides/nics/nfp.rst
@@ -829,7 +829,7 @@ F: doc/guides/nics/pfe.rst
 F: drivers/net/pfe/
 F: doc/guides/nics/features/pfe.ini
 
-Pensando ionic
+Pensando ionic - UNMAINTAINED
 M: Alfredo Cardigliano <cardigliano@ntop.org>
 F: drivers/net/ionic/
 F: doc/guides/nics/ionic.rst
index 9691f2c..d07b4ee 100644 (file)
@@ -137,12 +137,6 @@ Deprecation Notices
   - ``rte_eth_dev_stop``
   - ``rte_eth_dev_close``
 
-* ethdev: The temporary flag RTE_ETH_DEV_CLOSE_REMOVE will be removed in 20.11.
-  As a consequence, the new behaviour introduced in 18.11 will be effective
-  for all drivers: generic port resources are freed on close operation.
-  Private resources are expected to be released in the ``dev_close`` callback.
-  More details in http://inbox.dpdk.org/dev/5248162.j6AOsuQRmx@thomas/
-
 * ethdev: New offload flags ``DEV_RX_OFFLOAD_FLOW_MARK`` will be added in 19.11.
   This will allow application to enable or disable PMDs from updating
   ``rte_mbuf::hash::fdir``.
index 12c202c..2587622 100644 (file)
@@ -859,7 +859,6 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
        data->nb_tx_queues = (uint16_t)nb_queues;
        data->dev_link = pmd_link;
        data->mac_addrs = &(*internals)->eth_addr;
-       data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
 
        (*eth_dev)->dev_ops = &ops;
 
index 4d0413c..5480d2a 100644 (file)
@@ -1448,8 +1448,6 @@ init_internals(struct rte_vdev_device *dev, const char *if_name,
        eth_dev->dev_ops = &ops;
        eth_dev->rx_pkt_burst = eth_af_xdp_rx;
        eth_dev->tx_pkt_burst = eth_af_xdp_tx;
-       /* Let rte_eth_dev_close() release the port resources. */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
 
 #if defined(XDP_UMEM_UNALIGNED_CHUNK_FLAG)
        AF_XDP_LOG(INFO, "Zero copy between umem and mbuf enabled.\n");
index 5f2ed4b..83dc4ec 100644 (file)
@@ -260,8 +260,6 @@ eth_ark_dev_init(struct rte_eth_dev *dev)
        /* Use dummy function until setup */
        dev->rx_pkt_burst = &eth_ark_recv_pkts_noop;
        dev->tx_pkt_burst = &eth_ark_xmit_pkts_noop;
-       /* Let rte_eth_dev_close() release the port resources */
-       dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
 
        ark->bar0 = (uint8_t *)pci_dev->mem_resource[0].addr;
        ark->a_bar = (uint8_t *)pci_dev->mem_resource[2].addr;
index d3babef..2217511 100644 (file)
@@ -380,8 +380,6 @@ eth_atl_dev_init(struct rte_eth_dev *eth_dev)
        if (rte_eal_process_type() != RTE_PROC_PRIMARY)
                return 0;
 
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        /* Vendor and Device ID need to be set before init of shared code */
        hw->device_id = pci_dev->id.device_id;
        hw->vendor_id = pci_dev->id.vendor_id;
index 2eed6ac..c730b7a 100644 (file)
@@ -957,8 +957,6 @@ eth_avp_dev_init(struct rte_eth_dev *eth_dev)
        eth_dev->dev_ops = &avp_eth_dev_ops;
        eth_dev->rx_pkt_burst = &avp_recv_pkts;
        eth_dev->tx_pkt_burst = &avp_xmit_pkts;
-       /* Let rte_eth_dev_close() release the port resources */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
 
        if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
                /*
index 2dd6418..cf08548 100644 (file)
@@ -1959,7 +1959,6 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev)
        int ret;
 
        eth_dev->dev_ops = &axgbe_eth_dev_ops;
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
 
        eth_dev->rx_descriptor_status = axgbe_dev_rx_descriptor_status;
        eth_dev->tx_descriptor_status = axgbe_dev_tx_descriptor_status;
index 8dc4638..40225b2 100644 (file)
@@ -735,11 +735,6 @@ bnx2x_common_dev_init(struct rte_eth_dev *eth_dev, int is_vf)
                        goto out;
        }
 
-       /* Pass the information to the rte_eth_dev_close() that it should also
-        * release the private port resources.
-        */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        return 0;
 
 out:
index 0b90a49..5ef9e1e 100644 (file)
@@ -6076,11 +6076,6 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused)
 
        bnxt_alloc_switch_domain(bp);
 
-       /* Pass the information to the rte_eth_dev_close() that it should also
-        * release the private port resources.
-        */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        PMD_DRV_LOG(INFO,
                    DRV_MODULE_NAME "found at mem %" PRIX64 ", node addr %pM\n",
                    pci_dev->mem_resource[0].phys_addr,
index cacb217..cc1189d 100644 (file)
@@ -211,10 +211,6 @@ int bnxt_representor_init(struct rte_eth_dev *eth_dev, void *params)
        PMD_DRV_LOG(INFO, "calling bnxt_print_link_info\n");
        bnxt_print_link_info(eth_dev);
 
-       /* Pass the information to the rte_eth_dev_close() that it should also
-        * release the private port resources.
-        */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
        PMD_DRV_LOG(INFO,
                    "Switch domain id %d: Representor Device %d init done\n",
                    vf_rep_bp->switch_domain_id, vf_rep_bp->vf_id);
index a9ed5d8..1f761c7 100644 (file)
@@ -3209,7 +3209,6 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode)
        }
 
        internals = eth_dev->data->dev_private;
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
        eth_dev->data->nb_rx_queues = (uint16_t)1;
        eth_dev->data->nb_tx_queues = (uint16_t)1;
 
index da4ae25..53b08a6 100644 (file)
@@ -2142,8 +2142,6 @@ allocate_mac:
                        goto out_free;
                }
 
-               pi->eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
                if (i > 0) {
                        /* First port will be notified by upper layer */
                        rte_eth_dev_probing_finish(eth_dev);
index 35d8734..9ee0605 100644 (file)
@@ -261,8 +261,6 @@ allocate_mac:
                        goto out_free;
                }
 
-               pi->eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
                if (i > 0) {
                        /* First port will be notified by upper layer */
                        rte_eth_dev_probing_finish(eth_dev);
index 8f98668..a01c8f3 100644 (file)
@@ -2127,7 +2127,6 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv,
 
        qman_ern_register_cb(dpaa_free_mbuf);
 
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
        if (dpaa_drv->drv_flags & RTE_DPAA_DRV_INTR_LSC)
                eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
 
index 7bd3208..d862451 100644 (file)
@@ -2793,7 +2793,6 @@ rte_dpaa2_probe(struct rte_dpaa2_driver *dpaa2_drv,
        dpaa2_dev->eth_dev = eth_dev;
        eth_dev->data->rx_mbuf_alloc_failed = 0;
 
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
        if (dpaa2_drv->drv_flags & RTE_DPAA2_DRV_INTR_LSC)
                eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
 
index 2d0e071..6a6ae0e 100644 (file)
@@ -297,11 +297,6 @@ eth_em_dev_init(struct rte_eth_dev *eth_dev)
        rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.addr,
                eth_dev->data->mac_addrs);
 
-       /* Pass the information to the rte_eth_dev_close() that it should also
-        * release the private port resources.
-        */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        /* initialize the vfta */
        memset(shadow_vfta, 0, sizeof(*shadow_vfta));
 
index 9e4aefe..f877820 100644 (file)
@@ -841,11 +841,6 @@ eth_igb_dev_init(struct rte_eth_dev *eth_dev)
        rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.addr,
                        &eth_dev->data->mac_addrs[0]);
 
-       /* Pass the information to the rte_eth_dev_close() that it should also
-        * release the private port resources.
-        */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        /* initialize the vfta */
        memset(shadow_vfta, 0, sizeof(*shadow_vfta));
 
@@ -997,11 +992,6 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev)
                return -ENOMEM;
        }
 
-       /* Pass the information to the rte_eth_dev_close() that it should also
-        * release the private port resources.
-        */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        /* Generate a random MAC address, if none was assigned by PF. */
        if (rte_is_zero_ether_addr(perm_addr)) {
                rte_eth_random_addr(perm_addr->addr_bytes);
index 8c0dd30..ae410d1 100644 (file)
@@ -1883,12 +1883,6 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)
                        get_feat_ctx.dev_attr.mac_addr,
                        (struct rte_ether_addr *)adapter->mac_addr);
 
-       /*
-        * Pass the information to the rte_eth_dev_close() that it should also
-        * release the private port resources.
-        */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        adapter->drv_stats = rte_zmalloc("adapter stats",
                                         sizeof(*adapter->drv_stats),
                                         RTE_CACHE_LINE_SIZE);
index afb658d..325c93b 100644 (file)
@@ -877,7 +877,6 @@ enetc_dev_init(struct rte_eth_dev *eth_dev)
        eth_dev->dev_ops = &enetc_ops;
        eth_dev->rx_pkt_burst = &enetc_recv_pkts;
        eth_dev->tx_pkt_burst = &enetc_xmit_pkts;
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
 
        /* Retrieving and storing the HW base address of device */
        hw->hw.reg = (void *)pci_dev->mem_resource[0].addr;
index ed03d53..27f60b4 100644 (file)
@@ -1292,8 +1292,6 @@ static int eth_enic_dev_init(struct rte_eth_dev *eth_dev,
        enic->port_id = eth_dev->data->port_id;
        enic->rte_dev = eth_dev;
        enic->dev_data = eth_dev->data;
-       /* Let rte_eth_dev_close() release the port resources */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
 
        pdev = RTE_ETH_DEV_TO_PCI(eth_dev);
        rte_eth_copy_pci_info(eth_dev, pdev);
index c528be2..169c611 100644 (file)
@@ -670,8 +670,7 @@ int enic_vf_representor_init(struct rte_eth_dev *eth_dev, void *init_params)
 
        eth_dev->device->driver = pf->rte_dev->device->driver;
        eth_dev->dev_ops = &enic_vf_representor_dev_ops;
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR
-               | RTE_ETH_DEV_CLOSE_REMOVE;
+       eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
        eth_dev->data->representor_id = vf->vf_id;
        eth_dev->data->mac_addrs = rte_zmalloc("enic_mac_addr_vf",
                sizeof(struct rte_ether_addr) *
index 44d47e8..b921e10 100644 (file)
@@ -180,7 +180,6 @@ fs_eth_dev_create(struct rte_vdev_device *vdev)
                ERROR("Unable to allocate rte_eth_dev");
                return -1;
        }
-       dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
        priv = PRIV(dev);
        priv->data = dev->data;
        priv->rxp = FS_RX_PROXY_INIT;
index 7eb4d67..3719398 100644 (file)
@@ -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) {
index 469fbba..7e0e6d8 100644 (file)
@@ -3129,12 +3129,6 @@ static int hinic_func_init(struct rte_eth_dev *eth_dev)
                goto mc_addr_fail;
        }
 
-       /*
-        * Pass the information to the rte_eth_dev_close() that it should also
-        * release the private port resources.
-        */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        /* create hardware nic_device */
        rc = hinic_nic_dev_create(eth_dev);
        if (rc) {
index d51adac..c247583 100644 (file)
@@ -5695,11 +5695,6 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)
                            &eth_dev->data->mac_addrs[0]);
 
        hw->adapter_state = HNS3_NIC_INITIALIZED;
-       /*
-        * Pass the information to the rte_eth_dev_close() that it should also
-        * release the private port resources.
-        */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
 
        if (rte_atomic16_read(&hns->hw.reset.schedule) == SCHEDULE_PENDING) {
                hns3_err(hw, "Reschedule reset service after dev_init");
index 2327d47..fec609c 100644 (file)
@@ -2702,11 +2702,6 @@ hns3vf_dev_init(struct rte_eth_dev *eth_dev)
                            &eth_dev->data->mac_addrs[0]);
 
        hw->adapter_state = HNS3_NIC_INITIALIZED;
-       /*
-        * Pass the information to the rte_eth_dev_close() that it should also
-        * release the private port resources.
-        */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
 
        if (rte_atomic16_read(&hns->hw.reset.schedule) == SCHEDULE_PENDING) {
                hns3_err(hw, "Reschedule reset service after dev_init");
index f8c64c1..a8e8f6b 100644 (file)
@@ -1699,11 +1699,6 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)
        rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.perm_addr,
                                        &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;
-
        /* Init dcb to sw mode by default */
        ret = i40e_dcb_init_configure(dev, TRUE);
        if (ret != I40E_SUCCESS) {
index 61aad8c..4aaf419 100644 (file)
@@ -1586,11 +1586,6 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
        hw->adapter_stopped = 1;
        hw->adapter_closed = 0;
 
-       /* Pass the information to the rte_eth_dev_close() that it should also
-        * release the private port resources.
-        */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        if(i40evf_init_vf(eth_dev) != 0) {
                PMD_INIT_LOG(ERR, "Init vf failed");
                return -1;
index 8f46c45..512ade2 100644 (file)
@@ -1412,11 +1412,6 @@ iavf_dev_init(struct rte_eth_dev *eth_dev)
        adapter->eth_dev = eth_dev;
        adapter->stopped = 1;
 
-       /* Pass the information to the rte_eth_dev_close() that it should also
-        * release the private port resources.
-        */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        if (iavf_init_vf(eth_dev) != 0) {
                PMD_INIT_LOG(ERR, "Init vf failed");
                return -1;
index 5b626cb..33dd0c4 100644 (file)
@@ -908,8 +908,6 @@ ice_dcf_dev_init(struct rte_eth_dev *eth_dev)
        if (rte_eal_process_type() != RTE_PROC_PRIMARY)
                return 0;
 
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        adapter->real_hw.vc_event_msg_cb = ice_dcf_handle_pf_event_msg;
        if (ice_dcf_init_hw(eth_dev, &adapter->real_hw) != 0) {
                PMD_INIT_LOG(ERR, "Failed to init DCF hardware");
index adf509b..72375fe 100644 (file)
@@ -2198,11 +2198,6 @@ ice_dev_init(struct rte_eth_dev *dev)
                goto err_init_mac;
        }
 
-       /* 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;
-
        ret = ice_res_pool_init(&pf->msix_pool, 1,
                                hw->func_caps.common_cap.num_msix_vectors - 1);
        if (ret) {
index 11397c5..9d27fc0 100644 (file)
@@ -1323,11 +1323,6 @@ eth_igc_dev_init(struct rte_eth_dev *dev)
                goto err_late;
        }
 
-       /* 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;
-
        hw->mac.get_link_status = 1;
        igc->stopped = 0;
 
index ce766e6..a078478 100644 (file)
@@ -1248,11 +1248,6 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
                return -ENOMEM;
        }
 
-       /* Pass the information to the rte_eth_dev_close() that it should also
-        * release the private port resources.
-        */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        /* initialize the vfta */
        memset(shadow_vfta, 0, sizeof(*shadow_vfta));
 
@@ -1663,11 +1658,6 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev)
                return -ENOMEM;
        }
 
-       /* Pass the information to the rte_eth_dev_close() that it should also
-        * release the private port resources.
-        */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        /* Generate a random MAC address, if none was assigned by PF. */
        if (rte_is_zero_ether_addr(perm_addr)) {
                generate_random_mac_addr(perm_addr);
index aa365a5..45ab1b1 100644 (file)
@@ -387,8 +387,6 @@ eth_kni_create(struct rte_vdev_device *vdev,
        data->promiscuous = 1;
        data->all_multicast = 1;
 
-       data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        rte_eth_random_addr(internals->eth_addr.addr_bytes);
 
        eth_dev->dev_ops = &eth_kni_ops;
index 1a2411c..ff8a580 100644 (file)
@@ -1527,9 +1527,6 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,
                eth_dev->tx_pkt_burst = eth_memif_tx;
        }
 
-
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        rte_eth_dev_probing_finish(eth_dev);
 
        return 0;
index ad7c805..3e57875 100644 (file)
@@ -1027,7 +1027,6 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
                        ERROR("can not allocate rte ethdev");
                        goto port_error;
                }
-               eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
                eth_dev->data->dev_private = priv;
                eth_dev->data->mac_addrs = priv->mac;
                eth_dev->device = &pci_dev->device;
index 81a2e99..188a6d4 100644 (file)
@@ -1171,8 +1171,6 @@ err_secondary:
                err = ENOMEM;
                goto error;
        }
-       /* Flag to call rte_eth_dev_release_port() in rte_eth_dev_close(). */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
        if (priv->representor) {
                eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
                eth_dev->data->representor_id = priv->representor_id;
index eebcdb8..db142be 100644 (file)
@@ -834,9 +834,6 @@ mvneta_eth_dev_create(struct rte_vdev_device *vdev, const char *name)
        mvneta_set_tx_function(eth_dev);
        eth_dev->dev_ops = &mvneta_ops;
 
-       /* Flag to call rte_eth_dev_release_port() in rte_eth_dev_close(). */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        rte_eth_dev_probing_finish(eth_dev);
        return 0;
 out_free:
index 27f7cfb..cfb97e4 100644 (file)
@@ -2863,9 +2863,6 @@ mrvl_eth_dev_create(struct rte_vdev_device *vdev, const char *name)
        mrvl_set_tx_function(eth_dev);
        eth_dev->dev_ops = &mrvl_ops;
 
-       /* Flag to call rte_eth_dev_release_port() in rte_eth_dev_close(). */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        rte_eth_dev_probing_finish(eth_dev);
        return 0;
 out_free:
index 8968036..15d6e97 100644 (file)
@@ -123,9 +123,6 @@ eth_dev_vmbus_allocate(struct rte_vmbus_device *dev, size_t private_data_size)
        eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
        eth_dev->intr_handle = &dev->intr_handle;
 
-       /* allow ethdev to remove on close */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        return eth_dev;
 }
 
index c3c3d00..d937ac6 100644 (file)
@@ -457,9 +457,6 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)
                rte_kvargs_free(kvlist);
        }
 
-       /* Let rte_eth_dev_close() release the port resources */
-       dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        /*
         * Get number of available DMA RX and TX queues, which is maximum
         * number of queues that can be created and store it in private device
index 84c1d0c..7c3c76a 100644 (file)
@@ -548,7 +548,6 @@ eth_dev_null_create(struct rte_vdev_device *dev, struct pmd_options *args)
        data->mac_addrs = &internals->eth_addr;
        data->promiscuous = 1;
        data->all_multicast = 1;
-       data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
 
        eth_dev->dev_ops = &ops;
 
index 48ce3e1..a263f45 100644 (file)
@@ -1374,7 +1374,6 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev,
        data->promiscuous = 0;
        data->all_multicast = 0;
        data->scattered_rx = 0;
-       data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
 
        /* Get maximum number of supported MAC entries */
        max_entries = octeontx_bgx_port_mac_entries_get(nic->port_id);
index de291db..03d81fa 100644 (file)
@@ -2424,7 +2424,6 @@ otx2_eth_dev_init(struct rte_eth_dev *eth_dev)
        pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
 
        rte_eth_copy_pci_info(eth_dev, pci_dev);
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
 
        /* Zero out everything after OTX2_DEV to allow proper dev_reset() */
        memset(&dev->otx2_eth_dev_data_start, 0, sizeof(*dev) -
index 909eef8..da49880 100644 (file)
@@ -1334,7 +1334,6 @@ eth_from_pcaps(struct rte_vdev_device *vdev,
        else
                eth_dev->tx_pkt_burst = eth_tx_drop;
 
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
        rte_eth_dev_probing_finish(eth_dev);
        return 0;
 }
index 55f2fea..bb2ae0d 100644 (file)
@@ -846,8 +846,6 @@ pfe_eth_init(struct rte_vdev_device *vdev, struct pfe *pfe, int id)
        eth_dev->data->nb_rx_queues = 1;
        eth_dev->data->nb_tx_queues = 1;
 
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        /* For link status, open the PFE CDEV; Error from this function
         * is silently ignored; In case of error, the link status will not
         * be available.
index 1a95c01..548497f 100644 (file)
@@ -2746,11 +2746,6 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
                qed_ops->sriov_configure(edev, pci_dev->max_vfs);
        }
 
-       /* Pass the information to the rte_eth_dev_close() that it should also
-        * release the private port resources.
-        */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        DP_INFO(edev, "MAC address : %02x:%02x:%02x:%02x:%02x:%02x\n",
                adapter->primary_mac.addr_bytes[0],
                adapter->primary_mac.addr_bytes[1],
index ed0fdeb..12046f5 100644 (file)
@@ -358,7 +358,6 @@ do_eth_dev_ring_create(const char *name,
 
        eth_dev->dev_ops = &ops;
        data->numa_node = numa_node;
-       data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
 
        /* finally assign rx and tx ops */
        eth_dev->rx_pkt_burst = eth_ring_rx;
index b6b0a1a..f682843 100644 (file)
@@ -343,7 +343,7 @@ sfc_dev_close(struct rte_eth_dev *dev)
        }
 
        /*
-        * Cleanup all resources in accordance with RTE_ETH_DEV_CLOSE_REMOVE.
+        * Cleanup all resources.
         * Rollback primary process sfc_eth_dev_init() below.
         */
 
@@ -2192,8 +2192,6 @@ sfc_eth_dev_init(struct rte_eth_dev *dev)
 
        sfc_log_init(sa, "entry");
 
-       dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        dev->data->mac_addrs = rte_zmalloc("sfc", RTE_ETHER_ADDR_LEN, 0);
        if (dev->data->mac_addrs == NULL) {
                rc = ENOMEM;
index ad9e2aa..e942df7 100644 (file)
@@ -390,7 +390,6 @@ pmd_ethdev_register(struct rte_vdev_device *vdev,
        dev->device = &vdev->device;
 
        /* dev->data */
-       dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
        dev->data->dev_private = dev_private;
        dev->data->dev_link.link_speed = ETH_SPEED_NUM_100G;
        dev->data->dev_link.link_duplex = ETH_LINK_FULL_DUPLEX;
index daa40cf..4325b9a 100644 (file)
@@ -1488,9 +1488,6 @@ rte_szedata2_eth_dev_init(struct rte_eth_dev *dev, struct port_info *pi)
        PMD_INIT_LOG(INFO, "Initializing eth_dev %s (driver %s)", data->name,
                        RTE_STR(RTE_SZEDATA2_DRIVER_NAME));
 
-       /* Let rte_eth_dev_close() release the port resources */
-       dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        /* Fill internal private structure. */
        internals->dev = dev;
        /* Get index of szedata2 device file and create path to device file */
index 0d217f1..b127ce6 100644 (file)
@@ -1922,7 +1922,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
        /* Setup some default values */
        data = dev->data;
        data->dev_private = pmd;
-       data->dev_flags = RTE_ETH_DEV_INTR_LSC | RTE_ETH_DEV_CLOSE_REMOVE;
+       data->dev_flags = RTE_ETH_DEV_INTR_LSC;
        data->numa_node = numa_node;
 
        data->dev_link = pmd_link;
index f67f4db..45552ef 100644 (file)
@@ -1443,7 +1443,7 @@ eth_dev_vhost_create(struct rte_vdev_device *dev, char *iface_name,
        internal->flags = flags;
        internal->disable_flags = disable_flags;
        data->dev_link = pmd_link;
-       data->dev_flags = RTE_ETH_DEV_INTR_LSC | RTE_ETH_DEV_CLOSE_REMOVE;
+       data->dev_flags = RTE_ETH_DEV_INTR_LSC;
        data->promiscuous = 1;
        data->all_multicast = 1;
 
index 0787337..b6ed582 100644 (file)
@@ -1924,11 +1924,6 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev)
        if (ret < 0)
                return ret;
        hw->speed = speed;
-       /*
-        * Pass the information to the rte_eth_dev_close() that it should also
-        * release the private port resources.
-        */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
 
        /* Allocate memory for storing MAC addresses */
        eth_dev->data->mac_addrs = rte_zmalloc("virtio",
index 17fed0e..34a169d 100644 (file)
@@ -321,9 +321,6 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
                     hw->perm_addr[0], hw->perm_addr[1], hw->perm_addr[2],
                     hw->perm_addr[3], hw->perm_addr[4], hw->perm_addr[5]);
 
-       /* Flag to call rte_eth_dev_release_port() in rte_eth_dev_close(). */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        /* Put device in Quiesce Mode */
        VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_QUIESCE_DEV);
 
index d12d74d..d766811 100644 (file)
@@ -1720,22 +1720,7 @@ rte_eth_dev_close(uint16_t port_id)
        (*dev->dev_ops->dev_close)(dev);
 
        rte_ethdev_trace_close(port_id);
-       /* check behaviour flag - temporary for PMD migration */
-       if ((dev->data->dev_flags & RTE_ETH_DEV_CLOSE_REMOVE) != 0) {
-               /* new behaviour: send event + reset state + free all data */
-               rte_eth_dev_release_port(dev);
-               return;
-       }
-       RTE_ETHDEV_LOG(DEBUG, "Port closing is using an old behaviour.\n"
-                       "The driver %s should migrate to the new behaviour.\n",
-                       dev->device->driver->name);
-       /* old behaviour: only free queue arrays */
-       dev->data->nb_rx_queues = 0;
-       rte_free(dev->data->rx_queues);
-       dev->data->rx_queues = NULL;
-       dev->data->nb_tx_queues = 0;
-       rte_free(dev->data->tx_queues);
-       dev->data->tx_queues = NULL;
+       rte_eth_dev_release_port(dev);
 }
 
 int
index 9759f13..d2bf74f 100644 (file)
@@ -1654,11 +1654,6 @@ struct rte_eth_dev_owner {
        char name[RTE_ETH_MAX_OWNER_NAME_LEN]; /**< The owner name. */
 };
 
-/**
- * Port is released (i.e. totally freed and data erased) on close.
- * Temporary flag for PMD migration to new rte_eth_dev_close() behaviour.
- */
-#define RTE_ETH_DEV_CLOSE_REMOVE 0x0001
 /** Device supports link state interrupt */
 #define RTE_ETH_DEV_INTR_LSC     0x0002
 /** Device is a bonded slave */
@@ -2282,8 +2277,7 @@ int rte_eth_dev_set_link_down(uint16_t port_id);
 
 /**
  * Close a stopped Ethernet device. The device cannot be restarted!
- * The function frees all port resources if the driver supports
- * the flag RTE_ETH_DEV_CLOSE_REMOVE.
+ * The function frees all port resources.
  *
  * @param port_id
  *   The port identifier of the Ethernet device.