When the delta is less than 1024 in bond_shift_load, it print "shift 0kB of load". Like this: bond dpdkbond0: shift 0kB of load (with hash 71) from nic1 to nic2 (now carrying 20650165kB and 8311662kB load, respectively)
Signed-off-by: Han Ding <[email protected]> --- ofproto/bond.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/ofproto/bond.c b/ofproto/bond.c index c31869a..5b1975d 100644 --- a/ofproto/bond.c +++ b/ofproto/bond.c @@ -1192,13 +1192,23 @@ bond_shift_load(struct bond_entry *hash, struct bond_member *to) struct bond *bond = from->bond; uint64_t delta = hash->tx_bytes; - VLOG_INFO("bond %s: shift %"PRIu64"kB of load (with hash %"PRIdPTR") " - "from %s to %s (now carrying %"PRIu64"kB and " - "%"PRIu64"kB load, respectively)", - bond->name, delta / 1024, hash - bond->hash, - from->name, to->name, - (from->tx_bytes - delta) / 1024, - (to->tx_bytes + delta) / 1024); + if (delta >= 1024) { + VLOG_INFO("bond %s: shift %"PRIu64"kB of load (with hash %"PRIdPTR") " + "from %s to %s (now carrying %"PRIu64"kB and " + "%"PRIu64"kB load, respectively)", + bond->name, delta / 1024, hash - bond->hash, + from->name, to->name, + (from->tx_bytes - delta) / 1024, + (to->tx_bytes + delta) / 1024); + } else { + VLOG_INFO("bond %s: shift %"PRIu64"B of load (with hash %"PRIdPTR") " + "from %s to %s (now carrying %"PRIu64"kB and " + "%"PRIu64"kB load, respectively)", + bond->name, delta, hash - bond->hash, + from->name, to->name, + (from->tx_bytes - delta) / 1024, + (to->tx_bytes + delta) / 1024); + } /* Shift load away from 'from' to 'to'. */ from->tx_bytes -= delta; -- 1.8.3.1 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
