Skip to contentSkip to conversation

net/iavf: fix abnormal disable HW interrupt

PATCH Superseded Mingjin Ye 2 participants 7 messages Jun 8, 2023 – Jun 15, 2023 Network drivers

lore
Share & tools
lore

Mingjin Ye

author
#0 lore raw

PATCH 1/1 net/iavf: fix abnormal disable HW interrupt

For command VIRTCHNL_OP_REQUEST_QUEUES, polling access to the admin queue has the issue of access overruns after disabling interrupt. That results in FW disabling HW interrupt for protection purposes.

The updates/changes in this patch:
1. Remove the polling admin queue processing and use the generic interrupt processing instead.
2. Release redundant queue resource before stopping processing interrupt events.

Fixes 22b123a36d07 ("net/avf: initialize PMD")
Fixes ef807926e148 ("net/iavf: support requesting additional queues from PF")
Fixes 84108425054a ("net/iavf: support asynchronous virtual channel message")
---
 drivers/net/iavf/iavf_ethdev.c | 25 +++++++++---------
 drivers/net/iavf/iavf_vchnl.c  | 48 +++++++---------------------------
 2 files changed, 23 insertions(+), 50 deletions(-)
drivers/net/iavf/iavf_ethdev.c +13 -12
index e6cf897293..ba5c88a1ec 100644
@@ -2756,6 +2756,19 @@ iavf_dev_close(struct rte_eth_dev *dev)
 	}
 
 	ret = iavf_dev_stop(dev);
+
+	/*
+	 * Release redundant queue resource when close the dev
+	 * so that other vfs can re-use the queues.
+	 */
+	if (vf->lv_enabled) {
+		ret = iavf_request_queues(dev, IAVF_MAX_NUM_QUEUES_DFLT);
+		if (ret)
+			PMD_DRV_LOG(ERR, "Reset the num of queues failed");
+
+		vf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT;
+	}
+
 	adapter->closed = true;
 
 	/* free iAVF security device context all related resources */
@@ -2772,18 +2785,6 @@ iavf_dev_close(struct rte_eth_dev *dev)
 	if (vf->promisc_unicast_enabled || vf->promisc_multicast_enabled)
 		iavf_config_promisc(adapter, false, false);
 
-	/*
-	 * Release redundant queue resource when close the dev
-	 * so that other vfs can re-use the queues.
-	 */
-	if (vf->lv_enabled) {
-		ret = iavf_request_queues(dev, IAVF_MAX_NUM_QUEUES_DFLT);
-		if (ret)
-			PMD_DRV_LOG(ERR, "Reset the num of queues failed");
-
-		vf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT;
-	}
-
 	iavf_shutdown_adminq(hw);
 	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) {
 		/* disable uio intr before callback unregister */
drivers/net/iavf/iavf_vchnl.c +10 -38

82 lines not on this page · raw message

Signature · 1 line
2.25.1
#1 lore raw
Quoted 95 lines

-----Original Message-----
From: Mingjin Ye <[email protected]>
Sent: Thursday, June 8, 2023 2:23 PM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Zhou, YidingX <[email protected]>; Ye, MingjinX <[email protected]>; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: [PATCH] net/iavf: fix abnormal disable HW interrupt

For command VIRTCHNL_OP_REQUEST_QUEUES, polling access to the admin queue has the issue of access overruns after disabling interrupt. That results in FW disabling HW interrupt for protection purposes.

The updates/changes in this patch:
1. Remove the polling admin queue processing and use the generic interrupt processing instead.
2. Release redundant queue resource before stopping processing interrupt events.

Fixes 22b123a36d07 ("net/avf: initialize PMD")
Fixes ef807926e148 ("net/iavf: support requesting additional queues from

PF")

Fixes 84108425054a ("net/iavf: support asynchronous virtual channel

message")
Cc: [email protected]

---
 drivers/net/iavf/iavf_ethdev.c | 25 +++++++++---------
drivers/net/iavf/iavf_vchnl.c  | 48 +++++++---------------------------
 2 files changed, 23 insertions(+), 50 deletions(-)
drivers/net/iavf/iavf_ethdev.c +13 -0
index e6cf897293..ba5c88a1ec 100644
@@ -2756,6 +2756,19 @@ iavf_dev_close(struct rte_eth_dev *dev)
 	}
 
 	ret = iavf_dev_stop(dev);
+
+	/*
+	 * Release redundant queue resource when close the dev
+	 * so that other vfs can re-use the queues.
+	 */
+	if (vf->lv_enabled) {
+		ret = iavf_request_queues(dev,
 IAVF_MAX_NUM_QUEUES_DFLT);
+		if (ret)
+			PMD_DRV_LOG(ERR, "Reset the num of queues
 failed");
+
+		vf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT;
+	}
+
 	adapter->closed = true;

/* free iAVF security device context all related resources */ @@ -
2772,18 +2785,6 @@ iavf_dev_close(struct rte_eth_dev *dev)

drivers/net/iavf/iavf_ethdev.c +0 -6
 	if (vf->promisc_unicast_enabled || vf->promisc_multicast_enabled)
 		iavf_config_promisc(adapter, false, false);
 
-	/*
-	 * Release redundant queue resource when close the dev
-	 * so that other vfs can re-use the queues.
-	 */
-	if (vf->lv_enabled) {
-		ret = iavf_request_queues(dev,

IAVF_MAX_NUM_QUEUES_DFLT);

drivers/net/iavf/iavf_ethdev.c +0 -2
-		if (ret)
-			PMD_DRV_LOG(ERR, "Reset the num of queues

failed");

drivers/net/iavf/iavf_ethdev.c +0 -4
-
-		vf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT;
-	}
-
 	iavf_shutdown_adminq(hw);
 	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR)

{
/* disable uio intr before callback unregister */ diff --git
a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index 8cc5377bcf..579c0d0d70 100644

drivers/net/iavf/iavf_vchnl.c +1 -0
@@ -323,6 +323,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter,
 struct iavf_cmd_info *args,
 
 	switch (args->ops) {
 	case VIRTCHNL_OP_RESET_VF:
+	case VIRTCHNL_OP_REQUEST_QUEUES:
 		/*no need to wait for response */
 		_clear_cmd(vf);
Quoted 1 line

break;

Have you tested the "large VF" case ( > 16 queue) with this patch.
I assume event VIRTCHNL_EVENT_RESET_IMPENDING need to be handled here then to trigger a device reset. But I didn't see related part in your patch.

#2 lore raw
Quoted 104 lines

-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: 2023年6月9日 9:48
To: Ye, MingjinX <[email protected]>; [email protected]
Cc: Yang, Qiming <[email protected]>; Zhou, YidingX <[email protected]>; Ye, MingjinX <[email protected]>; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: RE: [PATCH] net/iavf: fix abnormal disable HW interrupt

Quoted 11 lines

-----Original Message-----
From: Mingjin Ye <[email protected]>
Sent: Thursday, June 8, 2023 2:23 PM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Zhou, YidingX <[email protected]>; Ye, MingjinX <[email protected]>; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: [PATCH] net/iavf: fix abnormal disable HW interrupt

For command VIRTCHNL_OP_REQUEST_QUEUES, polling access to the

admin

Quoted 63 lines

queue has the issue of access overruns after disabling interrupt. That results in FW disabling HW interrupt for protection purposes.

The updates/changes in this patch:
1. Remove the polling admin queue processing and use the generic interrupt processing instead.
2. Release redundant queue resource before stopping processing interrupt events.

Fixes 22b123a36d07 ("net/avf: initialize PMD")
Fixes ef807926e148 ("net/iavf: support requesting additional queues

from
PF")

Fixes 84108425054a ("net/iavf: support asynchronous virtual channel

message")
Cc: [email protected]

---
 drivers/net/iavf/iavf_ethdev.c | 25 +++++++++---------
drivers/net/iavf/iavf_vchnl.c  | 48 +++++++---------------------------
 2 files changed, 23 insertions(+), 50 deletions(-)
(quoted diff) +0 -0

b/drivers/net/iavf/iavf_ethdev.c index e6cf897293..ba5c88a1ec 100644

drivers/net/iavf/iavf_ethdev.c +13 -0
@@ -2756,6 +2756,19 @@ iavf_dev_close(struct rte_eth_dev *dev)
 	}
 
 	ret = iavf_dev_stop(dev);
+
+	/*
+	 * Release redundant queue resource when close the dev
+	 * so that other vfs can re-use the queues.
+	 */
+	if (vf->lv_enabled) {
+		ret = iavf_request_queues(dev,
 IAVF_MAX_NUM_QUEUES_DFLT);
+		if (ret)
+			PMD_DRV_LOG(ERR, "Reset the num of queues
 failed");
+
+		vf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT;
+	}
+
 	adapter->closed = true;

/* free iAVF security device context all related resources */ @@ -
2772,18 +2785,6 @@ iavf_dev_close(struct rte_eth_dev *dev)

drivers/net/iavf/iavf_ethdev.c +0 -6
 	if (vf->promisc_unicast_enabled || vf->promisc_multicast_enabled)
 		iavf_config_promisc(adapter, false, false);
 
-	/*
-	 * Release redundant queue resource when close the dev
-	 * so that other vfs can re-use the queues.
-	 */
-	if (vf->lv_enabled) {
-		ret = iavf_request_queues(dev,

IAVF_MAX_NUM_QUEUES_DFLT);

drivers/net/iavf/iavf_ethdev.c +0 -2
-		if (ret)
-			PMD_DRV_LOG(ERR, "Reset the num of queues

failed");

drivers/net/iavf/iavf_ethdev.c iavf_dev_close(struct rte_eth_dev *dev)

Quoted 6 lines
drivers/net/iavf/iavf_ethdev.c +0 -4
-
-		vf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT;
-	}
-
 	iavf_shutdown_adminq(hw);
 	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR)

{

Quoted 8 lines

/* disable uio intr before callback unregister */ diff --git
a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index 8cc5377bcf..579c0d0d70 100644

drivers/net/iavf/iavf_vchnl.c +0 -0
@@ -323,6 +323,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter,
 struct iavf_cmd_info *args,
 
Quoted 11 lines
Quoted 6 lines
drivers/net/iavf/iavf_vchnl.c +1 -0
 	switch (args->ops) {
 	case VIRTCHNL_OP_RESET_VF:
+	case VIRTCHNL_OP_REQUEST_QUEUES:
 		/*no need to wait for response */
 		_clear_cmd(vf);

break;

Have you tested the "large VF" case ( > 16 queue) with this patch. I assume event VIRTCHNL_EVENT_RESET_IMPENDING need to be handled here then to trigger a device reset.
But I didn't see related part in your patch.

The processing related to the "big VF" is moved before "adapter->closed = true;"
to make sure it can be handled correctly by the interrupt function.

#3 lore raw
Quoted 125 lines

-----Original Message-----
From: Ye, MingjinX <[email protected]>
Sent: Friday, June 9, 2023 11:20 AM
To: Zhang, Qi Z <[email protected]>; [email protected]
Cc: Yang, Qiming <[email protected]>; Zhou, YidingX <[email protected]>; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: RE: [PATCH] net/iavf: fix abnormal disable HW interrupt

Quoted 112 lines

-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: 2023年6月9日 9:48
To: Ye, MingjinX <[email protected]>; [email protected]
Cc: Yang, Qiming <[email protected]>; Zhou, YidingX <[email protected]>; Ye, MingjinX <[email protected]>; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: RE: [PATCH] net/iavf: fix abnormal disable HW interrupt

Quoted 11 lines

-----Original Message-----
From: Mingjin Ye <[email protected]>
Sent: Thursday, June 8, 2023 2:23 PM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Zhou, YidingX <[email protected]>; Ye, MingjinX <[email protected]>; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: [PATCH] net/iavf: fix abnormal disable HW interrupt

For command VIRTCHNL_OP_REQUEST_QUEUES, polling access to the

admin

Quoted 64 lines

queue has the issue of access overruns after disabling interrupt. That results in FW disabling HW interrupt for protection purposes.

The updates/changes in this patch:
1. Remove the polling admin queue processing and use the generic interrupt processing instead.
2. Release redundant queue resource before stopping processing interrupt events.

Fixes 22b123a36d07 ("net/avf: initialize PMD")
Fixes ef807926e148 ("net/iavf: support requesting additional queues

from
PF")

Fixes 84108425054a ("net/iavf: support asynchronous virtual channel

message")
Cc: [email protected]

---
 drivers/net/iavf/iavf_ethdev.c | 25 +++++++++---------
drivers/net/iavf/iavf_vchnl.c  | 48
+++++++---------------------------
 2 files changed, 23 insertions(+), 50 deletions(-)
(quoted diff) +0 -0

b/drivers/net/iavf/iavf_ethdev.c index e6cf897293..ba5c88a1ec 100644

drivers/net/iavf/iavf_ethdev.c +13 -0
@@ -2756,6 +2756,19 @@ iavf_dev_close(struct rte_eth_dev *dev)
 	}
 
 	ret = iavf_dev_stop(dev);
+
+	/*
+	 * Release redundant queue resource when close the dev
+	 * so that other vfs can re-use the queues.
+	 */
+	if (vf->lv_enabled) {
+		ret = iavf_request_queues(dev,
 IAVF_MAX_NUM_QUEUES_DFLT);
+		if (ret)
+			PMD_DRV_LOG(ERR, "Reset the num of queues
 failed");
+
+		vf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT;
+	}
+
 	adapter->closed = true;

/* free iAVF security device context all related resources */ @@ -
2772,18 +2785,6 @@ iavf_dev_close(struct rte_eth_dev *dev)

drivers/net/iavf/iavf_ethdev.c +0 -6
 	if (vf->promisc_unicast_enabled || vf->promisc_multicast_enabled)
 		iavf_config_promisc(adapter, false, false);
 
-	/*
-	 * Release redundant queue resource when close the dev
-	 * so that other vfs can re-use the queues.
-	 */
-	if (vf->lv_enabled) {
-		ret = iavf_request_queues(dev,

IAVF_MAX_NUM_QUEUES_DFLT);

drivers/net/iavf/iavf_ethdev.c +0 -2
-		if (ret)
-			PMD_DRV_LOG(ERR, "Reset the num of queues

failed");

drivers/net/iavf/iavf_ethdev.c iavf_dev_close(struct rte_eth_dev *dev)

Quoted 6 lines
drivers/net/iavf/iavf_ethdev.c +0 -4
-
-		vf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT;
-	}
-
 	iavf_shutdown_adminq(hw);
 	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR)

{

Quoted 14 lines

/* disable uio intr before callback unregister */ diff --git
a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index
8cc5377bcf..579c0d0d70 100644

drivers/net/iavf/iavf_vchnl.c +1 -0
@@ -323,6 +323,7 @@ iavf_execute_vf_cmd(struct iavf_adapter
 *adapter, struct iavf_cmd_info *args,
 
 	switch (args->ops) {
 	case VIRTCHNL_OP_RESET_VF:
+	case VIRTCHNL_OP_REQUEST_QUEUES:
 		/*no need to wait for response */
 		_clear_cmd(vf);
Quoted 1 line

break;

Have you tested the "large VF" case ( > 16 queue) with this patch.

You didn't answer my question.

Quoted 9 lines
Quoted 1 line

I assume event VIRTCHNL_EVENT_RESET_IMPENDING need to be handled

here

Quoted 2 lines

then to trigger a device reset.
But I didn't see related part in your patch.

The processing related to the "big VF" is moved before "adapter->closed = true;"
to make sure it can be handled correctly by the interrupt function.

I'm not asking what happened during dev_close but the init scenario in the large VF case,

dev_configure-> iavf_queues_req_reset-> iavf_request_queues

this happens at the situation that is no interrupt is enabled and it need to handle event VIRTCHNL_EVENT_RESET_IMPENDING

#4 lore raw
Quoted 152 lines

-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: Monday, June 12, 2023 8:40 PM
To: Ye, MingjinX <[email protected]>; [email protected]
Cc: Yang, Qiming <[email protected]>; Zhou, YidingX <[email protected]>; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: RE: [PATCH] net/iavf: fix abnormal disable HW interrupt

Quoted 126 lines

-----Original Message-----
From: Ye, MingjinX <[email protected]>
Sent: Friday, June 9, 2023 11:20 AM
To: Zhang, Qi Z <[email protected]>; [email protected]
Cc: Yang, Qiming <[email protected]>; Zhou, YidingX <[email protected]>; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: RE: [PATCH] net/iavf: fix abnormal disable HW interrupt

Quoted 115 lines

-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: 2023年6月9日 9:48
To: Ye, MingjinX <[email protected]>; [email protected]
Cc: Yang, Qiming <[email protected]>; Zhou, YidingX <[email protected]>; Ye, MingjinX <[email protected]>; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: RE: [PATCH] net/iavf: fix abnormal disable HW interrupt

Quoted 11 lines

-----Original Message-----
From: Mingjin Ye <[email protected]>
Sent: Thursday, June 8, 2023 2:23 PM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Zhou, YidingX <[email protected]>; Ye, MingjinX <[email protected]>; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: [PATCH] net/iavf: fix abnormal disable HW interrupt

For command VIRTCHNL_OP_REQUEST_QUEUES, polling access to the

admin

Quoted 67 lines

queue has the issue of access overruns after disabling interrupt. That results in FW disabling HW interrupt for protection purposes.

The updates/changes in this patch:
1. Remove the polling admin queue processing and use the generic interrupt processing instead.
2. Release redundant queue resource before stopping processing interrupt events.

Fixes 22b123a36d07 ("net/avf: initialize PMD")
Fixes ef807926e148 ("net/iavf: support requesting additional

queues from
PF")

Fixes 84108425054a ("net/iavf: support asynchronous virtual

channel
message")
Cc: [email protected]

---
 drivers/net/iavf/iavf_ethdev.c | 25 +++++++++---------
drivers/net/iavf/iavf_vchnl.c  | 48
+++++++---------------------------
 2 files changed, 23 insertions(+), 50 deletions(-)
(quoted diff) +0 -0

b/drivers/net/iavf/iavf_ethdev.c index e6cf897293..ba5c88a1ec 100644

drivers/net/iavf/iavf_ethdev.c +13 -0
@@ -2756,6 +2756,19 @@ iavf_dev_close(struct rte_eth_dev *dev)
 	}
 
 	ret = iavf_dev_stop(dev);
+
+	/*
+	 * Release redundant queue resource when close the dev
+	 * so that other vfs can re-use the queues.
+	 */
+	if (vf->lv_enabled) {
+		ret = iavf_request_queues(dev,
 IAVF_MAX_NUM_QUEUES_DFLT);
+		if (ret)
+			PMD_DRV_LOG(ERR, "Reset the num of queues
 failed");
+
+		vf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT;
+	}
+
 	adapter->closed = true;
drivers/net/iavf/iavf_ethdev.c +0 -1
 	/* free iAVF security device context all related resources */ @@
-

2772,18 +2785,6 @@ iavf_dev_close(struct rte_eth_dev *dev)

drivers/net/iavf/iavf_ethdev.c +0 -6
 	if (vf->promisc_unicast_enabled || vf->promisc_multicast_enabled)
 		iavf_config_promisc(adapter, false, false);
 
-	/*
-	 * Release redundant queue resource when close the dev
-	 * so that other vfs can re-use the queues.
-	 */
-	if (vf->lv_enabled) {
-		ret = iavf_request_queues(dev,

IAVF_MAX_NUM_QUEUES_DFLT);

drivers/net/iavf/iavf_ethdev.c +0 -2
-		if (ret)
-			PMD_DRV_LOG(ERR, "Reset the num of queues

failed");

drivers/net/iavf/iavf_ethdev.c iavf_dev_close(struct rte_eth_dev *dev)

Quoted 6 lines
drivers/net/iavf/iavf_ethdev.c +0 -4
-
-		vf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT;
-	}
-
 	iavf_shutdown_adminq(hw);
 	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR)

{

Quoted 14 lines

/* disable uio intr before callback unregister */ diff --git
a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index
8cc5377bcf..579c0d0d70 100644

drivers/net/iavf/iavf_vchnl.c +1 -0
@@ -323,6 +323,7 @@ iavf_execute_vf_cmd(struct iavf_adapter
 *adapter, struct iavf_cmd_info *args,
 
 	switch (args->ops) {
 	case VIRTCHNL_OP_RESET_VF:
+	case VIRTCHNL_OP_REQUEST_QUEUES:
 		/*no need to wait for response */
 		_clear_cmd(vf);
Quoted 1 line

break;

Have you tested the "large VF" case ( > 16 queue) with this patch.

You didn't answer my question.

Quoted 9 lines
Quoted 1 line

I assume event VIRTCHNL_EVENT_RESET_IMPENDING need to be handled

here

Quoted 2 lines

then to trigger a device reset.
But I didn't see related part in your patch.

The processing related to the "big VF" is moved before "adapter->closed = true;"
to make sure it can be handled correctly by the interrupt function.

Quoted 8 lines

I'm not asking what happened during dev_close but the init scenario in the large VF case,

dev_configure-> iavf_queues_req_reset-> iavf_request_queues

this happens at the situation that is no interrupt is enabled and it need to handle event VIRTCHNL_EVENT_RESET_IMPENDING

This is not correct, as the interrupt has already been enabled in dev_init.

But I still have question for other part of the implementation, will raise it in another thread.

author
#5 lore raw

PATCH v2 1/1 net/iavf: fix abnormal disable HW interrupt

In reply to Mingjin Ye

For command VIRTCHNL_OP_REQUEST_QUEUES, polling access to the admin queue has the issue of access overruns after disabling interrupt. That results in FW disabling HW interrupt for protection purposes.

The updates/changes in this patch:
1. Remove the polling admin queue processing and use the generic interrupt processing instead.
2. Release redundant queue resource before stopping processing interrupt events.

Fixes 22b123a36d07 ("net/avf: initialize PMD")
Fixes ef807926e148 ("net/iavf: support requesting additional queues from PF")
Fixes 84108425054a ("net/iavf: support asynchronous virtual channel message")

---
v2: Fix git version conflict.

---
 drivers/net/iavf/iavf_ethdev.c | 25 +++++++++---------
 drivers/net/iavf/iavf_vchnl.c  | 48 +++++++---------------------------
 2 files changed, 23 insertions(+), 50 deletions(-)
drivers/net/iavf/iavf_ethdev.c +13 -12
index b72dbc8ceb..00b963128b 100644
@@ -2757,6 +2757,19 @@ iavf_dev_close(struct rte_eth_dev *dev)
 	}
 
 	ret = iavf_dev_stop(dev);
+
+	/*
+	 * Release redundant queue resource when close the dev
+	 * so that other vfs can re-use the queues.
+	 */
+	if (vf->lv_enabled) {
+		ret = iavf_request_queues(dev, IAVF_MAX_NUM_QUEUES_DFLT);
+		if (ret)
+			PMD_DRV_LOG(ERR, "Reset the num of queues failed");
+
+		vf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT;
+	}
+
 	adapter->closed = true;
 
 	/* free iAVF security device context all related resources */
@@ -2773,18 +2786,6 @@ iavf_dev_close(struct rte_eth_dev *dev)
 	if (vf->promisc_unicast_enabled || vf->promisc_multicast_enabled)
 		iavf_config_promisc(adapter, false, false);
 
-	/*
-	 * Release redundant queue resource when close the dev
-	 * so that other vfs can re-use the queues.
-	 */
-	if (vf->lv_enabled) {
-		ret = iavf_request_queues(dev, IAVF_MAX_NUM_QUEUES_DFLT);
-		if (ret)
-			PMD_DRV_LOG(ERR, "Reset the num of queues failed");
-
-		vf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT;
-	}
-
 	iavf_shutdown_adminq(hw);
 	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) {
 		/* disable uio intr before callback unregister */
drivers/net/iavf/iavf_vchnl.c +10 -38

82 lines not on this page · raw message

Signature · 1 line
2.25.1
Acked-by on v2 1/1 Applied
#6 lore raw
Quoted 22 lines

-----Original Message-----
From: Mingjin Ye <[email protected]>
Sent: Wednesday, June 14, 2023 5:53 PM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Zhou, YidingX <[email protected]>; Ye, MingjinX <[email protected]>; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: [PATCH v2] net/iavf: fix abnormal disable HW interrupt

For command VIRTCHNL_OP_REQUEST_QUEUES, polling access to the admin queue has the issue of access overruns after disabling interrupt. That results in FW disabling HW interrupt for protection purposes.

The updates/changes in this patch:
1. Remove the polling admin queue processing and use the generic interrupt processing instead.
2. Release redundant queue resource before stopping processing interrupt events.

Quoted 8 lines
Fixes 22b123a36d07 ("net/avf: initialize PMD")
Fixes ef807926e148 ("net/iavf: support requesting additional queues from

PF")

Fixes 84108425054a ("net/iavf: support asynchronous virtual channel

message")
Cc: [email protected]

Applied to dpdk-next-net-intel.

Thanks
Qi