patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Jeff Guo <jia.guo@intel.com>
To: ktraynor@redhat.com
Cc: stable@dpdk.org, jia.guo@intel.com,
	Hailin Xu <hailinx.xu@intel.com>, Qi Zhang <qi.z.zhang@intel.com>
Subject: [dpdk-stable] [PATCH 18.11 1/3] net/avf: fix command after PF reset
Date: Thu,  3 Dec 2020 17:47:00 +0800
Message-ID: <20201203094702.25734-1-jia.guo@intel.com> (raw)

[ 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


             reply	other threads:[~2020-12-03 10:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-03  9:47 Jeff Guo [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201203094702.25734-1-jia.guo@intel.com \
    --to=jia.guo@intel.com \
    --cc=hailinx.xu@intel.com \
    --cc=ktraynor@redhat.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/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 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

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


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