DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Tan, Jianfeng" <jianfeng.tan@intel.com>
To: Nachiketa Prachanda <nprachan@vyatta.att-mail.com>
Cc: dev@dpdk.org, jblunck@infradead.org, stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] vdev: fix name comparison in find_vdev
Date: Mon, 12 Mar 2018 10:51:20 +0800	[thread overview]
Message-ID: <eb657634-cdf1-59be-2331-718933964f78@intel.com> (raw)
In-Reply-To: <1520634518-3055-1-git-send-email-nprachan@vyatta.att-mail.com>

Hi,


On 3/10/2018 6:28 AM, Nachiketa Prachanda wrote:
> Use strcmp to compare device names as the strncmp in original code
> causes find_vdev to return -EEXIST  for names that are prefix
> of another. The creation of interfaces fails unpredictably based
> on the order of their creation. An easy way hit this bug is to create
> eth_vhost1 after eth_vhost11.
>
> Signed-off-by: Nachiketa Prachanda <nprachan@vyatta.att-mail.com>

Except a nit bellow:

Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>

>
> Fixes: dda987315ca2 ("vdev: make virtual bus use its device struct")
> Cc: jblunck@infradead.org
> Cc: stable@dpdk.org

AFAIK, we usually put above line before Signed-off-by.

> ---
>   drivers/bus/vdev/vdev.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
> index e4bc724..7eae319 100644
> --- a/drivers/bus/vdev/vdev.c
> +++ b/drivers/bus/vdev/vdev.c
> @@ -188,7 +188,7 @@ find_vdev(const char *name)
>   	TAILQ_FOREACH(dev, &vdev_device_list, next) {
>   		const char *devname = rte_vdev_device_name(dev);
>   
> -		if (!strncmp(devname, name, strlen(name)))
> +		if (!strcmp(devname, name))
>   			return dev;
>   	}
>   

  reply	other threads:[~2018-03-12  2:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-09 22:28 Nachiketa Prachanda
2018-03-12  2:51 ` Tan, Jianfeng [this message]
2018-03-12 16:54   ` [dpdk-dev] [PATCH v2] " Nachiketa Prachanda
2018-03-27 22:35     ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon

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=eb657634-cdf1-59be-2331-718933964f78@intel.com \
    --to=jianfeng.tan@intel.com \
    --cc=dev@dpdk.org \
    --cc=jblunck@infradead.org \
    --cc=nprachan@vyatta.att-mail.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).