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, Qi Zhang <qi.z.zhang@intel.com>
Subject: [dpdk-stable] [PATCH 18.11 2/3] net/avf: fix flow flush after PF reset
Date: Thu,  3 Dec 2020 17:47:01 +0800	[thread overview]
Message-ID: <20201203094702.25734-2-jia.guo@intel.com> (raw)
In-Reply-To: <20201203094702.25734-1-jia.guo@intel.com>

[ upstream commit c02ea7410e5124ad44ad7419ab16a43e1b3af647 ]

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: 3926cfffff2c ("net/avf: fix command after PF reset")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/avf/avf_ethdev.c | 5 +++--
 drivers/net/avf/avf_vchnl.c  | 7 ++++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/avf/avf_ethdev.c b/drivers/net/avf/avf_ethdev.c
index 35a7debf64..d49de4344a 100644
--- a/drivers/net/avf/avf_ethdev.c
+++ b/drivers/net/avf/avf_ethdev.c
@@ -1137,8 +1137,6 @@ avf_init_vf(struct rte_eth_dev *dev)
 		}
 	}
 
-	vf->vf_reset = false;
-
 	return 0;
 err_rss:
 	rte_free(vf->rss_key);
@@ -1269,6 +1267,7 @@ avf_dev_init(struct rte_eth_dev *eth_dev)
 static void
 avf_dev_close(struct rte_eth_dev *dev)
 {
+	struct avf_info *vf = AVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 	struct avf_hw *hw = AVF_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
 	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
@@ -1282,6 +1281,8 @@ avf_dev_close(struct rte_eth_dev *dev)
 	rte_intr_callback_unregister(intr_handle,
 				     avf_dev_interrupt_handler, dev);
 	avf_disable_irq0(hw);
+
+	vf->vf_reset = false;
 }
 
 static int
diff --git a/drivers/net/avf/avf_vchnl.c b/drivers/net/avf/avf_vchnl.c
index 29ef485184..39ae0c011c 100644
--- a/drivers/net/avf/avf_vchnl.c
+++ b/drivers/net/avf/avf_vchnl.c
@@ -73,12 +73,12 @@ avf_execute_vf_cmd(struct avf_adapter *adapter, struct avf_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 = avf_aq_send_msg_to_pf(hw, args->ops, AVF_SUCCESS,
 				    args->in_args, args->in_args_size, NULL);
 	if (ret) {
@@ -150,6 +150,7 @@ avf_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


  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 [dpdk-stable] [PATCH 18.11 1/3] net/avf: fix command " Jeff Guo
2020-12-03  9:47 ` Jeff Guo [this message]
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-2-jia.guo@intel.com \
    --to=jia.guo@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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).