From: Andy Zhou Date: Wed, 16 Apr 2014 08:36:59 +0000 (-0700) Subject: ofproto/bond: only display hash entries with tx_byptes > 1KB X-Git-Tag: sliver-openvswitch-2.2.90-1~3^2~129 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=f6ba1f355075900221ffbfba127a75e540841bc5 ofproto/bond: only display hash entries with tx_byptes > 1KB When recirculation is used to implement bond, all bond entries are always populated regardless whether there is traffic going through them or not. This change cuts down the noise when running 'ovs-appctl bond/show', by skipping '0KB' entries. Signed-off-by: Andy Zhou Acked-by: Jarno Rajahalme --- diff --git a/ofproto/bond.c b/ofproto/bond.c index 4d5e359cf..c0f79c992 100644 --- a/ofproto/bond.c +++ b/ofproto/bond.c @@ -1327,13 +1327,17 @@ bond_print_details(struct ds *ds, const struct bond *bond) /* Hashes. */ for (be = bond->hash; be <= &bond->hash[BOND_MASK]; be++) { int hash = be - bond->hash; + uint64_t be_tx_k; if (be->slave != slave) { continue; } - ds_put_format(ds, "\thash %d: %"PRIu64" kB load\n", - hash, be->tx_bytes / 1024); + be_tx_k = be->tx_bytes / 1024; + if (be_tx_k) { + ds_put_format(ds, "\thash %d: %"PRIu64" kB load\n", + hash, be_tx_k); + } /* XXX How can we list the MACs assigned to hashes of SLB bonds? */ }