DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] vhost: fix vring disable fail in async transfer
@ 2020-07-23  5:38 patrick.fu
  2020-07-23  6:17 ` Fu, Patrick
  0 siblings, 1 reply; 2+ messages in thread
From: patrick.fu @ 2020-07-23  5:38 UTC (permalink / raw)
  To: dev, maxime.coquelin, chenbo.xia; +Cc: Patrick Fu

From: Patrick Fu <patrick.fu@intel.com>

Async inflight packets is checked when front end virtio requests to
disable vring. If inflight packets exists, vring disabling will fail.
However, there is no good way for application to get notified before
vring is disabled and properly complete inflight packets. This patch
moves the inflight packets check from vring disabling time to the vring
enabling time, so that applications have chances to drain out pending
packets.

Fixes: 78639d54563a ("vhost: introduce async enqueue registration API")

Signed-off-by: Patrick Fu <patrick.fu@intel.com>
---
 lib/librte_vhost/vhost_user.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index 9ddeae362..36da1380a 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -2038,9 +2038,9 @@ vhost_user_set_vring_enable(struct virtio_net **pdev,
 		"set queue enable: %d to qp idx: %d\n",
 		enable, index);
 
-	if (!enable && dev->virtqueue[index]->async_registered) {
+	if (enable && dev->virtqueue[index]->async_registered) {
 		if (dev->virtqueue[index]->async_pkts_inflight_n) {
-			VHOST_LOG_CONFIG(ERR, "failed to disable vring. "
+			VHOST_LOG_CONFIG(ERR, "failed to enable vring. "
 			"async inflight packets must be completed first\n");
 			return RTE_VHOST_MSG_RESULT_ERR;
 		}
-- 
2.18.4


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

* Re: [dpdk-dev] [PATCH v1] vhost: fix vring disable fail in async transfer
  2020-07-23  5:38 [dpdk-dev] [PATCH v1] vhost: fix vring disable fail in async transfer patrick.fu
@ 2020-07-23  6:17 ` Fu, Patrick
  0 siblings, 0 replies; 2+ messages in thread
From: Fu, Patrick @ 2020-07-23  6:17 UTC (permalink / raw)
  To: dev, maxime.coquelin, Xia, Chenbo

Hi,

Sorry but I'd like to withdraw this patch as the issue could be addressed by applications to register a pre_msg_handler.

Thanks,

Patrick

> -----Original Message-----
> From: Fu, Patrick <patrick.fu@intel.com>
> Sent: Thursday, July 23, 2020 1:38 PM
> To: dev@dpdk.org; maxime.coquelin@redhat.com; Xia, Chenbo
> <chenbo.xia@intel.com>
> Cc: Fu, Patrick <patrick.fu@intel.com>
> Subject: [PATCH v1] vhost: fix vring disable fail in async transfer
> 
> From: Patrick Fu <patrick.fu@intel.com>
> 
> Async inflight packets is checked when front end virtio requests to disable
> vring. If inflight packets exists, vring disabling will fail.
> However, there is no good way for application to get notified before vring is
> disabled and properly complete inflight packets. This patch moves the inflight
> packets check from vring disabling time to the vring enabling time, so that
> applications have chances to drain out pending packets.
> 
> Fixes: 78639d54563a ("vhost: introduce async enqueue registration API")
> 
> Signed-off-by: Patrick Fu <patrick.fu@intel.com>
> ---
>  lib/librte_vhost/vhost_user.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
> index 9ddeae362..36da1380a 100644
> --- a/lib/librte_vhost/vhost_user.c
> +++ b/lib/librte_vhost/vhost_user.c
> @@ -2038,9 +2038,9 @@ vhost_user_set_vring_enable(struct virtio_net
> **pdev,
>  		"set queue enable: %d to qp idx: %d\n",
>  		enable, index);
> 
> -	if (!enable && dev->virtqueue[index]->async_registered) {
> +	if (enable && dev->virtqueue[index]->async_registered) {
>  		if (dev->virtqueue[index]->async_pkts_inflight_n) {
> -			VHOST_LOG_CONFIG(ERR, "failed to disable vring. "
> +			VHOST_LOG_CONFIG(ERR, "failed to enable vring. "
>  			"async inflight packets must be completed first\n");
>  			return RTE_VHOST_MSG_RESULT_ERR;
>  		}
> --
> 2.18.4


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

end of thread, other threads:[~2020-07-23  6:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-23  5:38 [dpdk-dev] [PATCH v1] vhost: fix vring disable fail in async transfer patrick.fu
2020-07-23  6:17 ` Fu, Patrick

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