diff options
author | David Vallee Delisle <dvd@redhat.com> | 2020-09-21 17:32:02 -0400 |
---|---|---|
committer | Jake Hunsaker <jhunsake@redhat.com> | 2020-09-24 11:28:44 -0400 |
commit | 9b86b10ef3d739c080c99fb5ef4d8c97dae45198 (patch) | |
tree | d0638d1f4cd9f8249ba244fe814bc19bcca9481f | |
parent | 32189e0b9334ed337a0d4887318ac45b6f3b609f (diff) | |
download | sos-9b86b10ef3d739c080c99fb5ef4d8c97dae45198.tar.gz |
[openvswitch] Adding 6wind commands
This adds the 6wind's commands to openvswitch plugin.
Resolves: #2242
Signed-off-by: David Vallee Delisle <dvd@redhat.com>
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r-- | sos/report/plugins/openvswitch.py | 132 |
1 files changed, 121 insertions, 11 deletions
diff --git a/sos/report/plugins/openvswitch.py b/sos/report/plugins/openvswitch.py index 5da5d31a..e9dbfdd8 100644 --- a/sos/report/plugins/openvswitch.py +++ b/sos/report/plugins/openvswitch.py @@ -33,6 +33,31 @@ class OpenVSwitch(Plugin): "ovs-vsctl -t 5 get Open_vSwitch . other_config:dpdk-init") check_dpdk = (dpdk_enabled["status"] == 0 and dpdk_enabled["output"].startswith('"true"')) + check_6wind = any([self.is_installed(p) for p in + ['6windgate-fp', 'nuage-openvswitch']]) + actl = "ovs-appctl" + + files_6wind = [ + "/etc/systemd/system/multi-user.target.wants/openvswitch.service", + "/etc/sysctl.d/60-6wind-system-auto-reboot.conf", + "/etc/openvswitch/system-id.conf", + "/etc/openvswitch/*.db", + "/etc/ld.so.conf.d/linux-fp-sync-fptun.conf", + "/etc/NetworkManager/conf.d/fpn0.conf", + "/etc/default/openvswitch", + "/etc/logrotate.d/openvswitch", + "/etc/linux-fp-sync.env", + "/etc/fp-daemons.env", + "/etc/fp-vdev.ini", + "/etc/fpm.env", + "/etc/6WINDGate/fp.config", + "/etc/6WINDGate/fpnsdk.config", + "/etc/dms.d/fp-dms.conf", + "/etc/dms.d/fpmd-dms.conf", + "/etc/dms.d/fpsd-dms.conf", + "/etc/fast-path.env", + "/etc/fps-fp.env", + ] if environ.get('OVS_LOGDIR'): log_dirs.append(environ.get('OVS_LOGDIR')) @@ -104,16 +129,60 @@ class OpenVSwitch(Plugin): self.add_journal(units="ovs-vswitchd") self.add_journal(units="ovsdb-server") + if check_6wind: + self.add_copy_spec(files_6wind) + self.add_cmd_output([ + # Various fast-path stats + "fp-cli fp-vswitch-stats", + "fp-cli dpdk-core-port-mapping", + "fp-cpu-usage", + "fp-cli fp-vswitch-masks", + "fp-cli fp-vswitch-flows", + "fp-shmem-dpvi", + "fp-cli stats non-zero", + "fp-cli stats", + "fp-cli dpdk-cp-filter-budget", + "ovs-appctl vm/port-detailed-show", + "ovs-appctl upcall/show", + "fp-cli nfct4", + "ovs-appctl vm/port-vip-list-show", + "fp-shmem-ports -s", + "ovs-dpctl show -s", + "fpcmd fp-vswitch-flows", + "fp-cli fp-vswitch-ports percore", + "fp-cli dpdk-debug-pool", + "fp-cli dump-size", + "fp-cli conf runtime", + "fp-cli conf compiled", + "fp-cli iface", + "ovs-appctl memory/show", + ]) + self.add_journal(units="virtual-accelerator") + for table in ['filter', 'mangle', 'raw', 'nat']: + self.add_cmd_output(["fpcmd nf4-rules %s" % table]) + + # 6wind doesn't care on which bridge the ports are, there's only + # one bridge and it's alubr0 + port_list = self.collect_cmd_output("fp-cli fp-vswitch-ports") + if port_list['status'] == 0: + for port in port_list['output'].splitlines(): + m = re.match('^([\d]+):[\s]+([^\s]+)', port) + if m: + port_name = m.group(2) + self.add_cmd_output([ + "fp-cli dpdk-cp-filter-budget %s" % port_name, + ]) + # Gather the datapath information for each datapath dp_list_result = self.collect_cmd_output('ovs-appctl dpctl/dump-dps') if dp_list_result['status'] == 0: for dp in dp_list_result['output'].splitlines(): self.add_cmd_output([ - "ovs-appctl dpctl/show -s %s" % dp, - "ovs-appctl dpctl/dump-flows -m %s" % dp, - "ovs-appctl dpctl/dump-conntrack -m %s" % dp, - "ovs-appctl dpctl/ct-stats-show -m %s" % dp, - "ovs-appctl dpctl/ipf-get-status %s" % dp, + "%s dpctl/show -s %s" % (actl, dp), + "%s dpctl/dump-flows -m %s" % (actl, dp), + "%s dpctl/dump-conntrack -m %s" % (actl, dp), + "%s dpctl/ct-stats-show -m %s" % (actl, dp), + "%s dpctl/ipf-get-status %s" % (actl, dp), ]) # Gather additional output for each OVS bridge on the host. @@ -121,11 +190,11 @@ class OpenVSwitch(Plugin): if br_list_result['status'] == 0: for br in br_list_result['output'].splitlines(): self.add_cmd_output([ - "ovs-appctl bridge/dump-flows --offload-stats %s" % br, - "ovs-appctl dpif/show-dp-features %s" % br, - "ovs-appctl fdb/show %s" % br, - "ovs-appctl fdb/stats-show %s" % br, - "ovs-appctl mdb/show %s" % br, + "%s bridge/dump-flows --offload-stats %s" % (actl, br), + "%s dpif/show-dp-features %s" % (actl, br), + "%s fdb/show %s" % (actl, br), + "%s fdb/stats-show %s" % (actl, br), + "%s mdb/show %s" % (actl, br), "ovs-ofctl dump-flows %s" % br, "ovs-ofctl dump-ports-desc %s" % br, "ovs-ofctl dump-ports %s" % br, @@ -192,12 +261,53 @@ class OpenVSwitch(Plugin): self.add_cmd_output( "ovs-appctl netdev-dpdk/get-mempool-info %s" % iface) + if check_6wind: + self.add_cmd_output([ + "%s evpn/vip-list-show %s" % (actl, br), + "%s bridge/dump-conntracks-summary %s" % (actl, br), + "%s bridge/acl-table ingress/egress %s" % (actl, br), + "%s bridge/acl-table %s" % (actl, br), + "%s ofproto/show %s" % (actl, br), + ]) + + vrf_list = self.collect_cmd_output( + "%s vrf/list %s" % (actl, br)) + if vrf_list['status'] == 0: + vrfs = vrf_list['output'].split()[1:] + for vrf in vrfs: + self.add_cmd_output([ + "%s vrf/route-table %s" % (actl, vrf), + ]) + + evpn_list = self.collect_cmd_output( + "ovs-appctl evpn/list %s" % br) + if evpn_list['status'] == 0: + evpns = evpn_list['output'].split()[1:] + for evpn in evpns: + self.add_cmd_output([ + "%s evpn/mac-table %s" % (actl, evpn), + "%s evpn/arp-table %s" % (actl, evpn), + "%s evpn/dump-flows %s %s" % (actl, br, evpn), + "%s evpn/dhcp-pool-show %s %s" % ( + actl, br, evpn), + "%s evpn/dhcp-relay-show %s %s" % ( + actl, br, evpn), + "%s evpn/dhcp-static-show %s %s" % ( + actl, br, evpn), + "%s evpn/dhcp-table-show %s %s" % ( + actl, br, evpn), + "%s evpn/proxy-arp-filter-list %s %s" % ( + actl, br, evpn), + "%s evpn/show %s %s" % (actl, br, evpn), + "%s port/dscp-table %s %s" % (actl, br, evpn), + ]) class RedHatOpenVSwitch(OpenVSwitch, RedHatPlugin): packages = ('openvswitch', 'openvswitch2.*', - 'openvswitch-dpdk', 'nuage-openvswitch') + 'openvswitch-dpdk', 'nuage-openvswitch' + '6windgate-fp') class DebianOpenVSwitch(OpenVSwitch, DebianPlugin, UbuntuPlugin): |