patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Yahui Cao <yahui.cao@intel.com>
Cc: Qi Zhang <qi.z.zhang@intel.com>,
	Xiaolong Ye <xiaolong.ye@intel.com>,
	dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'net/iavf: fix virtual channel return' has been queued to LTS release 18.11.7
Date: Fri,  7 Feb 2020 15:12:33 +0000	[thread overview]
Message-ID: <20200207151248.29804-21-ktraynor@redhat.com> (raw)
In-Reply-To: <20200207151248.29804-1-ktraynor@redhat.com>

Hi,

FYI, your patch has been queued to LTS release 18.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/13/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/74937a80186a5f227181b303db51d4099124e53b

Thanks.

Kevin.

---
From 74937a80186a5f227181b303db51d4099124e53b Mon Sep 17 00:00:00 2001
From: Yahui Cao <yahui.cao@intel.com>
Date: Tue, 24 Dec 2019 12:13:13 +0800
Subject: [PATCH] net/iavf: fix virtual channel return

[ upstream commit be5466e4e9cc547f7792f04bee1f1d593d8072b8 ]

In iavf_handle_virtchnl_msg(), it is not appropriate for _clear_cmd()
to be used as a notification to foreground thread. So introduce
_notify_cmd() to fix this error. In addition, since _notify_cmd()
contains rte_wmb(), rte_compiler_barrier() is not necessary.

Sending msg from VF to PF is mainly by calling iavf_execute_vf_cmd(),
the whole virtchnl msg process is like,

iavf_execute_vf_cmd() will call iavf_aq_send_msg_to_pf() to send
msg and then polling the cmd done flag as "if (vf->pend_cmd ==
VIRTCHNL_OP_UNKNOWN)"

When reply msg is returned by pf, iavf_handle_virtchnl_msg() in
isr will read msg return value by "vf->cmd_retval = msg_ret" and
immediately set the cmd done flag by calling _clear_cmd() to
notify the iavf_execute_vf_cmd().

iavf_execute_vf_cmd() find the cmd done flag is set and then
check whether command return value vf->cmd_retval is success or
not.

However _clear_cmd() also resets the vf->cmd_retval to success,
overwriting the actual return value which is used for diagnosis.
So iavf_execute_vf_cmd() will always find vf->cmd_retval is
success and then return success.

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

Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
---
 drivers/net/avf/avf.h       | 11 +++++++++++
 drivers/net/avf/avf_vchnl.c |  9 +++------
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/net/avf/avf.h b/drivers/net/avf/avf.h
index dcf8d1c727..bef66a258c 100644
--- a/drivers/net/avf/avf.h
+++ b/drivers/net/avf/avf.h
@@ -168,4 +168,15 @@ struct avf_cmd_info {
 };
 
+/* notify current command done. Only call in case execute
+ * _atomic_set_cmd successfully.
+ */
+static inline void
+_notify_cmd(struct avf_info *vf, uint32_t msg_ret)
+{
+	vf->cmd_retval = msg_ret;
+	rte_wmb();
+	vf->pend_cmd = VIRTCHNL_OP_UNKNOWN;
+}
+
 /* clear current command. Only call in case execute
  * _atomic_set_cmd successfully.
diff --git a/drivers/net/avf/avf_vchnl.c b/drivers/net/avf/avf_vchnl.c
index fd90cc2c34..276b406f91 100644
--- a/drivers/net/avf/avf_vchnl.c
+++ b/drivers/net/avf/avf_vchnl.c
@@ -211,10 +211,7 @@ avf_handle_virtchnl_msg(struct rte_eth_dev *dev)
 			} else {
 				/* read message and it's expected one */
-				if (msg_opc == vf->pend_cmd) {
-					vf->cmd_retval = msg_ret;
-					/* prevent compiler reordering */
-					rte_compiler_barrier();
-					_clear_cmd(vf);
-				} else
+				if (msg_opc == vf->pend_cmd)
+					_notify_cmd(vf, msg_ret);
+				else
 					PMD_DRV_LOG(ERR, "command mismatch,"
 						    "expect %u, get %u",
-- 
2.21.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-02-07 15:08:18.619862819 +0000
+++ 0021-net-iavf-fix-virtual-channel-return.patch	2020-02-07 15:08:17.530062737 +0000
@@ -1 +1 @@
-From be5466e4e9cc547f7792f04bee1f1d593d8072b8 Mon Sep 17 00:00:00 2001
+From 74937a80186a5f227181b303db51d4099124e53b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit be5466e4e9cc547f7792f04bee1f1d593d8072b8 ]
+
@@ -33 +34,0 @@
-Cc: stable@dpdk.org
@@ -39,2 +40,2 @@
- drivers/net/iavf/iavf.h       | 11 +++++++++++
- drivers/net/iavf/iavf_vchnl.c |  9 +++------
+ drivers/net/avf/avf.h       | 11 +++++++++++
+ drivers/net/avf/avf_vchnl.c |  9 +++------
@@ -43,5 +44,5 @@
-diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h
-index 77b7068939..9466808917 100644
---- a/drivers/net/iavf/iavf.h
-+++ b/drivers/net/iavf/iavf.h
-@@ -175,4 +175,15 @@ struct iavf_cmd_info {
+diff --git a/drivers/net/avf/avf.h b/drivers/net/avf/avf.h
+index dcf8d1c727..bef66a258c 100644
+--- a/drivers/net/avf/avf.h
++++ b/drivers/net/avf/avf.h
+@@ -168,4 +168,15 @@ struct avf_cmd_info {
@@ -54 +55 @@
-+_notify_cmd(struct iavf_info *vf, uint32_t msg_ret)
++_notify_cmd(struct avf_info *vf, uint32_t msg_ret)
@@ -63,5 +64,5 @@
-diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
-index bf87ab6115..303b515386 100644
---- a/drivers/net/iavf/iavf_vchnl.c
-+++ b/drivers/net/iavf/iavf_vchnl.c
-@@ -211,10 +211,7 @@ iavf_handle_virtchnl_msg(struct rte_eth_dev *dev)
+diff --git a/drivers/net/avf/avf_vchnl.c b/drivers/net/avf/avf_vchnl.c
+index fd90cc2c34..276b406f91 100644
+--- a/drivers/net/avf/avf_vchnl.c
++++ b/drivers/net/avf/avf_vchnl.c
+@@ -211,10 +211,7 @@ avf_handle_virtchnl_msg(struct rte_eth_dev *dev)


  parent reply	other threads:[~2020-02-07 15:13 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-07 15:12 [dpdk-stable] patch 'eal/linux: fix uninitialized data valgrind warning' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'eal/linux: fix build error on RHEL 7.6' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'doc: fix build with python 3.8' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'build: explicitly enable sse4 for meson' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'kni: fix meson warning about console keyword' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'doc: fix warning with meson' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'doc: reduce whitespace in meson build file' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'doc: reduce indentation " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'event/dsw: flush buffers immediately on zero-sized enqueue' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'event/dsw: avoid credit leak on oversized enqueue bursts' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'bus/fslmc: remove conflicting memory barrier macro' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'examples/ipsec-secgw: fix crash on unsupported algo' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'app/testpmd: fix device mcast list error handling' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/fm10k: fix descriptor VLAN field filling in Tx' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/iavf: fix Rx total stats' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/iavf: add TSO offload use basic path' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/ixgbe: fix link status' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/ixgbe: fix link up in FreeBSD' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/iavf/base: fix command buffer memory leak' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/iavf/base: fix adminq return' " Kevin Traynor
2020-02-07 15:12 ` Kevin Traynor [this message]
2020-02-07 15:12 ` [dpdk-stable] patch 'net/i40e: fix Tx when TSO is enabled' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/bnxt: fix link during port toggle' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'app/testpmd: call cleanup on exit' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/vhost: check creation failure' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/virtio-user: check file descriptor before closing' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'vhost: fix socket initial value' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/i40e/base: fix buffer address' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/i40e/base: fix error message' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/i40e/base: fix Tx descriptors number' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/i40e/base: fix retrying logic' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'ethdev: fix callback unregister with wildcard argument list' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/netvsc: fix crash in secondary process' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/cxgbe: announce Tx multi-segments offload' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'service: avoid false sharing on core state' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'service: don't walk out of bounds when checking services' " 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=20200207151248.29804-21-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@dpdk.org \
    --cc=xiaolong.ye@intel.com \
    --cc=yahui.cao@intel.com \
    /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).