示例#1
0
    def _get_pci_pt_whitelist(self, host, iface_context):
        # Process all configured PCI passthrough interfaces and add them to
        # the list of devices to whitelist
        devices = []
        for iface in iface_context['interfaces'].values():
            if iface['ifclass'] in [constants.INTERFACE_CLASS_PCI_PASSTHROUGH]:
                port = interface.get_interface_port(iface_context, iface)
                dnames = interface._get_datanetwork_names(iface_context, iface)
                device = {
                    'address': port['pciaddr'],
                    'physical_network': dnames,
                }
                LOG.debug('_get_pci_pt_whitelist '
                          'host=%s, device=%s', host.hostname, device)
                devices.append(device)

        # Process all enabled PCI devices configured for PT and SRIOV and
        # add them to the list of devices to whitelist.
        # Since we are now properly initializing the qat driver and
        # restarting sysinv, we need to add VF devices to the regular
        # whitelist instead of the sriov whitelist
        pci_devices = self.dbapi.pci_device_get_by_host(host.id)
        for pci_device in pci_devices:
            if pci_device.enabled:
                device = {
                    'address': pci_device.pciaddr,
                }
                LOG.debug('_get_pci_pt_whitelist '
                          'host=%s, device=%s', host.hostname, device)
                devices.append(device)

        return devices
示例#2
0
    def _get_pci_sriov_whitelist(self, host, iface_context):
        # Process all configured SRIOV interfaces and add each VF
        # to the list of devices to whitelist
        devices = []
        for iface in iface_context['interfaces'].values():
            if iface['ifclass'] in [constants.INTERFACE_CLASS_PCI_SRIOV]:
                port = interface.get_interface_port(iface_context, iface)
                dnames = interface._get_datanetwork_names(iface_context, iface)
                vf_addrs = port['sriov_vfs_pci_address']
                if vf_addrs:
                    for vf_addr in vf_addrs.split(","):
                        device = {
                            'address': vf_addr,
                            'physical_network': dnames,
                        }
                        LOG.debug('_get_pci_sriov_whitelist '
                                  'host=%s, device=%s', host.hostname, device)
                        devices.append(device)

        return devices
示例#3
0
def _get_datanetwork_names(context, iface):
    """
    Return the CSV list of data networks of the supplied interface
    """
    return interface._get_datanetwork_names(context, iface)