genet: pullup minimum header amount for IPv4
authorMike Karels <karels@FreeBSD.org>
Sun, 20 Jun 2021 17:50:31 +0000 (12:50 -0500)
committerMike Karels <karels@FreeBSD.org>
Sat, 26 Jun 2021 16:04:02 +0000 (11:04 -0500)
commit184291b0a56a68f2c0dc4388419b0f7d85a08cf4
treebfa2725d3c627dd5f1765adf02295e30578669b8
parent5dd84e315a9f777772017f9f628aa67f08a6493a
genet: pullup minimum header amount for IPv4

The genet driver (RPi4 Ethernet) had code to pull headers into the
first mbuf if there was only an Ethernet header there.  This was
originally needed for ICMPv6 replies, then for forwarded IPv6/TCP.
Now a situation has been found where it is needed for IPv4, when
using NAT with IPFW.  Generalize to do this for all protocols.
Rather than using an IPv6-related definition for the length, move
the length to a variable that can be set with sysctl
(hw.genet.tx_hdr_min).  Move an old tunable to a new RDTUN variable
with a better name.

PR: 25607
MFC after: 3 days
Reviewers: emaste
Differential Revision: https://reviews.freebsd.org/D30831
sys/arm64/broadcom/genet/if_genet.c