If application verify the validity of the port id or configure this port in
the new event callback, application may happen to the port id is invalid.

Actually, when application receive a new event from one port, the port is
not fully probed and is just in allocated state. Application doesn't need
to verify the validity of the port id because it is definitely valid.
What's more, application shouldn't do something like configuring this port
or querying some information of this port by ethdev ops.

Signed-off-by: Huisong Li <lihuis...@huawei.com>
---
 lib/ethdev/rte_ethdev.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 1f71cad244..e2021f0f12 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -4128,7 +4128,14 @@ enum rte_eth_event_type {
        RTE_ETH_EVENT_VF_MBOX,  /**< message from the VF received by PF */
        RTE_ETH_EVENT_MACSEC,   /**< MACsec offload related event */
        RTE_ETH_EVENT_INTR_RMV, /**< device removal event */
-       RTE_ETH_EVENT_NEW,      /**< port is probed */
+       /** Port is probed and application's event callback will be called.
+        * In this moment, the port is not fully probed and is just in allocated
+        * state. When application receive this event, application doesn't need
+        * to verify the validity of the port id because it is definitely valid.
+        * What's more, application shouldn't do something like configuring this
+        * port or querying some information of this port by ethdev ops.
+        */
+       RTE_ETH_EVENT_NEW,
        RTE_ETH_EVENT_DESTROY,  /**< port is released */
        RTE_ETH_EVENT_IPSEC,    /**< IPsec offload related event */
        RTE_ETH_EVENT_FLOW_AGED,/**< New aged-out flows is detected */
-- 
2.22.0

Reply via email to