HV: refine pci_lookup_drhd_for_pbdf with hash

hv: pci: refine pci_lookup_drhd_for_pbdf with hash

1. Added an auxiliary function pci_find_pdev using hash to find pdev
with pbdf, thus pci_lookup_drhd_for_pbdf will have a 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:
Qian Wang
2020-06-05 12:17:59 +08:00
committed by wenlingz
parent f58bf1f03f
commit 8fb8d81935
2 changed files with 27 additions and 11 deletions

View File

@@ -31,6 +31,8 @@
#ifndef PCI_H_
#define PCI_H_
#include <list.h>
/*
* PCIM_xxx: mask to locate subfield in register
* PCIR_xxx: config register offset
@@ -248,6 +250,7 @@ struct pci_pdev {
bool has_pm_reset;
bool has_flr;
bool has_af_flr;
struct hlist_node link;
};
struct pci_cfg_ops {