Skip to content

Commit

Permalink
ovs-bugtool: Separate capability for general network info.
Browse files Browse the repository at this point in the history
Current situation is that CAP_NETWORK_STATUS has a max size of 50 MB.
When we have around 100,000 openflow flows, we over-run that size
by just running the "ovs-ofctl dump-flows" command. All the openvswitch
commands run through the plugin scripts in this repo won't have its
data stored in the debug bundle in this case as they are part of
CAP_NETWORK_STATUS too. One option to correct this is to increase
the CAP_NETWORK_STATUS max size to a higher number. But CAP_NETWORK_STATUS
also includes a bunch of general network related information collected
by running commands like ethtool, tc etc. and we probably want to limit
the data collected through those commands.

With this commit, we create a new capability called CAP_NETWORK_INFO
and collect general network related information through them. For OVS
related information, we continue to use CAP_NETWORK_STATUS, but remove
the maximum size restriction. One rationale to keep OVS related
information in CAP_NETWORK_STATUS is because xen-bugtool probably expects
OVS information in that capability.

Signed-off-by: Gurucharan Shetty <[email protected]>
  • Loading branch information
shettyg committed Jul 24, 2013
1 parent 00c7bf8 commit eb6f308
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions utilities/bugtool/ovs-bugtool.in
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ CAP_KERNEL_INFO = 'kernel-info'
CAP_LOSETUP_A = 'loopback-devices'
CAP_MULTIPATH = 'multipath'
CAP_NETWORK_CONFIG = 'network-config'
CAP_NETWORK_INFO = 'network-info'
CAP_NETWORK_STATUS = 'network-status'
CAP_OPENVSWITCH_LOGS = 'ovs-system-logs'
CAP_PROCESS_LIST = 'process-list'
Expand Down Expand Up @@ -241,7 +242,9 @@ cap(CAP_MULTIPATH, PII_MAYBE, max_size=20*KB,
max_time=10)
cap(CAP_NETWORK_CONFIG, PII_IF_CUSTOMIZED,
min_size=0, max_size=40*KB)
cap(CAP_NETWORK_STATUS, PII_YES, max_size=50*MB,
cap(CAP_NETWORK_INFO, PII_YES, max_size=50*MB,
max_time=30)
cap(CAP_NETWORK_STATUS, PII_YES, max_size=-1,
max_time=30)
cap(CAP_OPENVSWITCH_LOGS, PII_MAYBE, max_size=-1,
max_time=5)
Expand Down Expand Up @@ -542,36 +545,36 @@ exclude those logs from the archive.
file_output(CAP_NETWORK_CONFIG, [NTP_CONF, IPTABLES_CONFIG, HOSTS_ALLOW, HOSTS_DENY])
file_output(CAP_NETWORK_CONFIG, [OPENVSWITCH_CONF_DB])

cmd_output(CAP_NETWORK_STATUS, [IFCONFIG, '-a'])
cmd_output(CAP_NETWORK_STATUS, [ROUTE, '-n'])
cmd_output(CAP_NETWORK_STATUS, [ARP, '-n'])
cmd_output(CAP_NETWORK_STATUS, [NETSTAT, '-an'])
cmd_output(CAP_NETWORK_INFO, [IFCONFIG, '-a'])
cmd_output(CAP_NETWORK_INFO, [ROUTE, '-n'])
cmd_output(CAP_NETWORK_INFO, [ARP, '-n'])
cmd_output(CAP_NETWORK_INFO, [NETSTAT, '-an'])
for dir in DHCP_LEASE_DIR:
tree_output(CAP_NETWORK_STATUS, dir)
tree_output(CAP_NETWORK_INFO, dir)
for table in ['filter', 'nat', 'mangle', 'raw', 'security']:
cmd_output(CAP_NETWORK_STATUS, [IPTABLES, '-t', table, '-nL'])
cmd_output(CAP_NETWORK_INFO, [IPTABLES, '-t', table, '-nL'])
for p in os.listdir('/sys/class/net/'):
try:
f = open('/sys/class/net/%s/type' % p, 'r')
t = f.readline()
f.close()
if os.path.islink('/sys/class/net/%s/device' % p) and int(t) == 1:
# ARPHRD_ETHER
cmd_output(CAP_NETWORK_STATUS, [ETHTOOL, '-S', p])
cmd_output(CAP_NETWORK_INFO, [ETHTOOL, '-S', p])
if not p.startswith('vif') and not p.startswith('tap'):
cmd_output(CAP_NETWORK_STATUS, [ETHTOOL, p])
cmd_output(CAP_NETWORK_STATUS, [ETHTOOL, '-k', p])
cmd_output(CAP_NETWORK_STATUS, [ETHTOOL, '-i', p])
cmd_output(CAP_NETWORK_STATUS, [ETHTOOL, '-c', p])
cmd_output(CAP_NETWORK_INFO, [ETHTOOL, p])
cmd_output(CAP_NETWORK_INFO, [ETHTOOL, '-k', p])
cmd_output(CAP_NETWORK_INFO, [ETHTOOL, '-i', p])
cmd_output(CAP_NETWORK_INFO, [ETHTOOL, '-c', p])
if int(t) == 1:
cmd_output(CAP_NETWORK_STATUS,
cmd_output(CAP_NETWORK_INFO,
[TC, '-s', '-d', 'class', 'show', 'dev', p])
except:
pass
tree_output(CAP_NETWORK_STATUS, PROC_NET_BONDING_DIR)
tree_output(CAP_NETWORK_STATUS, PROC_NET_VLAN_DIR)
cmd_output(CAP_NETWORK_STATUS, [TC, '-s', 'qdisc'])
file_output(CAP_NETWORK_STATUS, [PROC_NET_SOFTNET_STAT])
tree_output(CAP_NETWORK_INFO, PROC_NET_BONDING_DIR)
tree_output(CAP_NETWORK_INFO, PROC_NET_VLAN_DIR)
cmd_output(CAP_NETWORK_INFO, [TC, '-s', 'qdisc'])
file_output(CAP_NETWORK_INFO, [PROC_NET_SOFTNET_STAT])
if os.path.exists(OPENVSWITCH_VSWITCHD_PID):
cmd_output(CAP_NETWORK_STATUS, [OVS_DPCTL, 'show', '-s'])
for d in dp_list():
Expand Down

0 comments on commit eb6f308

Please sign in to comment.