summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface
diff options
context:
space:
mode:
authorPim van Pelt <pim@ipng.nl>2022-07-19 08:32:22 +0000
committerDave Wallace <dwallacelf@gmail.com>2022-07-26 17:03:20 +0000
commita5266c6bb508253c2a64719b093eb09f3e14ed9a (patch)
tree372ac48e6387dba5fd340717395e7d01e03d2cf6 /src/vnet/interface
parent8636a320413c12d1747c695ac594ca643ac539ba (diff)
vppinfra: fix formatting of format_base10
format_base10 reads 64b but is fed 32b values at the callsite; change to u64 consistently. The function has only one call site in interface/monitor.c which has a few additional bugs (spurious character, and ambiguous 'bits' versus 'bytes' in the output). Type: improvement Signed-off-by: Pim van Pelt <pim@ipng.nl> Change-Id: I360f0d439cc13c09bd3f53db8184bd12ad4bc2e9
Diffstat (limited to 'src/vnet/interface')
-rw-r--r--src/vnet/interface/monitor.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/vnet/interface/monitor.c b/src/vnet/interface/monitor.c
index 6d79154ae0a..3ae1fd29156 100644
--- a/src/vnet/interface/monitor.c
+++ b/src/vnet/interface/monitor.c
@@ -90,12 +90,14 @@ monitor_interface_command_fn (vlib_main_t *vm, unformat_input_t *input,
tsd = ts[spin] - ts[spin ^ 1];
vlib_cli_output (
- vm, "rx: %Upps %Ubps tx: %Upps %Ubps%c", format_base10,
- (u32) ((vrx[spin].packets - vrx[spin ^ 1].packets) / tsd),
- format_base10, (u32) ((vrx[spin].bytes - vrx[spin ^ 1].bytes) / tsd),
+ vm, "rx: %Upps %Ubps tx: %Upps %Ubps", format_base10,
+ (u64) ((vrx[spin].packets - vrx[spin ^ 1].packets) / tsd),
format_base10,
- (u32) ((vtx[spin].packets - vtx[spin ^ 1].packets) / tsd),
- format_base10, (u32) ((vtx[spin].bytes - vtx[spin ^ 1].bytes) / tsd));
+ (u64) (8 * (vrx[spin].bytes - vrx[spin ^ 1].bytes) / tsd),
+ format_base10,
+ (u64) ((vtx[spin].packets - vtx[spin ^ 1].packets) / tsd),
+ format_base10,
+ (u64) (8 * (vtx[spin].bytes - vtx[spin ^ 1].bytes) / tsd));
}
done: