DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] net/iavf: fix flow flush after PF reset
@ 2020-09-30  5:44 Jeff Guo
  2020-10-08  7:11 ` Zhang, Qi Z
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Guo @ 2020-09-30  5:44 UTC (permalink / raw)
  To: jingjing.wu, qi.z.zhang, beilei.xing; +Cc: dev, jia.guo

When VF begin reset after PF reset, VF will be uninitialized at first
and then be initialized, during the time any invalid cmd such as flow
flush should not be sent to PF until the uninitialization is finished.

Fixes: 1eab95fe2e36 ("net/iavf: fix command after PF reset")
Signed-off-by: Jeff Guo <jia.guo@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c | 4 ++--
 drivers/net/iavf/iavf_hash.c   | 4 ++++
 drivers/net/iavf/iavf_vchnl.c  | 7 ++++---
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index a88d53ab0..ffcbb0ed8 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -1677,8 +1677,6 @@ iavf_init_vf(struct rte_eth_dev *dev)
 		}
 	}
 
-	vf->vf_reset = false;
-
 	iavf_init_proto_xtr(dev);
 
 	return 0;
@@ -1900,6 +1898,8 @@ iavf_dev_close(struct rte_eth_dev *dev)
 
 	rte_free(vf->aq_resp);
 	vf->aq_resp = NULL;
+
+	vf->vf_reset = false;
 }
 
 static int
diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index 4b7f4a872..be821b62e 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -1034,9 +1034,13 @@ iavf_hash_destroy(__rte_unused struct iavf_adapter *ad,
 		  struct rte_flow *flow,
 		  __rte_unused struct rte_flow_error *error)
 {
+	struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(ad);
 	struct virtchnl_rss_cfg *rss_cfg;
 	int ret = 0;
 
+	if (vf->vf_reset)
+		return 0;
+
 	rss_cfg = (struct virtchnl_rss_cfg *)flow->rule;
 
 	ret = iavf_add_del_rss_cfg(ad, rss_cfg, false);
diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 7981dfa30..a7bed5327 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -73,12 +73,12 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)
 	int err = 0;
 	int i = 0;
 
-	if (_atomic_set_cmd(vf, args->ops))
-		return -1;
-
 	if (vf->vf_reset)
 		return -EIO;
 
+	if (_atomic_set_cmd(vf, args->ops))
+		return -1;
+
 	ret = iavf_aq_send_msg_to_pf(hw, args->ops, IAVF_SUCCESS,
 				    args->in_args, args->in_args_size, NULL);
 	if (ret) {
@@ -189,6 +189,7 @@ iavf_handle_pf_event_msg(struct rte_eth_dev *dev, uint8_t *msg,
 	switch (pf_msg->event) {
 	case VIRTCHNL_EVENT_RESET_IMPENDING:
 		PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_RESET_IMPENDING event");
+		vf->vf_reset = true;
 		rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET,
 					      NULL);
 		break;
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH v1] net/iavf: fix flow flush after PF reset
  2020-09-30  5:44 [dpdk-dev] [PATCH v1] net/iavf: fix flow flush after PF reset Jeff Guo
@ 2020-10-08  7:11 ` Zhang, Qi Z
  0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Qi Z @ 2020-10-08  7:11 UTC (permalink / raw)
  To: Guo, Jia, Wu, Jingjing, Xing, Beilei; +Cc: dev



> -----Original Message-----
> From: Guo, Jia <jia.guo@intel.com>
> Sent: Wednesday, September 30, 2020 1:44 PM
> To: Wu, Jingjing <jingjing.wu@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Guo, Jia <jia.guo@intel.com>
> Subject: [PATCH v1] net/iavf: fix flow flush after PF reset
> 
> When VF begin reset after PF reset, VF will be uninitialized at first and then be
> initialized, during the time any invalid cmd such as flow flush should not be sent
> to PF until the uninitialization is finished.
> 
> Fixes: 1eab95fe2e36 ("net/iavf: fix command after PF reset")

as cc stable is required for the patch to fix.
so cc stable is also required for this patch.

> Signed-off-by: Jeff Guo <jia.guo@intel.com>

Acked-by: Qi Zhang <qi.z.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

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

end of thread, other threads:[~2020-10-08  7:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-30  5:44 [dpdk-dev] [PATCH v1] net/iavf: fix flow flush after PF reset Jeff Guo
2020-10-08  7:11 ` Zhang, Qi Z

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git