[dpdk-stable] [DPDK] net/i40e: fix request queue fail in VF

taox.zhu at intel.com taox.zhu at intel.com
Wed Jul 24 09:24:19 CEST 2019


From: Zhu Tao <taox.zhu at intel.com>

When the VF configuration is larger than the number of queues reserved
by PF, VF sends the request queue command through admin queue. When PF
received this command, it may reset the VF and send a notification
before resetting. If this notification is read by the timed task alarm,
Task request queue will lost notification. This patch Mark vf_reset,
pend_msg flag just as task request queue has received notification in
task alarm.

Fixes: 864a800d70 ("net/i40e: remove VF interrupt handler")
Fixes: ee653bd800 ("net/i40e: determine number of queues per VF at run time")
Cc: stable at dpdk.org

Signed-off-by: Zhu Tao <taox.zhu at intel.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 5be32b069..9bca2162b 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1051,10 +1051,14 @@ i40evf_request_queues(struct rte_eth_dev *dev, uint16_t num)
 	args.in_args_size = sizeof(vfres);
 	args.out_buffer = vf->aq_resp;
 	args.out_size = I40E_AQ_BUF_SZ;
+
+	rte_eal_alarm_cancel(i40evf_dev_alarm_handler, dev);
 	err = i40evf_execute_vf_cmd(dev, &args);
 	if (err)
 		PMD_DRV_LOG(ERR, "fail to execute command OP_REQUEST_QUEUES");
 
+	rte_eal_alarm_set(I40EVF_ALARM_INTERVAL,
+			  i40evf_dev_alarm_handler, dev);
 	return err;
 }
 
@@ -1332,6 +1336,10 @@ i40evf_handle_pf_event(struct rte_eth_dev *dev, uint8_t *msg,
 		PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_RESET_IMPENDING event");
 		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET,
 					      NULL);
+		if (!vf->vf_reset) {
+			vf->vf_reset = true;
+			vf->pend_msg |= PFMSG_RESET_IMPENDING;
+		}
 		break;
 	case VIRTCHNL_EVENT_LINK_CHANGE:
 		PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_LINK_CHANGE event");
-- 
2.17.1



More information about the stable mailing list