patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 18.11 1/3] net/avf: fix command after PF reset
@ 2020-12-03  9:47 Jeff Guo
  2020-12-03  9:47 ` [dpdk-stable] [PATCH 18.11 2/3] net/avf: fix flow flush " Jeff Guo
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jeff Guo @ 2020-12-03  9:47 UTC (permalink / raw)
  To: ktraynor; +Cc: stable, jia.guo, Hailin Xu, Qi Zhang

[ upstream commit 1eab95fe2e36e191ad85a9aacf82a44e7c8011fc ]

If PF reset is finished but VF reset is pending, VF should no need to
send any invalid cmd to PF. That would avoid mass unexpected behaviors
affecting the robust.

Fixes: 22b123a36d07 ("net/avf: initialize PMD")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Tested-by: Hailin Xu <hailinx.xu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/avf/avf.h        | 2 +-
 drivers/net/avf/avf_ethdev.c | 3 +++
 drivers/net/avf/avf_vchnl.c  | 3 +++
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/avf/avf.h b/drivers/net/avf/avf.h
index bef66a258c..112a5337a4 100644
--- a/drivers/net/avf/avf.h
+++ b/drivers/net/avf/avf.h
@@ -98,7 +98,7 @@ struct avf_info {
 	enum virtchnl_link_speed link_speed;
 
 	struct avf_vsi vsi;
-	bool vf_reset;
+	bool vf_reset;	/* true for VF reset pending, false for no VF reset */
 	uint64_t flags;
 
 	uint8_t *rss_lut;
diff --git a/drivers/net/avf/avf_ethdev.c b/drivers/net/avf/avf_ethdev.c
index 1a1d10e79f..35a7debf64 100644
--- a/drivers/net/avf/avf_ethdev.c
+++ b/drivers/net/avf/avf_ethdev.c
@@ -1136,6 +1136,9 @@ avf_init_vf(struct rte_eth_dev *dev)
 			goto err_rss;
 		}
 	}
+
+	vf->vf_reset = false;
+
 	return 0;
 err_rss:
 	rte_free(vf->rss_key);
diff --git a/drivers/net/avf/avf_vchnl.c b/drivers/net/avf/avf_vchnl.c
index 7806014e80..29ef485184 100644
--- a/drivers/net/avf/avf_vchnl.c
+++ b/drivers/net/avf/avf_vchnl.c
@@ -76,6 +76,9 @@ avf_execute_vf_cmd(struct avf_adapter *adapter, struct avf_cmd_info *args)
 	if (_atomic_set_cmd(vf, args->ops))
 		return -1;
 
+	if (vf->vf_reset)
+		return -EIO;
+
 	ret = avf_aq_send_msg_to_pf(hw, args->ops, AVF_SUCCESS,
 				    args->in_args, args->in_args_size, NULL);
 	if (ret) {
-- 
2.20.1


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

end of thread, other threads:[~2020-12-03 16:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03  9:47 [dpdk-stable] [PATCH 18.11 1/3] net/avf: fix command after PF reset Jeff Guo
2020-12-03  9:47 ` [dpdk-stable] [PATCH 18.11 2/3] net/avf: fix flow flush " Jeff Guo
2020-12-03  9:47 ` [dpdk-stable] [PATCH 18.11 3/3] net/avf: fix vector Rx Jeff Guo
2020-12-03 16:45 ` [dpdk-stable] [PATCH 18.11 1/3] net/avf: fix command after PF reset Kevin Traynor

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).