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