mbox series

[v1,0/2] ethdev: fix skip valid port in probing callback

Message ID 20250113025521.32703-1-lihuisong@huawei.com (mailing list archive)
Headers
Series ethdev: fix skip valid port in probing callback |

Message

Huisong Li Jan. 13, 2025, 2:55 a.m. UTC
After we check the validity of the port in eth_event_callback() of testpmd
like patch 1/2, testpmd attach one port and doesn't update total port
number maintained in testmd. See the following log:
---
testpmd>
testpmd> port attach 0000:7d:00.1
Attaching a new port...
testpmd>
testpmd> port start all
Port 0 is now not stopped
ETHDEV: Device with port_id=1 is not configured.
Fail to start port 1: Invalid argument
Done
---

For details about the root cause of this issue, please see the patch 2/2.
After merging the patch 2/2. this issue can be fixed and the log is as
follows:
---
testpmd>
testpmd> port attach 0000:7d:00.1
Attaching a new port...
Port 1 is attached. Now total ports is 2
Done
---

BTW, the modification method for this issue is from the following thread.
https://mails.dpdk.org/archives/dev/2024-January/286026.html

Huisong Li (2):
  app/testpmd: check the validity of the port
  ethdev: fix skip valid port in probing callback

 app/test-pmd/testpmd.c           |  5 +++--
 drivers/net/bnxt/bnxt_ethdev.c   |  2 +-
 drivers/net/cpfl/cpfl_ethdev.h   |  2 +-
 drivers/net/ionic/ionic_ethdev.c |  2 +-
 drivers/net/mlx5/mlx5.c          |  2 +-
 drivers/net/nfp/nfp_ethdev.c     |  4 ++--
 lib/ethdev/ethdev_driver.c       | 13 ++++++++++---
 lib/ethdev/ethdev_driver.h       | 12 ++++++++++++
 lib/ethdev/ethdev_pci.h          |  2 +-
 lib/ethdev/rte_class_eth.c       |  2 +-
 lib/ethdev/rte_ethdev.c          |  4 ++--
 lib/ethdev/rte_ethdev.h          |  4 +++-
 lib/ethdev/version.map           |  1 +
 13 files changed, 39 insertions(+), 16 deletions(-)