From patchwork Tue Jul 2 14:36:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han Ding X-Patchwork-Id: 1955462 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WD5J85Htrz1xpc for ; Wed, 3 Jul 2024 00:43:36 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 26F1F401A1; Tue, 2 Jul 2024 14:43:34 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id p8pnNsLI5kDY; Tue, 2 Jul 2024 14:43:33 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org CB402401CC Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id CB402401CC; Tue, 2 Jul 2024 14:43:32 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 96A6FC002B; Tue, 2 Jul 2024 14:43:32 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3B996C002A for ; Tue, 2 Jul 2024 14:43:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 1EB4960689 for ; Tue, 2 Jul 2024 14:43:31 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id H-OIG1Rj1aMI for ; Tue, 2 Jul 2024 14:43:30 +0000 (UTC) X-Greylist: delayed 403 seconds by postgrey-1.37 at util1.osuosl.org; Tue, 02 Jul 2024 14:43:29 UTC DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 5B85560683 Authentication-Results: smtp3.osuosl.org; dmarc=none (p=none dis=none) header.from=chinatelecom.cn DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 5B85560683 Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=182.42.119.59; helo=chinatelecom.cn; envelope-from=handing@chinatelecom.cn; receiver= Received: from chinatelecom.cn (smtpnm6-12.21cn.com [182.42.119.59]) by smtp3.osuosl.org (Postfix) with ESMTP id 5B85560683 for ; Tue, 2 Jul 2024 14:43:29 +0000 (UTC) HMM_SOURCE_IP: 192.168.138.117:0.837327212 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-106.63.1.10 (unknown [192.168.138.117]) by chinatelecom.cn (HERMES) with SMTP id E150B110001AF for ; Tue, 2 Jul 2024 22:36:36 +0800 (CST) X-189-SAVE-TO-SEND: handing@chinatelecom.cn Received: from ([106.63.1.10]) by gateway-ssl-dep-67bdc54df-qz2qs with ESMTP id 211068032b6d4e21b0aba7b829643f1b for dev@openvswitch.org; Tue, 02 Jul 2024 22:36:37 CST X-Transaction-ID: 211068032b6d4e21b0aba7b829643f1b X-Real-From: handing@chinatelecom.cn X-Receive-IP: 106.63.1.10 X-MEDUSA-Status: 0 Date: Tue, 2 Jul 2024 22:36:35 +0800 From: "Han Ding" To: dev X-Priority: 3 X-GUID: 01BAEB69-12D3-4DBB-9792-C9C594294501 X-Has-Attach: no X-Mailer: Foxmail 7.2.25.254[cn] Mime-Version: 1.0 Message-ID: <202407022236347791543@chinatelecom.cn> Subject: [ovs-dev] [PATCH] bond: Fix inaccurate log info in bond_shift_load. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" 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 --- 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;