Add ability to delete sub-ints on BVI + Loopback

- Add a get_sub_interfaces() call to fetch all DPDK / Bond sub-ints
- In prune_bvis(), prune_loopbacks() and prune_sub_interfaces(),
  use sub_number_of_tags to go out-to-in (qinx, dot1x, untagged)
This commit is contained in:
Pim van Pelt
2022-03-25 18:43:46 +00:00
parent 9aeb60ad98
commit 1d7fd268e0
2 changed files with 57 additions and 38 deletions

View File

@ -143,6 +143,10 @@ class VPPApi():
self.dump_phys()
self.dump_subints()
def get_sub_interfaces(self):
subints = [self.config['interfaces'][x].interface_name for x in self.config['interfaces'] if self.config['interfaces'][x].interface_dev_type in ['dpdk','bond'] and self.config['interfaces'][x].sub_id>0 and self.config['interfaces'][x].sub_number_of_tags > 0]
return subints
def get_qinx_interfaces(self):
qinx_subints = [self.config['interfaces'][x].interface_name for x in self.config['interfaces'] if self.config['interfaces'][x].interface_dev_type in ['dpdk','bond'] and self.config['interfaces'][x].sub_id>0 and self.config['interfaces'][x].sub_inner_vlan_id>0]
return qinx_subints