Skip to content

Commit

Permalink
net/txgbe: check process type in close operation
Browse files Browse the repository at this point in the history
[ upstream commit 21ed282505ed8f60f03a93a27ac01f4152b8ab40 ]

The secondary processes are not allowed to release shared resources.
Only process-private resources should be freed in a secondary process.
Most of the time, there is no process-private resource,
so the close operation is just forbidden in a secondary process.

Fixes: e1698e3 ("net/txgbe: add device init and uninit")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
  • Loading branch information
Jiawen Wu authored and bluca committed Oct 18, 2023
1 parent e63070e commit 9a7af96
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/txgbe/txgbe_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1783,6 +1783,9 @@ txgbe_dev_close(struct rte_eth_dev *dev)

PMD_INIT_FUNC_TRACE();

if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return 0;

txgbe_pf_reset_hw(hw);

ret = txgbe_dev_stop(dev);
Expand Down

0 comments on commit 9a7af96

Please sign in to comment.