summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat
Commit message (Collapse)AuthorAgeFilesLines
* Now, after r263102 we have ifi_oqdrops in if_data, restore printing ofglebius2014-03-191-3/+7
| | | | | | | | | output queue drops in netstat(1). No driver, neither kernel fills this field in if_data, yet. Sponsored by: Netflix Sponsored by: Nginx, Inc.
* Garbage collect long time obsoleted (or never used) stuff from routing API.glebius2014-03-152-18/+0
|
* Remove AppleTalk support.glebius2014-03-147-363/+38
| | | | | | | | | | AppleTalk was a network transport protocol for Apple Macintosh devices in 80s and then 90s. Starting with Mac OS X in 2000 the AppleTalk was a legacy protocol and primary networking protocol is TCP/IP. The last Mac OS X release to support AppleTalk happened in 2009. The same year routing equipment vendors (namely Cisco) end their support. Thus, AppleTalk won't be supported in FreeBSD 11.0-RELEASE.
* Remove IPX support.glebius2014-03-147-583/+44
| | | | | | | | | | | IPX was a network transport protocol in Novell's NetWare network operating system from late 80s and then 90s. The NetWare itself switched to TCP/IP as default transport in 1998. Later, in this century the Novell Open Enterprise Server became successor of Novell NetWare. The last release that claimed to still support IPX was OES 2 in 2007. Routing equipment vendors (e.g. Cisco) discontinued support for IPX in 2011. Thus, IPX won't be supported in FreeBSD 11.0-RELEASE.
* Since 32-bit if_baudrate isn't enough to describe a baud rate of a 10 Gbitglebius2014-03-131-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | interface, in the r241616 a crutch was provided. It didn't work well, and finally we decided that it is time to break ABI and simply make if_baudrate a 64-bit value. Meanwhile, the entire struct if_data was reviewed. o Remove the if_baudrate_pf crutch. o Make all fields of struct if_data fixed machine independent size. The notion of data (packet counters, etc) are by no means MD. And it is a bug that on amd64 we've got a 64-bit counters, while on i386 32-bit, which at modern speeds overflow within a second. This also removes quite a lot of COMPAT_FREEBSD32 code. o Give 16 bit for the ifi_datalen field. This field was provided to make future changes to if_data less ABI breaking. Unfortunately the 8 bit size of it had effectively limited sizeof if_data to 256 bytes. o Give 32 bits to ifi_mtu and ifi_metric. o Give 64 bits to the rest of fields, since they are counters. __FreeBSD_version bumped. Discussed with: emax Sponsored by: Netflix Sponsored by: Nginx, Inc.
* Fix compilation for 32-bit machines.glebius2014-03-061-4/+4
|
* Hide struct rtentry from userland.glebius2014-03-051-0/+1
|
* - Remove rt_metrics_lite and simply put its members into rtentry.glebius2014-03-053-31/+37
| | | | | | | | | | | | | | | | - Use counter(9) for rt_pksent (former rt_rmx.rmx_pksent). This removes another cache trashing ++ from packet forwarding path. - Create zini/fini methods for the rtentry UMA zone. Via initialize mutex and counter in them. - Fix reporting of rmx_pksent to routing socket. - Fix netstat(1) to report "Use" both in kvm(3) and sysctl(3) mode. The change is mostly targeted for stable/10 merge. For head, rt_pksent is expected to just disappear. Discussed with: melifaro Sponsored by: Netflix Sponsored by: Nginx, Inc.
* Whenever flowtable lookup fails, we do route lookup and then try toglebius2014-02-141-1/+3
| | | | | | | | | | | | | | | | | | insert flow entry. During the route lookup the critical section is exited. It may happen, that after route lookup we will be executed on an other CPU that already has such flowentry. Before this change we simply freed the flowentry and returned to ip_output() with failure. Actually there is nothing wrong with using previously allocated flow entry, updating it properly. Thus, make flowentry_insert() return the new either old fle, and make use of it. Count reuses as "collisions" and real inserts as "inserts". Reviewed by: adrian Sponsored by: Netflix Sponsored by: Nginx, Inc.
* Reword.adrian2014-02-141-1/+1
| | | | Suggestion: glebius
* Don't insert a flowtable entry if the lle isn't yet valid.adrian2014-02-141-0/+1
| | | | | | | | | | | | | | | | | | Some of the collisions that are occuring are due to flowtable lookups that succeed but have an invalid lle - typically because the L2 adjacency lookup hasn't completed. This would lead to a follow-up insert which would then fail (ie, collision) and the code would fall through to doing a slow-path L2/L3 lookup in the netinet/netinet6 code. This patch simply aborts storing a new flowtable entry if the lle isn't yet valid. Whilst I'm here, add a new pcpu counter for the item so the number of failures can be tracked separately from generic "collisions." Reviewed by: glebius MFC after: 10 days Sponsored by: Netflix, Inc.
* o Revamp API between flowtable and netinet, netinet6.glebius2014-02-074-3/+87
| | | | | | | | | | | | | | | | | | | | | | | | - ip_output() and ip_output6() simply call flowtable_lookup(), passing mbuf and address family. That's the only code under #ifdef FLOWTABLE in the protocols code now. o Revamp statistics gathering and export. - Remove hand made pcpu stats, and utilize counter(9). - Snapshot of statistics is available via 'netstat -rs'. - All sysctls are moved into net.flowtable namespace, since spreading them over net.inet isn't correct. o Properly separate at compile time INET and INET6 parts. o General cleanup. - Remove chain of multiple flowtables. We simply have one for IPv4 and one for IPv6. - Flowtables are allocated in flowtable.c, symbols are static. - With proper argument to SYSINIT() we no longer need flowtable_ready. - Hash salt doesn't need to be per-VNET. - Removed rudimentary debugging, which use quite useless in dtrace era. The runtime behavior of flowtable shouldn't be changed by this commit. Sponsored by: Netflix Sponsored by: Nginx, Inc.
* Print the MD5 signature information introduced in r221023 in thebz2014-02-051-0/+11
| | | | | | TCP statistics output. MFC after: 3 weeks
* Bump dates in nestat(1) and route(8) man pages.melifaro2014-01-111-1/+1
| | | | | | | Fix several small errors introduced by r260524. Suggested by: glebius MFC after: 2 weeks
* Add -4/-6 shorthand for -finet/-finet6 in route(8) and netstat(8).melifaro2014-01-102-15/+38
| | | | MFC after: 2 weeks
* Explicitly free rt_tables to please Coverity.melifaro2013-12-311-1/+3
| | | | | | Reported by: Coverity Coverity CID: 1147174 MFC after: 2 weeks
* Claim copyright since I've almost rewritten this file in r256512.glebius2013-12-291-0/+1
|
* Further split kvm(3) and sysctl interfaces for route table printing.melifaro2013-12-201-72/+89
| | | | | MFC after: 4 weeks Sponsored by: Yandex LLC
* Use more fine-grained kvm(3) symbol lookup: routing code retrieves onlymelifaro2013-12-207-97/+150
| | | | | | | | | | | necessary symbols needed per subsystem. Main kvm(3) init is now delayed as much as possbile. This finally fixes performance issues reported in kern/167204. Some non-working code (ng_socket.ko symbol addresses calculation) removed. Some global variables eliminated. PR: kern/167204 MFC after: 4 weeks
* Restore corefiles handling via kvm(3).melifaro2013-12-183-1/+4
| | | | | Found by: John-Mark Gurney <jmg at funkthat.com> MFC after: 4 weeks
* Switch netstat -rn to use standard API for retrieving list of routesmelifaro2013-12-181-59/+121
| | | | | | | | | | | | | | | | | | | | instead of peeking inside in-kernel radix via kget. This permits us to change kernel structures without breaking userland. Additionally, this change provide more reliable and faster output. `Refs` and `Use` fields available in IPv4 by default (and via -W for other families) were removed. `Refs` is radix-specific thing which is not informative for users. `Use` field value is handy sometimes, but a) current API does not support it and b) I'm not sure we will support per-rte pcpu counters in near future. Old method of retrieving data is still supported (either by defining NewTree=0 or running netstat with -A). However, Refs/Use fields are hidden. Sponsored by: Yandex LLC MFC after: 4 weeks PR: kern/167204
* 'netstat -i' no longer supports working on a vmcore.glebius2013-10-301-3/+1
|
* Make userland tools honor WITHOUT_PF build option.glebius2013-10-293-2/+12
| | | | Tested by: dt71@gmx.com
* Rewrite netstat/if.c to use getifaddrs(3) and getifmaddrs(3) instead ofglebius2013-10-154-450/+307
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libkvm digging in kernel memory. This is possible since r231506 made getifaddrs(3) to supply if_data for each ifaddr. The pros of this change is that now netstat(1) doesn't know about kernel struct ifnet and struct ifaddr. And these structs are about to change significantly in head soon. New netstat binary will work well with 10.0 and any future kernel. The cons is that now it isn't possible to obtain interface statistics from a vmcore. Functions intpr() and sidewaysintpr() were rewritten from scratch. The output of netstat(1) has underwent the following changes: 1) The MTU is not printed for protocol addresses, since it has no notion. Dash is printed instead. If there would be a strong desire to return previous output, it is doable. 2) Output interface queue drops are not printed. Currently this data isn't available to userland via any API. We plan to drop 'struct ifqueue' from 'struct ifnet' very soon, so old kvm(3) access to queue drops is soon to be broken, too. The plan is that drivers would handle their queues theirselves and a new field in if_data would be updated in case of drops. 3) In-kernel reference count for multicast addresses isn't printed. I doubt that anyone used it. Anyway, netstat(1) is sysadmin tool, not kernel debugger. Sponsored by: Netflix Sponsored by: Nginx, Inc.
* Remove obtained, but never used data.glebius2013-10-151-10/+5
| | | | Found by: gcc
* - Use getnameinfo(3) instead of gethostbyaddr(3) or inet_ntop(3).hrs2013-08-171-18/+25
| | | | | - Fill sin6_scope_id from in6p.sin6_addr.s6_addr[2]. struct inpcb has struct in6_addr for the endpoint addresses, so sin6_scope_id must be filled.
* Remove the large part of struct ipsecstat. Only few fields of thisae2013-07-231-69/+3
| | | | | | | | | | | structure is used, but they already have equal fields in the struct newipsecstat, that was introduced with FAST_IPSEC and then was merged together with old ipsecstat structure. This fixes kernel stack overflow on some architectures after migration ipsecstat to PCPU counters. Reported by: Taku YAMAMOTO, Maciej Milewski
* Sweep unused nlist entries.glebius2013-07-161-48/+26
| | | | Sponsored by: Nginx, Inc.
* Introduce new structure sfstat for collecting sendfile's statisticsae2013-07-152-11/+15
| | | | | | | and remove corresponding fields from struct mbstat. Use PCPU counters and SFSTAT_INC() macro for update these statistics. Discussed with: glebius
* Add -F fibnum option to specify an FIB number for -r flag.hrs2013-07-124-11/+40
|
* Migrate structs ahstat, espstat, ipcompstat, ipipstat, pfkeystat,ae2013-07-092-5/+5
| | | | ipsec4stat, ipsec6stat to PCPU counters.
* Migrate struct carpstats to PCPU counters.ae2013-07-091-1/+1
|
* Migrate structs ip6stat, icmp6stat and rip6stat to PCPU counters.ae2013-07-091-3/+3
|
* Migrate structs arpstat, icmpstat, mrtstat, pimstat and udpstat to PCPUae2013-07-092-5/+5
| | | | counters.
* Use new macros to implement ipstat and tcpstat using PCPU counters.ae2013-07-093-20/+16
| | | | Change interface of kread_counters() similar ot kread() in the netstat(1).
* Prepare network statistics structures for migration to PCPU counters.ae2013-07-093-125/+109
| | | | | | | | | | Use uint64_t as type for all fields of structures. Changed structures: ahstat, arpstat, espstat, icmp6_ifstat, icmp6stat, in6_ifstat, ip6stat, ipcompstat, ipipstat, ipsecstat, mrt6stat, mrtstat, pfkeystat, pim6stat, pimstat, rip6stat, udpstat. Discussed with: arch@
* Replace hardcoded numbers. Also use interface-local scope name insteadae2013-04-161-9/+9
| | | | of node-local.
* Use kvm_counter_u64_fetch() to fix obtaining ipstat and tcpstat fromglebius2013-04-103-29/+69
| | | | | | kernel core files. Sponsored by: Nginx, Inc.
* Merge from projects/counters: TCP/IP stats.glebius2013-04-081-124/+130
| | | | | | | | | Convert 'struct ipstat' and 'struct tcpstat' to counter(9). This speeds up IP forwarding at extreme packet rates, and makes accounting more precise. Sponsored by: Nginx, Inc.
* Add forgotten .Elmelifaro2013-03-091-0/+1
| | | | MFC with: r248112
* Document netstat -Q flags meaning.melifaro2013-03-091-1/+6
| | | | MFC after: 1 week
* WARNS=6 compliancecharnier2013-02-196-11/+10
|
* Use pluralies() for "entry"/"entries".glebius2013-01-221-1/+1
|
* Fill sin6_scope_id in sockaddr_in6 before passing it from the kernel tohrs2012-11-171-0/+6
| | | | | | | | | | | | userland via routing socket or sysctl. This eliminates the following KAME-specific sin6_scope_id handling routine from each userland utility: sin6.sin6_scope_id = ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]); This behavior can be controlled by net.inet6.ip6.deembed_scopeid. This is set to 1 by default (sin6_scope_id will be filled in the kernel). Reviewed by: bz
* Show the number of times we block waiting for mbufs.alfred2012-10-251-4/+18
| | | | | | | | | | | | | | | | | | Machines can stall out because mbufs are low, however sometimes we won't see "requests denied", instead we see user land processes or kernel threads blocking waiting for mbufs because they set M_WAIT. These consumers do not see errors, only stalling. Unfortunately until now, netstat did not export this information so you could have experienced an mbuf shortage and have no way of seeing it unless you happen to run netstat at the exact time of the shortage and see "in use" = "max". By exporting the number of times processes are blocked, we can effectively see how often non-interrupt context threads are effectively "denied". MFC after: 2 weeks
* Remove unused variable. Newer versions of gcc care.eadler2012-10-221-2/+0
| | | | | | Submitted by: Sascha Wildner <saw@online.de> Approved by: cperciva MFC after: 3 days
* Merge the projects/pf/head branch, that was worked on for last six months,glebius2012-09-081-5/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into head. The most significant achievements in the new code: o Fine grained locking, thus much better performance. o Fixes to many problems in pf, that were specific to FreeBSD port. New code doesn't have that many ifdefs and much less OpenBSDisms, thus is more attractive to our developers. Those interested in details, can browse through SVN log of the projects/pf/head branch. And for reference, here is exact list of revisions merged: r232043, r232044, r232062, r232148, r232149, r232150, r232298, r232330, r232332, r232340, r232386, r232390, r232391, r232605, r232655, r232656, r232661, r232662, r232663, r232664, r232673, r232691, r233309, r233782, r233829, r233830, r233834, r233835, r233836, r233865, r233866, r233868, r233873, r234056, r234096, r234100, r234108, r234175, r234187, r234223, r234271, r234272, r234282, r234307, r234309, r234382, r234384, r234456, r234486, r234606, r234640, r234641, r234642, r234644, r234651, r235505, r235506, r235535, r235605, r235606, r235826, r235991, r235993, r236168, r236173, r236179, r236180, r236181, r236186, r236223, r236227, r236230, r236252, r236254, r236298, r236299, r236300, r236301, r236397, r236398, r236399, r236499, r236512, r236513, r236525, r236526, r236545, r236548, r236553, r236554, r236556, r236557, r236561, r236570, r236630, r236672, r236673, r236679, r236706, r236710, r236718, r237154, r237155, r237169, r237314, r237363, r237364, r237368, r237369, r237376, r237440, r237442, r237751, r237783, r237784, r237785, r237788, r237791, r238421, r238522, r238523, r238524, r238525, r239173, r239186, r239644, r239652, r239661, r239773, r240125, r240130, r240131, r240136, r240186, r240196, r240212. I'd like to thank people who participated in early testing: Tested by: Florian Smeets <flo freebsd.org> Tested by: Chekaluk Vitaly <artemrts ukr.net> Tested by: Ben Wilber <ben desync.com> Tested by: Ian FREISLICH <ianf cloudseed.co.za>
* Allow netstat to be build if INET is not defined in the kernel.tuexen2012-07-162-0/+8
| | | | | | | Thanks to Garrett Cooper for reporting the issue. MFC after: 3 days X-MFC: 238501
* - Updated TOE support in the kernel.np2012-06-191-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Stateful TCP offload drivers for Terminator 3 and 4 (T3 and T4) ASICs. These are available as t3_tom and t4_tom modules that augment cxgb(4) and cxgbe(4) respectively. The cxgb/cxgbe drivers continue to work as usual with or without these extra features. - iWARP driver for Terminator 3 ASIC (kernel verbs). T4 iWARP in the works and will follow soon. Build-tested with make universe. 30s overview ============ What interfaces support TCP offload? Look for TOE4 and/or TOE6 in the capabilities of an interface: # ifconfig -m | grep TOE Enable/disable TCP offload on an interface (just like any other ifnet capability): # ifconfig cxgbe0 toe # ifconfig cxgbe0 -toe Which connections are offloaded? Look for toe4 and/or toe6 in the output of netstat and sockstat: # netstat -np tcp | grep toe # sockstat -46c | grep toe Reviewed by: bz, gnn Sponsored by: Chelsio communications. MFC after: ~3 months (after 9.1, and after ensuring MFC is feasible)
* Eliminate an unused parameter of static method igmp_stats_live_old().delphij2012-04-131-2/+2
| | | | MFC after: 1 month
OpenPOWER on IntegriCloud