bus/vdev: fix finding device by name
authorNachiketa Prachanda <nprachan@vyatta.att-mail.com>
Mon, 12 Mar 2018 16:54:00 +0000 (09:54 -0700)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 27 Mar 2018 22:35:37 +0000 (00:35 +0200)
commitfada6963ce735048b2d40f215ff110cb2f4cb6a4
tree3088ec2df9ab2bc77eb65e905c562a70a9c87f06
parent37d477b6863e5c06e20be434b559d3a03d89f46a
bus/vdev: fix finding device by name

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.

Fixes: dda987315ca2 ("vdev: make virtual bus use its device struct")
Cc: stable@dpdk.org
Signed-off-by: Nachiketa Prachanda <nprachan@vyatta.att-mail.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
drivers/bus/vdev/vdev.c