net/iavf: fix error of virtchnl command
PATCH v3 1/1 net/iavf: fix error of virtchnl command
When the device is bonded, bond pmd will register callback for LSC event. This callback will execute some virtchnl commands in eal-intr-thread to reinitialize the device with interrupts disabled. In this case, responses to all commands not be received.
This commit starts a thread to handle all events to fix this issue.
Fixes 48de41ca11f0 ("net/avf: enable link status update")
Signed-off-by Yiding Zhou <[email protected]>
---
v3: fix CI error
--- drivers/net/iavf/iavf.h | 2 + drivers/net/iavf/iavf_ethdev.c | 5 ++ drivers/net/iavf/iavf_vchnl.c | 134 ++++++++++++++++++++++++++++++++- 3 files changed, 140 insertions(+), 1 deletion(-)
drivers/net/iavf/iavf.h +2 -0
@@ -424,6 +424,8 @@ _atomic_set_async_response_cmd(struct iavf_info *vf, enum virtchnl_ops ops) }int iavf_check_api_version (struct iavf_adapter *adapter);int iavf_get_vf_resource (struct iavf_adapter *adapter); +void iavf_dev_event_handler_fini (void ); +int iavf_dev_event_handler_init (void );void iavf_handle_virtchnl_msg (struct rte_eth_dev *dev);int iavf_enable_vlan_strip (struct iavf_adapter *adapter);int iavf_disable_vlan_strip (struct iavf_adapter *adapter);
drivers/net/iavf/iavf_ethdev.c +5 -0
@@ -2631,6 +2631,9 @@ iavf_dev_init(struct rte_eth_dev *eth_dev)rte_ether_addr_copy ((struct rte_ether_addr *)hw->mac.addr, ð_dev->data->mac_addrs[0 ]); +if (iavf_dev_event_handler_init ()) + goto init_vf_err; +if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_WB_ON_ITR ) {/* register callback func to eal lib */ rte_intr_callback_register(pci_dev->intr_handle,
@@ -2785,6 +2788,8 @@ iavf_dev_uninit(struct rte_eth_dev *dev)iavf_dev_close (dev); +iavf_dev_event_handler_fini (); +return 0 ; }
drivers/net/iavf/iavf_vchnl.c +133 -1
158 lines not on this page · raw message
Signature · 1 line
2.34.1