mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-21 16:57:20 +00:00
HV: refine pci_find_vdev with hash
hv: pci: refine pci_find_vdev with hash 1. Refined pci_find_vdev with BDF-hashing for better performance Tracked-On: #4857 Signed-off-by: Wang Qian <qian1.wang@intel.com> Reviewed-by: Li Fei <Fei1.Li@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -32,7 +32,10 @@
|
||||
|
||||
#include <spinlock.h>
|
||||
#include <pci.h>
|
||||
#include <list.h>
|
||||
|
||||
#define VDEV_LIST_HASHBITS 4U
|
||||
#define VDEV_LIST_HASHSIZE (1U << VDEV_LIST_HASHBITS)
|
||||
|
||||
struct pci_vbar {
|
||||
enum pci_bar_type type;
|
||||
@@ -135,6 +138,7 @@ struct pci_vdev {
|
||||
*/
|
||||
struct pci_vdev *parent_user;
|
||||
struct pci_vdev *user;
|
||||
struct hlist_node link;
|
||||
};
|
||||
|
||||
union pci_cfg_addr_reg {
|
||||
@@ -153,6 +157,7 @@ struct acrn_vpci {
|
||||
uint64_t pci_mmcfg_base;
|
||||
uint32_t pci_vdev_cnt;
|
||||
struct pci_vdev pci_vdevs[CONFIG_MAX_PCI_DEV_NUM];
|
||||
struct hlist_head vdevs_hlist_heads [VDEV_LIST_HASHSIZE];
|
||||
};
|
||||
|
||||
struct acrn_vm;
|
||||
|
Reference in New Issue
Block a user