s390x/pci: use hashtable to look up zpci via fh
commitdf8dd91b99ed7d27c1cf9a0e6283b2452192d9a1
authorYi Min Zhao <zyimin@linux.vnet.ibm.com>
Wed, 9 Nov 2016 13:30:50 +0000 (9 21:30 +0800)
committerCornelia Huck <cornelia.huck@de.ibm.com>
Fri, 20 Jan 2017 09:02:02 +0000 (20 10:02 +0100)
tree7840e9cf954459b59ea991c491d24cfecf50f1ee
parent3fc92a24f333b48652a2373c296f641c04b08bae
s390x/pci: use hashtable to look up zpci via fh

After PCI multibus is supported, more than 32 PCI devices could be
plugged. The current implementation of s390_pci_find_dev_by_fh()
appears low performance if there's a huge number of PCI devices
plugged. Therefore we introduce a hashtable using idx as key to store
zpci device's pointer on account of translating fh to idx very easily.

Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
hw/s390x/s390-pci-bus.c
hw/s390x/s390-pci-bus.h