From mboxrd@z Thu Jan 1 00:00:00 1970 From: Igor Ryzhov Subject: rte_eth_dev_attach returns 0, although device is not attached Date: Wed, 3 Aug 2016 19:58:02 +0300 Message-ID: Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Cc: David Marchand To: dev@dpdk.org Return-path: Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) by dpdk.org (Postfix) with ESMTP id 9D44E530A for ; Wed, 3 Aug 2016 18:58:05 +0200 (CEST) Received: by mail-lf0-f66.google.com with SMTP id l69so12292387lfg.1 for ; Wed, 03 Aug 2016 09:58:05 -0700 (PDT) List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hello. Function rte_eth_dev_attach can return false positive result. It happens because rte_eal_pci_probe_one returns zero if no driver is = found for the device: ret =3D pci_probe_all_drivers(dev); if (ret < 0) goto err_return; return 0; (pci_probe_all_drivers returns 1 in that case) For example, it can be easily reproduced by trying to attach virtio = device, managed by kernel driver. I think it should be: ret =3D pci_probe_all_drivers(dev); if (ret) goto err_return; return 0; Best regards, Igor=