On 9/1/2020 6:16 PM, Rahul Lakkireddy wrote:
Enable RTE_ETH_DEV_CLOSE_REMOVE during PCI probe for all ports
enumerated under the PF. Free up the underlying port Virtual
Identifier (VI) and associated resources during port close.
Once all the ports under the PF are closed, free up the PF-wide
shared resources. Invoke port close function of all ports under
the PF, in PCI remove too.
Signed-off-by: Rahul Lakkireddy <rahul.lakkire...@chelsio.com>
<...>
@@ -1204,11 +1222,13 @@ static int eth_cxgbe_dev_init(struct rte_eth_dev
*eth_dev)
static int eth_cxgbe_dev_uninit(struct rte_eth_dev *eth_dev)
{
- struct port_info *pi = eth_dev->data->dev_private;
- struct adapter *adap = pi->adapter;
+ struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
+ uint16_t port_id;
/* Free up other ports and all resources */
- cxgbe_close(adap);
+ RTE_ETH_FOREACH_DEV_OF(port_id, &pci_dev->device)
+ rte_eth_dev_close(port_id);
Is there a reason to call the ethdev wrapper API here? Why not calling
'cxgbe_dev_close()' directly?