patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH v2] net/i40e: fix request queue fail in VF
@ 2019-08-29 16:26 taox.zhu
  0 siblings, 0 replies; 3+ messages in thread
From: taox.zhu @ 2019-08-29 16:26 UTC (permalink / raw)
  To: alvinx.zhang; +Cc: Zhu Tao, stable

From: Zhu Tao <taox.zhu@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@dpdk.org

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

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 5be32b069..3b9740c08 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1332,6 +1332,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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [PATCH v2] net/i40e: fix request queue fail in VF
  2019-07-19  3:18 ` taox.zhu
@ 2019-07-23  6:52   ` Zhang, Qi Z
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Qi Z @ 2019-07-23  6:52 UTC (permalink / raw)
  To: Zhu, TaoX, Xing, Beilei; +Cc: dev, stable



> -----Original Message-----
> From: Zhu, TaoX
> Sent: Friday, July 19, 2019 11:18 AM
> To: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Zhu, TaoX <taox.zhu@intel.com>; stable@dpdk.org
> Subject: [PATCH v2] net/i40e: fix request queue fail in VF
> 
> From: Zhu Tao <taox.zhu@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@dpdk.org
> 
> Signed-off-by: Zhu Tao <taox.zhu@intel.com>
> ---
>  drivers/net/i40e/i40e_ethdev_vf.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c
> b/drivers/net/i40e/i40e_ethdev_vf.c
> index 5be32b069..3b9740c08 100644
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -1332,6 +1332,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;

You current solution rely on we can always can get a dummy event after the VIRTCHNL_EVENT_RESET_IMPENDING event we needed, but I'm not sure if it is guaranteed

If the issue is due to the race condition between i40evf_execute_vf_cmd and i40evf_dev_alarm_handler
Why not just disable the adminq interrupt before i40evf_request_queues and enable it back after it?

> +		}
>  		break;
>  	case VIRTCHNL_EVENT_LINK_CHANGE:
>  		PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_LINK_CHANGE event");
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-stable] [PATCH v2] net/i40e: fix request queue fail in VF
       [not found] <20190718145351.13987-1-taox.zhu@intel.com>
@ 2019-07-19  3:18 ` taox.zhu
  2019-07-23  6:52   ` Zhang, Qi Z
  0 siblings, 1 reply; 3+ messages in thread
From: taox.zhu @ 2019-07-19  3:18 UTC (permalink / raw)
  To: beilei.xing, qi.z.zhang; +Cc: dev, Zhu Tao, stable

From: Zhu Tao <taox.zhu@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@dpdk.org

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

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 5be32b069..3b9740c08 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1332,6 +1332,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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-29  7:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-29 16:26 [dpdk-stable] [PATCH v2] net/i40e: fix request queue fail in VF taox.zhu
     [not found] <20190718145351.13987-1-taox.zhu@intel.com>
2019-07-19  3:18 ` taox.zhu
2019-07-23  6:52   ` Zhang, Qi Z

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).