Bug 196252 - [patch] show tcp hostcache usage in netstat -s -p tcp
Summary: [patch] show tcp hostcache usage in netstat -s -p tcp
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.1-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: Marcelo Araujo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-24 14:43 UTC by Anton Yuzhaninov
Modified: 2017-01-27 02:35 UTC (History)
1 user (show)

See Also:


Attachments
patch for netstat/inet.c (687 bytes, patch)
2014-12-24 14:43 UTC, Anton Yuzhaninov
no flags Details | Diff
patch for netstat/inet.c (877 bytes, patch)
2016-11-16 00:03 UTC, Anton Yuzhaninov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Yuzhaninov 2014-12-24 14:43:13 UTC
Created attachment 150936 [details]
patch for netstat/inet.c

There is counters in kernel updated when RTT, RRTvar and SS threshold usaed from tcp hostcache. But this counters is not shown by any userland tools.

Patch to add this counters to netstat(1) attached.
Comment 1 Marcelo Araujo freebsd_committer freebsd_triage 2016-01-22 08:35:27 UTC
I'm taking it.
Comment 2 Marcelo Araujo freebsd_committer freebsd_triage 2016-01-22 09:13:18 UTC
This patch doesn't apply clean anymore.
Please, can you redo the patch?

Best,
Comment 3 Marcelo Araujo freebsd_committer freebsd_triage 2016-01-29 03:28:57 UTC
Waiting submitter feedback.
Comment 4 Anton Yuzhaninov 2016-11-16 00:03:17 UTC
Created attachment 177042 [details]
patch for netstat/inet.c

Add libxo support.
Comment 5 Anton Yuzhaninov 2016-11-16 00:10:30 UTC
I've updated patch.

netstat -s -p tcp without patch:
        41 connections established (including accepts)
        45 connections closed (including 0 drops)
                15 connections updated cached RTT on close
                15 connections updated cached RTT variance on close
                0 connections updated cached ssthresh on close

netstat -s -p tcp with my patch:
        41 connections established (including accepts)
                12 times used RTT from hostcache
                12 times used RTT variance from hostcache
                0 times used slow-start threshold from hostcache
        45 connections closed (including 0 drops)
                15 connections updated cached RTT on close
                15 connections updated cached RTT variance on close
                0 connections updated cached ssthresh on close
Comment 6 commit-hook freebsd_committer freebsd_triage 2016-12-28 13:12:14 UTC
A commit references this bug:

Author: araujo
Date: Wed Dec 28 13:11:22 UTC 2016
New revision: 310698
URL: https://svnweb.freebsd.org/changeset/base/310698

Log:
  Print hostcache usage counts with TCP statistics.

  PR:		196252
  Submitted by:	Anton Yuzhaninov <citrin+pr@citrin.ru>
  MFC after:	3 weeks.

Changes:
  head/usr.bin/netstat/inet.c
Comment 7 Marcelo Araujo freebsd_committer freebsd_triage 2016-12-28 13:13:24 UTC
Committed, thanks for the patch!
Comment 8 commit-hook freebsd_committer freebsd_triage 2017-01-27 02:35:24 UTC
A commit references this bug:

Author: araujo
Date: Fri Jan 27 02:35:05 UTC 2017
New revision: 312856
URL: https://svnweb.freebsd.org/changeset/base/312856

Log:
  MFC r310698:

  Print hostcache usage counts with TCP statistics.

  PR:		196252
  Submitted by:	Anton Yuzhaninov <citrin+pr@citrin.ru>
  MFC after:	3 weeks.

Changes:
_U  stable/11/
  stable/11/usr.bin/netstat/inet.c