]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Split out a more generic debugnet(4) from netdump(4)
authorcem <cem@FreeBSD.org>
Thu, 17 Oct 2019 16:23:03 +0000 (16:23 +0000)
committercem <cem@FreeBSD.org>
Thu, 17 Oct 2019 16:23:03 +0000 (16:23 +0000)
commitf3a0ee41db2b870d4a81d36ad4357bce1b1b840c
tree78e6de7914d8cdd8021ca4912f6223b1c30c0d32
parenta6c3971a22259e1f1ed20558772d0994ee7a769a
Split out a more generic debugnet(4) from netdump(4)

Debugnet is a simplistic and specialized panic- or debug-time reliable
datagram transport.  It can drive a single connection at a time and is
currently unidirectional (debug/panic machine transmit to remote server
only).

It is mostly a verbatim code lift from netdump(4).  Netdump(4) remains
the only consumer (until the rest of this patch series lands).

The INET-specific logic has been extracted somewhat more thoroughly than
previously in netdump(4), into debugnet_inet.c.  UDP-layer logic and up, as
much as possible as is protocol-independent, remains in debugnet.c.  The
separation is not perfect and future improvement is welcome.  Supporting
INET6 is a long-term goal.

Much of the diff is "gratuitous" renaming from 'netdump_' or 'nd_' to
'debugnet_' or 'dn_' -- sorry.  I thought keeping the netdump name on the
generic module would be more confusing than the refactoring.

The only functional change here is the mbuf allocation / tracking.  Instead
of initiating solely on netdump-configured interface(s) at dumpon(8)
configuration time, we watch for any debugnet-enabled NIC for link
activation and query it for mbuf parameters at that time.  If they exceed
the existing high-water mark allocation, we re-allocate and track the new
high-water mark.  Otherwise, we leave the pre-panic mbuf allocation alone.
In a future patch in this series, this will allow initiating netdump from
panic ddb(4) without pre-panic configuration.

No other functional change intended.

Reviewed by: markj (earlier version)
Some discussion with: emaste, jhb
Objection from: marius
Differential Revision: https://reviews.freebsd.org/D21421
32 files changed:
sys/amd64/conf/GENERIC
sys/arm64/conf/GENERIC
sys/conf/NOTES
sys/conf/files
sys/conf/options
sys/dev/alc/if_alc.c
sys/dev/bge/if_bge.c
sys/dev/bxe/bxe.c
sys/dev/bxe/bxe.h
sys/dev/cxgb/cxgb_adapter.h
sys/dev/cxgb/cxgb_main.c
sys/dev/cxgb/cxgb_sge.c
sys/dev/mlx4/mlx4_en/en.h
sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
sys/dev/re/if_re.c
sys/dev/virtio/network/if_vtnet.c
sys/i386/conf/GENERIC
sys/kern/kern_mbuf.c
sys/net/debugnet.c [new file with mode: 0644]
sys/net/debugnet.h [new file with mode: 0644]
sys/net/debugnet_inet.c [new file with mode: 0644]
sys/net/debugnet_int.h [new file with mode: 0644]
sys/net/if.c
sys/net/if_var.h
sys/net/iflib.c
sys/netinet/netdump/netdump.h
sys/netinet/netdump/netdump_client.c
sys/powerpc/conf/GENERIC
sys/powerpc/conf/GENERIC64
sys/sparc64/conf/GENERIC
sys/sys/mbuf.h
sys/sys/param.h