From 53ab6068a318079757fa76db37fc9838db2b4f24 Mon Sep 17 00:00:00 2001 From: Ludovic Beliveau Date: Mon, 4 Jul 2016 09:45:07 -0400 Subject: Don't parse PCI whitelist every time neutron ports are created The neutronv2 API is calling the method get_pci_device_devspec() everytime a neutron port is created in order to get a PciDeviceSpec for a given PCI device. This method creates a new Whitelist (based on the config CONF.pci_passthrough_whitelist) and parses it every time it is called. This is not a huge overhead but this is obvioulsy not needed and a waste of cycles. Since only neutronv2 API uses get_pci_device_devspec(), this commit removes the method in favor of using the Whitelist object directly (like it is done in the PciDevTracker). Change-Id: Idee4e9edecff0672680f323a916201aee8eeeabd Closes-Bug: #1598843 --- nova/pci/whitelist.py | 5 ----- 1 file changed, 5 deletions(-) (limited to 'nova/pci') diff --git a/nova/pci/whitelist.py b/nova/pci/whitelist.py index 5c3549064a..ef7793f247 100644 --- a/nova/pci/whitelist.py +++ b/nova/pci/whitelist.py @@ -93,8 +93,3 @@ class Whitelist(object): for spec in self.specs: if spec.match_pci_obj(pci_dev): return spec - - -def get_pci_device_devspec(pci_dev): - dev_filter = Whitelist(CONF.pci.passthrough_whitelist) - return dev_filter.get_devspec(pci_dev) -- cgit v1.2.1