@classmethod
    def _verify_iface_dpdk_properties(cls, iface, db_interfaces,
                                      dpdk_drivers, is_slave=False):
        db_iface = cls._get_iface_by_id(iface.get('id'), db_interfaces)
        if db_iface is None:
            db_iface = cls._get_iface_by_name(iface['name'], db_interfaces)

        if db_iface is None:
            # looks like user creates new bond
            # let's check every slave in input data
            slaves = iface['slaves']
            hw_available = bool(slaves)

            for slave in slaves:
                slave_iface = cls._get_iface_by_name(
                    slave['name'], db_interfaces)

                hw_available &= objects.NIC.dpdk_available(
                    slave_iface, dpdk_drivers)

            interface_properties = iface.get('interface_properties', {})
            enabled = interface_properties.get('dpdk', {}).get(
                'enabled', False)

            bond_type = iface.get('bond_properties', {}).get('type__')

            if bond_type == consts.BOND_TYPES.dpdkovs and not enabled:
                raise errors.InvalidData(
                    "Bond interface '{0}': DPDK should be"
                    " enabled for 'dpdkovs' bond type".format(iface['name']),
                    log_message=True
                )
            if bond_type != consts.BOND_TYPES.dpdkovs and enabled:
                raise errors.InvalidData(
                    "Bond interface '{0}': DPDK can be enabled"
                    " only for 'dpdkovs' bond type".format(iface['name']),
                    log_message=True
                )
        else:
            if iface['type'] == consts.NETWORK_INTERFACE_TYPES.ether:
                iface_cls = objects.NIC
            elif iface['type'] == consts.NETWORK_INTERFACE_TYPES.bond:
                iface_cls = objects.Bond
            hw_available = iface_cls.dpdk_available(db_iface, dpdk_drivers)

            interface_properties = utils.dict_merge(
                db_iface.interface_properties,
                iface.get('interface_properties', {})
            )
            enabled = interface_properties.get('dpdk', {}).get(
                'enabled', False)

        # check basic parameters
        if not hw_available and enabled:
            raise errors.InvalidData("DPDK is not available for '{}'".format(
                iface['name']))

        if db_iface is not None:
            pci_id = interface_properties.get('pci_id')
            db_pci_id = db_iface.interface_properties.get('pci_id')

            if pci_id != db_pci_id:
                raise errors.InvalidData(
                    "PCI-ID of '{}' can't be changed manually".format(
                        iface['name']))

        # check that dpdk interface has only one network == 'private'
        nets = iface['assigned_networks']
        if enabled and not is_slave and not (
                len(nets) == 1 and
                nets[0]['name'] == consts.NETWORKS.private
        ):
            raise errors.InvalidData(
                "Only private network could be assigned"
                " to interface '{}' where DPDK is enabled".format(
                    iface['name']))

        # check mtu <= 1500
        # github.com/openvswitch/ovs/blob/master/INSTALL.DPDK.md#restrictions
        mtu = interface_properties.get('mtu')
        if enabled and mtu is not None and mtu > 1500:
            raise errors.InvalidData(
                "For interface '{}' with enabled DPDK MTU"
                " size must be less than 1500 bytes".format(iface['name']))

        return enabled
Verify DPDK properties for particular interface.
dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/extensions/network_manager/validators/network.py/NetAssignmentValidator._verify_iface_dpdk_properties