From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f66.google.com (mail-oi0-f66.google.com [209.85.218.66]) by dpdk.org (Postfix) with ESMTP id 5736F5902 for ; Sat, 25 Jun 2016 18:53:11 +0200 (CEST) Received: by mail-oi0-f66.google.com with SMTP id w141so23705913oia.0 for ; Sat, 25 Jun 2016 09:53:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc; bh=4DeqVJr5tzJBJW4IgzNUnNwszkigwu2NQztJFau0lx8=; b=0D912BfSSrV282bQ5M9HtxgNynUk4DpGQ+67SDRV+TGK9ngu1JmqycIsI6HeuaJWwP Nb1faQ2ao73qwS7xo/byHocLDoLFuuTYBkWov6U2iLJPp9yiylCCONJehROs8bI75m5u B7hPfXMMX6cHECLhXhCIPIbruIrpu2HKLAZxj15hVQNMQApvih2t2qHhVB0qc44pKAK9 9TA1D3C0Ywd6bBlQsSt77jOloFzc0ZwSspYuJX9k7UHrtUnKVSmJ0MAJnKK53L4EpNMG i8Xs0ANBRPV2L5lkKu3qBjQiIh8HzAa+jPzmrFcghGYTktnfC2gVcP6d5yvr3mjiuFDo XA1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc; bh=4DeqVJr5tzJBJW4IgzNUnNwszkigwu2NQztJFau0lx8=; b=EGsYrwpnxMDOV+V0QNOtZK0FO88EfILGmxJThXolooPVeagYWOPJ2XI0eW+IT/9JRt gWl/nSwE+3kONhb+G2z0zroQN3mfb6G+g47ImrxafD+r16y439+hFXo6ldqYVONeweaG 8/1EwkKBJbC735nTjZ7Tyu4ImfymEI7sHgi6t9OjIZ4mkrX95ZBZCzAWwajiWbOCBRdk seBCvJOrzI3pjwCE6z/BgjwRvqsjqwhiIrbYtA5G2SfbOH55vJVXh5f6yeP0dv+Fazo5 iGWIx9tsv6wsAbSljJTj6f3KAXiEIyug9BIXdTG8M1iwRX37cb+WUw4rs1pz7CCU2gcq yCcA== X-Gm-Message-State: ALyK8tIcQUSUR8snnkv8TcNpa0QZGICy6lRUVbQFUqIcgXLHLUNUewcMZ1l/6DcbgI6IFT4/5FciI6hPfOszBQ== MIME-Version: 1.0 X-Received: by 10.157.12.246 with SMTP id o51mr6571750otd.72.1466873590659; Sat, 25 Jun 2016 09:53:10 -0700 (PDT) Received: by 10.202.48.22 with HTTP; Sat, 25 Jun 2016 09:53:10 -0700 (PDT) Date: Sat, 25 Jun 2016 09:53:10 -0700 Message-ID: From: Rugang Chen To: "dev@dpdk.org" Cc: Rugang Chen Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] pci:don't insert an unbound device to pci_device_list in pci_scan_one X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 16:53:11 -0000 Hi all, Can you take a look at the patch and send out your comments? It's first time for me to work with git as this way, not sure if I'm doing right on the process. There're two emails for this patch. The second one is to correct the first one. On Saturday, June 25, 2016, Rugang Chen wrote: > If a device isn't bound by any uio driver (vfio-pci, igb_uio, > uio_pci_generic) > and is expected to owned by a kernel space driver, here it's still > inserted to > pci_device_list. > > This may cause application based on dpdk fetch the device by accident and > then > the device is hanlded by dpdk. > > For safe, skip it from pci_device_list as if it's unbound, dpdk won't want > to > use it. > --- > lib/librte_eal/linuxapp/eal/eal_pci.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c > b/lib/librte_eal/linuxapp/eal/eal_pci.c > index f63febc..432d2e8 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_pci.c > +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c > @@ -392,8 +392,12 @@ pci_scan_one(const char *dirname, uint16_t domain, > uint8_t bus, > * fetch it from pci_device_list by accident and then dpdk handles > it. Kernel > * space driver maybe wants to own it. > */ > - if (dev->kdrv == RTE_KDRV_NONE) > + if (dev->kdrv == RTE_KDRV_NONE) { > + RTE_LOG(WARNING, EAL, "Skip ubound device\n"); > + free(dev); > return 0; > + } > + > /* device is valid, add in list (sorted) */ > if (TAILQ_EMPTY(&pci_device_list)) { > TAILQ_INSERT_TAIL(&pci_device_list, dev, next); > -- > 2.1.4 > >