From aa435eec4cfd1794438ea8593fff0181c70dcebf Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Sat, 13 Jul 2013 15:01:39 +0200 Subject: ifpps: warn when 1Gbit/s and interval < 1sec It is possible to use a interval even of 0, although it would not really make sense. It's not a bug either, so throw a warning to the user in that case on 1Gbit/s. Signed-off-by: Daniel Borkmann --- ifpps.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ifpps.c b/ifpps.c index 05e3459..ec0d55b 100644 --- a/ifpps.c +++ b/ifpps.c @@ -1022,6 +1022,7 @@ static void screen_update(WINDOW *screen, const char *ifname, const struct ifsta bool need_info) { int cpus, top, voff = 1, cvoff = 2; + u32 rate = device_bitrate(ifname); curs_set(0); @@ -1068,7 +1069,8 @@ static void screen_update(WINDOW *screen, const char *ifname, const struct ifsta } else { if (need_info) mvwprintw(screen, cvoff, 2, "(consider to increase " - "your sampling interval, e.g. -t 10000)"); + "your sampling interval, e.g. -t %d)", + rate > SPEED_1000 ? 10000 : 1000); else mvwprintw(screen, cvoff, 2, " " " "); @@ -1087,7 +1089,9 @@ static int screen_main(const char *ifname, uint64_t ms_interval, stats_screen = screen_init(true); - if (rate > SPEED_1000 && ms_interval <= 1000 && !suppress_warnings) + if (((rate > SPEED_1000 && ms_interval <= 1000) || + (rate = SPEED_1000 && ms_interval < 1000)) && + !suppress_warnings) need_info = true; while (!sigint) { -- cgit v1.2.3-54-g00ecf /net-next.git/?h=nds-private-remove'>summaryrefslogtreecommitdiff
ModeNameSize