def resolve_dpdk_bonds():
    '''
    Resolve local PCI devices from configured mac addresses
    using the dpdk-bond-mappings configuration option

    @return: OrderDict indexed by PCI device address.
    '''
    bonds = config('dpdk-bond-mappings')
    devices = PCINetDevices()
    resolved_devices = collections.OrderedDict()
    db = kv()
    if bonds:
        # NOTE: ordered dict of format {[mac]: bond}
        bondmap = parse_data_port_mappings(bonds)
        for mac, bond in bondmap.items():
            pcidev = devices.get_device_from_mac(mac)
            if pcidev:
                # NOTE: store mac->pci allocation as post binding
                #       to dpdk, it disappears from PCIDevices.
                db.set(mac, pcidev.pci_address)
                db.flush()

            pci_address = db.get(mac)
            if pci_address:
                resolved_devices[pci_address] = bond

    return resolved_devices
Exemple #2
0
def resolve_dpdk_bonds():
    '''
    Resolve local PCI devices from configured mac addresses
    using the dpdk-bond-mappings configuration option

    @return: OrderDict indexed by PCI device address.
    '''
    bonds = config('dpdk-bond-mappings')
    devices = PCINetDevices()
    resolved_devices = collections.OrderedDict()
    db = kv()
    if bonds:
        # NOTE: ordered dict of format {[mac]: bond}
        bondmap = parse_data_port_mappings(bonds)
        for mac, bond in bondmap.items():
            pcidev = devices.get_device_from_mac(mac)
            if pcidev:
                # NOTE: store mac->pci allocation as post binding
                #       to dpdk, it disappears from PCIDevices.
                db.set(mac, pcidev.pci_address)
                db.flush()

            pci_address = db.get(mac)
            if pci_address:
                resolved_devices[pci_address] = bond

    return resolved_devices
Exemple #3
0
def resolve_dpdk_ports():
    '''
    Resolve local PCI devices from configured mac addresses
    using the data-port configuration option

    @return: OrderDict indexed by PCI device address.
    '''
    ports = config('data-port')
    devices = PCINetDevices()
    resolved_devices = {}
    db = kv()
    if ports:
        # NOTE: ordered dict of format {[mac]: bridge}
        portmap = parse_data_port_mappings(ports)
        for mac, bridge in portmap.iteritems():
            pcidev = devices.get_device_from_mac(mac)
            if pcidev:
                # NOTE: store mac->pci allocation as post binding
                #       to dpdk, it disappears from PCIDevices.
                db.set(mac, pcidev.pci_address)
                db.flush()

            pci_address = db.get(mac)
            if pci_address:
                resolved_devices[pci_address] = bridge

    return resolved_devices
def resolve_dpdk_ports():
    '''
    Resolve local PCI devices from configured mac addresses
    using the data-port configuration option

    @return: OrderDict indexed by PCI device address.
    '''
    ports = config('data-port')
    devices = PCINetDevices()
    resolved_devices = {}
    db = kv()
    if ports:
        # NOTE: ordered dict of format {[mac]: bridge}
        portmap = parse_data_port_mappings(ports)
        for mac, bridge in portmap.iteritems():
            pcidev = devices.get_device_from_mac(mac)
            if pcidev:
                # NOTE: store mac->pci allocation as post binding
                #       to dpdk, it disappears from PCIDevices.
                db.set(mac, pcidev.pci_address)
                db.flush()

            pci_address = db.get(mac)
            if pci_address:
                resolved_devices[pci_address] = bridge

    return resolved_devices