summaryrefslogtreecommitdiffstats
path: root/src/vnet
AgeCommit message (Expand)AuthorFilesLines
2017-05-16Fixes to tcp active opens and receptionDave Barach2-1/+10
2017-05-16ping command does not work when there is woker thread (VPP-844)flyingeagle231-0/+1
2017-05-15Add sw_if_index of tunnel interface to API reply for ipsec_tunnel_if_add_delMatthew Smith4-15/+36
2017-05-15Add GTP-U plugin. VPP-694Hongjun Ni2-0/+4
2017-05-15af_packet: support changing the mtu sizeRay Kinsella1-1/+23
2017-05-15Fix builtin tcp clientDave Barach4-38/+78
2017-05-15L2BD/API:fix bd dump to ignore unknown bd_idEyal Bari1-19/+20
2017-05-15Fix vnet_interface_counters API definitionAloys Augustin1-7/+28
2017-05-15Fix FIB recursion loops via cover (VPP-842)Neale Ranns3-38/+81
2017-05-11Validate ip6 interface fib tables early onFlorin Coras1-0/+5
2017-05-11Handle RST of TCP connections in SYN-RCVD state, VPP-822Florin Coras1-8/+23
2017-05-10vnet: introduce error state for sw interfacesDamjan Marion3-1/+13
2017-05-10completelly deprecate os_get_cpu_number, replace new occurencesDamjan Marion2-5/+5
2017-05-10Multi-thread enablement for the debug cli http serverDave Barach3-2/+35
2017-05-10Add crc32c inline function, allows compilation on 32-bit systemsDamjan Marion1-1/+1
2017-05-10device: Add callback for set interface rx-modeSteven3-27/+72
2017-05-10Improve TCP option handling, VPP-757Florin Coras3-15/+54
2017-05-10Builtin debug cli http serverDave Barach3-5/+646
2017-05-10Ignore data in RST segments, VPP-723Florin Coras2-59/+53
2017-05-09Fix remaining 32-bit compile issuesDamjan Marion5-18/+21
2017-05-09API support for IPsec tunnel interface creationMatthew Smith2-1/+87
2017-05-09Add support for tcp/session buffer chainsFlorin Coras5-75/+210
2017-05-08L2FIB:CLI/API to flush all non-static entriesEyal Bari7-88/+157
2017-05-07Remove L2 GPE interface from bridge when deleting, VPP-833Florin Coras1-0/+6
2017-05-07Include TCP options in segment size computationFlorin Coras5-42/+97
2017-05-07Fix TCP loss recovery, VPP-745Florin Coras5-48/+72
2017-05-06Fix mac check issue for vitual tunnel interface with no mac addressHongjun Ni1-0/+3
2017-05-05Fix L2FIB learn counter and memory cleanup of mac_by_ip6 hash tableJohn Lo2-5/+16
2017-05-05ip6_to_ip4.h coverity fixMatus Fabian1-1/+1
2017-05-05First commit SR MPLSPablo Camarillo22-40/+1325
2017-05-05NAT64: Move IPv6-IPv4 virtual reassembly code from MAP-T to common library (V...Matus Fabian8-1503/+1461
2017-05-04Fixes and improvements in session hashtable keysClement Durand1-53/+35
2017-05-04Fix coverity issueFilip Tehlar1-0/+2
2017-05-04LISP: group mapping records in map-register messageFilip Tehlar1-6/+19
2017-05-03Fix vnet unit testsFilip Tehlar4-22/+40
2017-05-03L2FIB:flush interface learned macs on downEyal Bari4-39/+42
2017-05-03change ip4_drop_node node register coding formatflyingeagle231-2/+2
2017-05-02Prevent Bridge Domain operations on BD 0.Jon Loeliger3-3/+64
2017-05-02Use per-protocol default flow-hash config when the FIB table index is not knownNeale Ranns3-2/+44
2017-05-02Fix TCP tx when snd_wnd < smssFlorin Coras1-3/+4
2017-05-02BFD: don't crash if interface is deletedKlement Sekera1-33/+42
2017-05-02Allow local/for-us replications for IP multicast routes on the CLINeale Ranns2-5/+8
2017-05-02Add interface rx mode commands, unify rx mode and placement CLIDamjan Marion8-177/+321
2017-05-01TCP ooo reception fixesFlorin Coras8-40/+205
2017-04-28Fix hostname fencepost error in dhcp_compl_event_callback.Jon Loeliger1-2/+4
2017-04-28af_packet: reflect admin device state on hostRay Kinsella3-15/+78
2017-04-28Fix memory leak on deletion of BD (bridge domain)John Lo1-3/+9
2017-04-28vhost: Disallow duplicate path name for vhost interfaceSteven2-1/+37
2017-04-27LISP: fix deleting of locators, VPP-713Filip Tehlar1-0/+4
2017-04-27VPP-716: IKEv2 responder fails to authenticate initiatorMatthew Smith1-15/+16
n">append(node) def append_nodes(self, *nodes, filter_list=None): """Append nodes to the path. :param nodes: Nodes to append to the path. :param filter_list: Filter criteria list. :type nodes: dict :type filter_list: list of strings .. note:: Node order does matter. """ for node in nodes: self.append_node(node, filter_list=filter_list) def clear_path(self): """Clear path.""" self._nodes = [] self._nodes_filter = [] self._links = [] self._path = [] self._path_iter = [] def compute_path(self, always_same_link=True): """Compute path for added nodes. .. note:: First add at least two nodes to the topology. :param always_same_link: If True use always same link between two nodes in path. If False use different link (if available) between two nodes if one link was used before. :type always_same_link: bool :raises RuntimeError: If not enough nodes for path. """ nodes = self._nodes if len(nodes) < 2: raise RuntimeError(u"Not enough nodes to compute path") for idx in range(0, len(nodes) - 1): topo = Topology() node1 = nodes[idx] node2 = nodes[idx + 1] n1_list = self._nodes_filter[idx] n2_list = self._nodes_filter[idx + 1] links = topo.get_active_connecting_links( node1, node2, filter_list_node1=n1_list, filter_list_node2=n2_list ) if not links: raise RuntimeError( f"No link between {node1[u'host']} and {node2[u'host']}" ) # Not using set operations, as we need deterministic order. if always_same_link: l_set = [link for link in links if link in self._links] else: l_set = [link for link in links if link not in self._links] if not l_set: raise RuntimeError( f"No free link between {node1[u'host']} and " f"{node2[u'host']}, all links already used" ) if not l_set: link = links[0] else: link = l_set[0] self._links.append(link) interface1 = topo.get_interface_by_link_name(node1, link) interface2 = topo.get_interface_by_link_name(node2, link) self._path.append((interface1, node1)) self._path.append((interface2, node2)) self._path_iter.extend(self._path) self._path_iter.reverse() def next_interface(self): """Path interface iterator. :returns: Interface and node or None if not next interface. :rtype: tuple (str, dict) .. note:: Call compute_path before. """ if not self._path_iter: return None, None return self._path_iter.pop() def first_interface(self): """Return first interface on the path. :returns: Interface and node. :rtype: tuple (str, dict) .. note:: Call compute_path before. """ if not self._path: raise RuntimeError(u"No path for topology") return self._path[0] def last_interface(self): """Return last interface on the path. :returns: Interface and node. :rtype: tuple (str, dict) .. note:: Call compute_path before. """ if not self._path: raise RuntimeError(u"No path for topology") return self._path[-1] def first_ingress_interface(self): """Return first ingress interface on the path. :returns: Interface and node. :rtype: tuple (str, dict) .. note:: Call compute_path before. """ if not self._path: raise RuntimeError(u"No path for topology") return self._path[1] def last_egress_interface(self): """Return last egress interface on the path. :returns: Interface and node. :rtype: tuple (str, dict) .. note:: Call compute_path before. """ if not self._path: raise RuntimeError(u"No path for topology") return self._path[-2] def compute_circular_topology(self, nodes, filter_list=None, nic_pfs=1, always_same_link=False, topo_has_tg=True): """Return computed circular path. :param nodes: Nodes to append to the path. :param filter_list: Filter criteria list. :param nic_pfs: Number of PF of NIC. :param always_same_link: If True use always same link between two nodes in path. If False use different link (if available) between two nodes if one link was used before. :param topo_has_tg: If True, the topology has a TG node. If False, the topology consists entirely of DUT nodes. :type nodes: dict :type filter_list: list of strings :type nic_pfs: int :type always_same_link: bool :type topo_has_tg: bool :returns: Topology information dictionary. :rtype: dict :raises RuntimeError: If unsupported combination of parameters. """ t_dict = dict() duts = [key for key in nodes if u"DUT" in key] t_dict[u"duts"] = duts t_dict[u"duts_count"] = len(duts) t_dict[u"int"] = u"pf" for _ in range(0, nic_pfs // 2): if topo_has_tg: self.append_node(nodes[u"TG"]) for dut in duts: self.append_node(nodes[dut], filter_list=filter_list) if topo_has_tg: self.append_node(nodes[u"TG"]) self.compute_path(always_same_link) n_idx = 0 # node index t_idx = 1 # TG interface index d_idx = 0 # DUT interface index prev_host = None while True: interface, node = self.next_interface() if not interface: break if topo_has_tg and node.get(u"type") == u"TG": n_pfx = f"TG" # node prefix p_pfx = f"pf{t_idx}" # physical interface prefix i_pfx = f"if{t_idx}" # [backwards compatible] interface prefix n_idx = 0 t_idx = t_idx + 1 elif topo_has_tg: # Each node has 2 interfaces, starting with 1 # Calculate prefixes appropriately for current # path topology nomenclature: # tg1_if1 -> dut1_if1 -> dut1_if2 -> # [dut2_if1 -> dut2_if2 ...] -> tg1_if2 n_pfx = f"DUT{n_idx // 2 + 1}" p_pfx = f"pf{d_idx % 2 + t_idx - 1}" i_pfx = f"if{d_idx % 2 + t_idx - 1}" n_idx = n_idx + 1 d_idx = d_idx + 1 elif not topo_has_tg and always_same_link: this_host = node.get(u"host") if prev_host != this_host: # When moving to a new host in the path, # increment the node index (n_idx) and # reset DUT interface index (d_idx) to 1. n_idx = n_idx + 1 d_idx = 1 n_pfx = f"DUT{n_idx}" p_pfx = f"pf{d_idx}" i_pfx = f"if{d_idx}" d_idx = d_idx + 1 else: raise RuntimeError(u"Unsupported combination of paramters") t_dict[f"{n_pfx}"] = node t_dict[f"{n_pfx}_{p_pfx}"] = [interface] t_dict[f"{n_pfx}_{p_pfx}_mac"] = \ [Topology.get_interface_mac(node, interface)] t_dict[f"{n_pfx}_{p_pfx}_vlan"] = \ [Topology.get_interface_vlan(node, interface)] t_dict[f"{n_pfx}_{p_pfx}_pci"] = \ [Topology.get_interface_pci_addr(node, interface)] t_dict[f"{n_pfx}_{p_pfx}_ip4_addr"] = \ [Topology.get_interface_ip4(node, interface)] t_dict[f"{n_pfx}_{p_pfx}_ip4_prefix"] = \ [Topology.get_interface_ip4_prefix_length(node, interface)] if f"{n_pfx}_pf_pci" not in t_dict: t_dict[f"{n_pfx}_pf_pci"] = [] t_dict[f"{n_pfx}_pf_pci"].append( Topology.get_interface_pci_addr(node, interface)) if f"{n_pfx}_pf_keys" not in t_dict: t_dict[f"{n_pfx}_pf_keys"] = [] t_dict[f"{n_pfx}_pf_keys"].append(interface) # Backward compatibility below t_dict[f"{n_pfx.lower()}_{i_pfx}"] = interface t_dict[f"{n_pfx.lower()}_{i_pfx}_mac"] = \ Topology.get_interface_mac(node, interface) t_dict[f"{n_pfx.lower()}_{i_pfx}_pci"] = \ Topology.get_interface_pci_addr(node, interface) t_dict[f"{n_pfx.lower()}_{i_pfx}_ip4_addr"] = \ Topology.get_interface_ip4(node, interface) t_dict[f"{n_pfx.lower()}_{i_pfx}_ip4_prefix"] = \ Topology.get_interface_ip4_prefix_length(node, interface) self.clear_path() return t_dict