From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tetsuya Mukawa Subject: Re: [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment Date: Thu, 28 Jan 2016 11:47:59 +0900 Message-ID: <56A9815F.6040205@igel.co.jp> References: <1453108389-21006-2-git-send-email-mukawa@igel.co.jp> <1453374478-30996-6-git-send-email-mukawa@igel.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit To: "Xie, Huawei" , "dev@dpdk.org" , "yuanhan.liu@linux.intel.com" , "Tan, Jianfeng" Return-path: Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by dpdk.org (Postfix) with ESMTP id 8ADFEC166 for ; Thu, 28 Jan 2016 03:48:03 +0100 (CET) Received: by mail-pa0-f47.google.com with SMTP id ho8so14878920pac.2 for ; Wed, 27 Jan 2016 18:48:03 -0800 (PST) In-Reply-To: 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" On 2016/01/28 1:45, Xie, Huawei wrote: > On 1/21/2016 7:09 PM, Tetsuya Mukawa wrote: >> +qtest_find_pci_device(struct qtest_session *s, uint16_t bus, uint8_t device) >> +{ >> + struct qtest_pci_device *dev; >> + uint32_t val; >> + >> + val = qtest_pci_inl(s, bus, device, 0, 0); >> + TAILQ_FOREACH(dev, &s->head, next) { >> + if (val == ((uint32_t)dev->device_id << 16 | dev->vendor_id)) { >> + dev->bus_addr = bus; >> + dev->device_addr = device; >> + return; >> + } >> + >> + } >> +} >> + >> +static int >> +qtest_init_pci_devices(struct qtest_session *s) >> +{ >> + struct qtest_pci_device *dev; >> + uint16_t bus; >> + uint8_t device; >> + int ret; >> + >> + /* Find devices */ >> + bus = 0; >> + do { >> + device = 0; >> + do { >> + qtest_find_pci_device(s, bus, device); >> + } while (device++ != NB_DEVICE - 1); >> + } while (bus++ != NB_BUS - 1); > Seems this scan of all the pci devices is very time consuming operation, > and each scan involves socket communication. > Do you measure how long it takes to do the pci devices initialization? I measured it, and seems it takes 0.35 seconds in my environment. This will be done only once when the port is initialized. Probably it's not so heady. Tetsuya