freebsd-dev/sys/conf
Hiren Panchasara 86a996e6bd There are times when it would be really nice to have a record of the last few
packets and/or state transitions from each TCP socket. That would help with
narrowing down certain problems we see in the field that are hard to reproduce
without understanding the history of how we got into a certain state. This
change provides just that.

It saves copies of the last N packets in a list in the tcpcb. When the tcpcb is
destroyed, the list is freed. I thought this was likely to be more
performance-friendly than saving copies of the tcpcb. Plus, with the packets,
you should be able to reverse-engineer what happened to the tcpcb.

To enable the feature, you will need to compile a kernel with the TCPPCAP
option. Even then, the feature defaults to being deactivated. You can activate
it by setting a positive value for the number of captured packets. You can do
that on either a global basis or on a per-socket basis (via a setsockopt call).

There is no way to get the packets out of the kernel other than using kmem or
getting a coredump. I thought that would help some of the legal/privacy concerns
regarding such a feature. However, it should be possible to add a future effort
to export them in PCAP format.

I tested this at low scale, and found that there were no mbuf leaks and the peak
mbuf usage appeared to be unchanged with and without the feature.

The main performance concern I can envision is the number of mbufs that would be
used on systems with a large number of sockets. If you save five packets per
direction per socket and have 3,000 sockets, that will consume at least 30,000
mbufs just to keep these packets. I tried to reduce the concerns associated with
this by limiting the number of clusters (not mbufs) that could be used for this
feature. Again, in my testing, that appears to work correctly.

Differential Revision:	D3100
Submitted by:		Jonathan Looney <jlooney at juniper dot net>
Reviewed by:		gnn, hiren
2015-10-14 00:35:37 +00:00
..
config.mk Populate new KERN_OPTS from all the opt_*.h files in 2015-02-18 15:25:19 +00:00
dtb.mk Prefer install over mkdir to create the directory. Add test to ensure 2015-02-09 16:29:44 +00:00
files There are times when it would be really nice to have a record of the last few 2015-10-14 00:35:37 +00:00
files.amd64 Move kbd.c to main sys/conf/files list 2015-09-21 17:31:11 +00:00
files.arm Move pmu.c to files.arm and rename the option to pmu. This is not hwpmc 2015-10-07 13:19:44 +00:00
files.arm64 Move kbd.c to main sys/conf/files list 2015-09-21 17:31:11 +00:00
files.i386 NTB: Enable 32-bit support 2015-10-13 17:22:23 +00:00
files.mips Move kbd.c to main sys/conf/files list 2015-09-21 17:31:11 +00:00
files.pc98 Move kbd.c to main sys/conf/files list 2015-09-21 17:31:11 +00:00
files.powerpc Move kbd.c to main sys/conf/files list 2015-09-21 17:31:11 +00:00
files.sparc64 Move kbd.c to main sys/conf/files list 2015-09-21 17:31:11 +00:00
kern.mk Build changes that allow the modules on arm64. 2015-10-08 17:42:08 +00:00
kern.opts.mk Add a note of clarification. MK_* variables only control what modules 2015-03-27 17:36:22 +00:00
kern.post.mk Build changes that allow the modules on arm64. 2015-10-08 17:42:08 +00:00
kern.pre.mk Change md(4) to use weak symbols as start, end and size for the embedded 2015-08-13 15:16:34 +00:00
kmod_syms.awk
kmod.mk Build changes that allow the modules on arm64. 2015-10-08 17:42:08 +00:00
ldscript.amd64 amd64: set the correct LMA values 2015-06-26 07:12:17 +00:00
ldscript.arm
ldscript.arm64 Bring in the start of the arm64 kernel. 2015-04-13 14:43:10 +00:00
ldscript.i386
ldscript.mips
ldscript.mips.cfe
ldscript.mips.mips64
ldscript.mips.octeon1
ldscript.powerpc Refactor PowerPC (especially AIM) init sequence to be less baroque. 2015-01-18 18:32:43 +00:00
ldscript.powerpc64 Refactor PowerPC (especially AIM) init sequence to be less baroque. 2015-01-18 18:32:43 +00:00
ldscript.sparc64
Makefile.amd64
Makefile.arm Change md(4) to use weak symbols as start, end and size for the embedded 2015-08-13 15:16:34 +00:00
Makefile.arm64 Build changes that allow the modules on arm64. 2015-10-08 17:42:08 +00:00
Makefile.i386
Makefile.mips
Makefile.pc98 Fix kernel build ${MACHINE} path 2015-04-16 22:34:10 +00:00
Makefile.powerpc Make 32-bit PowerPC kernels, like 64-bit PowerPC kernels, position-independent 2015-03-07 20:14:46 +00:00
Makefile.sparc64
makeLINT.mk
makeLINT.sed
newvers.sh newvers.sh: remove 'X' hack from shell script 2015-04-08 04:01:02 +00:00
NOTES There are times when it would be really nice to have a record of the last few 2015-10-14 00:35:37 +00:00
options There are times when it would be really nice to have a record of the last few 2015-10-14 00:35:37 +00:00
options.amd64 Microsoft vmbus, storage and other related driver enhancements for HyperV. 2015-04-29 10:12:34 +00:00
options.arm Add support for getting the memory map from EFI if it has been pased in 2015-05-24 16:11:30 +00:00
options.arm64 Add the SOC_HISI_HI6220 option. This will be used to enable drivers for 2015-08-26 18:09:17 +00:00
options.i386 Remove support for Xen PV domU kernels. Support for HVM domU kernels 2015-04-30 15:48:48 +00:00
options.mips
options.pc98
options.powerpc Create a RouterBoard platform and use it to create a flash map 2015-08-22 05:50:18 +00:00
options.sparc64
systags.sh
WITHOUT_SOURCELESS
WITHOUT_SOURCELESS_HOST
WITHOUT_SOURCELESS_UCODE Add nodevice iwmfw to WITHOUT_SOURCELESS_UCODE. 2015-08-08 20:45:47 +00:00