:returns: Nothing
"""
port_types = ('subinterface', 'vlan_subif', 'memif', 'tap', 'vhost',
- 'loopback', 'gre_tunnel', 'vxlan_tunnel', 'eth_bond')
+ 'loopback', 'gre_tunnel', 'vxlan_tunnel', 'eth_bond',
+ 'avf')
for node_data in nodes.values():
if node_data['type'] == NodeType.DUT:
"""
node['interfaces'][iface_key]['pci_address'] = str(pci_address)
+ @staticmethod
+ def update_interface_vlan(node, iface_key, vlan):
+ """Update VLAN on the interface from the node.
+
+ :param node: Node to update VLAN on.
+ :param iface_key: Topology key of the interface.
+ :param vlan: VLAN ID.
+ :type node: dict
+ :type iface_key: str
+ :type vlan: str
+ """
+ node['interfaces'][iface_key]['vlan'] = int(vlan)
+
@staticmethod
def update_interface_vhost_socket(node, iface_key, vhost_socket):
"""Update vhost socket name on the interface from the node.
interface index assigned to the interface by vpp for a given node.
:param node: The node topology dictionary.
- :param sw_if_index: sw_if_index of the link that a interface is connected to.
+ :param sw_if_index: sw_if_index of the link that a interface is
+ connected to.
:type node: dict
:type sw_if_index: int
:returns: Interface name of the interface connected to the given link.
except KeyError:
return None
+ @staticmethod
+ def get_interface_vlan(node, iface_key):
+ """Get interface vlan.
+
+ :param node: Node to get interface driver on.
+ :param iface_key: Interface key from topology file.
+ :type node: dict
+ :type iface_key: str
+ :returns: Return interface vlan or None if not found.
+ """
+ try:
+ return node['interfaces'][iface_key].get('vlan')
+ except KeyError:
+ return None
+
@staticmethod
def get_node_interfaces(node):
"""Get all node interfaces.