All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Wang, Yinan" <yinan.wang@intel.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"oda@valinux.co.jp" <oda@valinux.co.jp>,
	"Bie, Tiwei" <tiwei.bie@intel.com>,
	"amorenoz@redhat.com" <amorenoz@redhat.com>
Subject: Re: [dpdk-dev] [PATCH 2/2] net/vhost: prevent multiple setup on reconfig
Date: Tue, 18 Feb 2020 15:27:10 +0000	[thread overview]
Message-ID: <3aa84fab91654697b594ef3316ac32b5@intel.com> (raw)
In-Reply-To: <20200218143514.553307-3-maxime.coquelin@redhat.com>

Tested-by: Yinan Wang <yinan.wang@intel.com>

> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: 2020年2月18日 22:35
> To: dev@dpdk.org; oda@valinux.co.jp; Wang, Yinan <yinan.wang@intel.com>;
> Bie, Tiwei <tiwei.bie@intel.com>; amorenoz@redhat.com
> Cc: Maxime Coquelin <maxime.coquelin@redhat.com>
> Subject: [PATCH 2/2] net/vhost: prevent multiple setup on reconfig
> 
> Ethdev's .dev_configure callback can be called multiple time during a device
> life-time, but Vhost makes the wrong assumption that it is not the case and try
> to setup again the device on reconfiguration.
> 
> This patch ensures the device hasn't been already setup before proceeding.
> 
> Fixes: 3d01b759d267 ("net/vhost: delay driver setup")
> 
> Reported-by: Yinan Wang <yinan.wang@intel.com>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
>  drivers/net/vhost/rte_eth_vhost.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/net/vhost/rte_eth_vhost.c
> b/drivers/net/vhost/rte_eth_vhost.c
> index c0056bc8bf..c4643da120 100644
> --- a/drivers/net/vhost/rte_eth_vhost.c
> +++ b/drivers/net/vhost/rte_eth_vhost.c
> @@ -876,6 +876,11 @@ vhost_driver_setup(struct rte_eth_dev *eth_dev)
>  	unsigned int numa_node = eth_dev->device->numa_node;
>  	const char *name = eth_dev->device->name;
> 
> +	/* Don't try to setup again if it has already been done. */
> +	list = find_internal_resource(internal->iface_name);
> +	if (list)
> +		return 0;
> +
>  	list = rte_zmalloc_socket(name, sizeof(*list), 0, numa_node);
>  	if (list == NULL)
>  		return -1;
> --
> 2.24.1


  parent reply	other threads:[~2020-02-18 15:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-18 14:35 [dpdk-dev] [PATCH 0/2] Fix Vhost PMD setup Maxime Coquelin
2020-02-18 14:35 ` [dpdk-dev] [PATCH 1/2] net/vhost: fix Vhost setup error path Maxime Coquelin
2020-02-18 16:15   ` David Marchand
2020-02-18 16:25     ` Maxime Coquelin
2020-02-18 14:35 ` [dpdk-dev] [PATCH 2/2] net/vhost: prevent multiple setup on reconfig Maxime Coquelin
2020-02-18 15:26   ` Maxime Coquelin
2020-02-18 15:27   ` Wang, Yinan [this message]
2020-02-18 16:16   ` David Marchand
2020-02-18 15:24 ` [dpdk-dev] [PATCH 0/2] Fix Vhost PMD setup Wang, Yinan
2020-02-18 15:25   ` Maxime Coquelin
  -- strict thread matches above, loose matches on Subject: below --
2020-02-18 17:22 Maxime Coquelin
2020-02-18 17:22 ` [dpdk-dev] [PATCH 2/2] net/vhost: prevent multiple setup on reconfig Maxime Coquelin
2020-02-19  3:44   ` Tiwei Bie
2020-02-19  8:17     ` Maxime Coquelin
2020-02-19 22:17       ` Itsuro ODA

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=3aa84fab91654697b594ef3316ac32b5@intel.com \
    --to=yinan.wang@intel.com \
    --cc=amorenoz@redhat.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=oda@valinux.co.jp \
    --cc=tiwei.bie@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.