All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: zhiyong.yang@intel.com, dev@dpdk.org
Cc: jianfeng.tan@intel.com, zhihong.wang@intel.com,
	thomas@monjalon.net, dong1.wang@intel.com, tiwei.bie@intel.com
Subject: Re: [PATCH v3 4/4] net/vhost: add NULL pointer checking
Date: Thu, 29 Mar 2018 15:19:43 +0200	[thread overview]
Message-ID: <1b93fd09-9802-bff7-bea4-5b4839860983@redhat.com> (raw)
In-Reply-To: <20180321030343.64399-5-zhiyong.yang@intel.com>

Hi,

On 03/21/2018 04:03 AM, zhiyong.yang@intel.com wrote:
> When vhost user PMD works in client mode to connect/reconnect virtio-user
> with server mode, new thread sometimes may run to new_device before
> queue_setup has been done, So have to wait until memory allocation is
> done.
> 
> Release note is updated in the patch.
> 
> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> ---
>   doc/guides/rel_notes/release_18_05.rst | 7 +++++++
>   drivers/net/vhost/rte_eth_vhost.c      | 9 +++++++++
>   2 files changed, 16 insertions(+)
> 
> diff --git a/doc/guides/rel_notes/release_18_05.rst b/doc/guides/rel_notes/release_18_05.rst
> index 3923dc253..7b301f021 100644
> --- a/doc/guides/rel_notes/release_18_05.rst
> +++ b/doc/guides/rel_notes/release_18_05.rst
> @@ -41,6 +41,13 @@ New Features
>        Also, make sure to start the actual text at the margin.
>        =========================================================
>   
> +* **Added support for virtio-user server mode.**
> +
> +  In a container environment if the vhost-user backend restarts, there's no way
> +  for it to reconnect to virtio-user. To address this, support for server mode
> +  is added. In this mode the socket file is created by virtio-user, which the
> +  backend then connects to. This means that if the backend restarts, it can
> +  reconnect to virtio-user and continue communications.

I think this shouldn't be part of this patch.

>   
>   API Changes
>   -----------
> diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
> index 3aae01c39..2490bad0b 100644
> --- a/drivers/net/vhost/rte_eth_vhost.c
> +++ b/drivers/net/vhost/rte_eth_vhost.c
> @@ -580,6 +580,15 @@ new_device(int vid)
>   		eth_dev->data->numa_node = newnode;
>   #endif
>   
> +	/* The thread may run here before eth_dev->data->rx_queues or
> +	 * eth_dev->data->tx_queues have gotten valid memory, so have to
> +	 * wait until memory allocation is done.
> +	 */
> +	while (!eth_dev->data->rx_queues ||
> +	       !eth_dev->data->tx_queues) {
> +		usleep(1);
> +	}
> +
>   	for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
>   		vq = eth_dev->data->rx_queues[i];
>   		if (vq == NULL)
> 

I don't like the idea of polling here.
It looks like Junjie is addressing the problem in a different way [0],
do you confirm it would work in your case?

Thanks,
Maxime

[0]: http://dpdk.org/dev/patchwork/patch/36643/

  reply	other threads:[~2018-03-29 13:19 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-14 14:53 [PATCH 0/4] add to support for virtio-user server mode Zhiyong Yang
2018-02-14 14:53 ` [PATCH 1/4] vhost: move fdset functions from fd_man.c to fd_man.h Zhiyong Yang
2018-02-27 17:51   ` Maxime Coquelin
2018-02-28  1:36     ` Yang, Zhiyong
2018-02-28  8:45       ` Maxime Coquelin
2018-03-01  6:02         ` Tan, Jianfeng
2018-03-01 14:13           ` Thomas Monjalon
2018-03-05  7:43             ` Yang, Zhiyong
2018-03-05  8:54               ` Thomas Monjalon
2018-03-13  8:46                 ` Yang, Zhiyong
2018-03-13  9:43                   ` Thomas Monjalon
2018-03-13  9:50                     ` Yang, Zhiyong
2018-03-15  9:32                       ` Thomas Monjalon
2018-03-16  8:43                         ` Yang, Zhiyong
2018-03-21  6:51                           ` Yang, Zhiyong
2018-03-15  9:45   ` [PATCH v2 0/5] add support for virtio-user server mode zhiyong.yang
2018-03-15  9:45     ` [PATCH v2 1/5] net/virtio: fix add pointer checking zhiyong.yang
2018-03-15  9:45     ` [PATCH v2 2/5] net/virtio: add checking for cvq zhiyong.yang
2018-03-15  9:45     ` [PATCH v2 3/5] eal: expose fdset related APIs zhiyong.yang
2018-03-15  9:45     ` [PATCH v2 4/5] net/virtio-user: add support for server mode zhiyong.yang
2018-03-15  9:45     ` [PATCH v2 5/5] net/vhost: add memory checking zhiyong.yang
2018-02-14 14:53 ` [PATCH 2/4] net/virtio-user: add data members to support server mode Zhiyong Yang
2018-02-27 17:53   ` Maxime Coquelin
2018-02-28  1:38     ` Yang, Zhiyong
2018-02-14 14:53 ` [PATCH 3/4] net/virtio-user: " Zhiyong Yang
2018-02-27 18:01   ` Maxime Coquelin
2018-02-28  1:53     ` Yang, Zhiyong
2018-02-28  8:33       ` Maxime Coquelin
2018-02-14 14:53 ` [PATCH 4/4] net/vhost: add memory checking to support client mode Zhiyong Yang
2018-03-21  3:03 ` [PATCH v3 0/4] add support for virtio-user server mode zhiyong.yang
2018-03-21  3:03   ` [PATCH v3 1/4] net/virtio: fix add pointer checking zhiyong.yang
2018-03-28  7:26     ` Tan, Jianfeng
2018-03-28  7:48       ` Yang, Zhiyong
2018-03-29 11:59     ` Maxime Coquelin
2018-03-29 12:01     ` Maxime Coquelin
2018-03-21  3:03   ` [PATCH v3 2/4] net/virtio: add checking for cvq zhiyong.yang
2018-03-28  8:34     ` Tan, Jianfeng
2018-03-29 11:59     ` Maxime Coquelin
2018-03-29 12:06     ` Maxime Coquelin
2018-03-21  3:03   ` [PATCH v3 3/4] net/virtio-user: add support for server mode zhiyong.yang
2018-03-28 15:14     ` Tan, Jianfeng
2018-03-30  2:08       ` Yang, Zhiyong
2018-03-21  3:03   ` [PATCH v3 4/4] net/vhost: add NULL pointer checking zhiyong.yang
2018-03-29 13:19     ` Maxime Coquelin [this message]
2018-03-30  2:00       ` Yang, Zhiyong
2018-03-30  7:41         ` Yang, Zhiyong
2018-04-03 12:20   ` [PATCH v4 0/1] server mode virtio-user zhiyong.yang
2018-04-03 12:20     ` [PATCH v4 1/1] net/virtio-user: add support for server mode zhiyong.yang
2018-04-03 15:16       ` Tan, Jianfeng
2018-04-04  3:31         ` Yang, Zhiyong
2018-04-04  3:47           ` Tan, Jianfeng
2018-04-04  5:37         ` Tiwei Bie
2018-04-04  9:59           ` Yang, Zhiyong
2018-04-04 14:57             ` Yang, Zhiyong
2018-04-04 17:17       ` [PATCH v5] " zhiyong.yang
2018-04-05  8:29         ` Tiwei Bie
2018-04-05  9:19           ` Yang, Zhiyong
2018-04-06  7:22           ` Yang, Zhiyong
2018-04-05  9:21         ` Yang, Zhiyong
2018-04-06  0:18         ` [PATCH v6] " zhiyong.yang
2018-04-05 18:13           ` Tan, Jianfeng
2018-04-06  7:14             ` Yang, Zhiyong
2018-04-06  9:25           ` [PATCH v7] " zhiyong.yang
2018-04-08  0:36             ` Tan, Jianfeng
2018-04-10 11:55               ` Maxime Coquelin

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=1b93fd09-9802-bff7-bea4-5b4839860983@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=dong1.wang@intel.com \
    --cc=jianfeng.tan@intel.com \
    --cc=thomas@monjalon.net \
    --cc=tiwei.bie@intel.com \
    --cc=zhihong.wang@intel.com \
    --cc=zhiyong.yang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.