From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: netdev@vger.kernel.org
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
elder@kernel.org, Willem de Bruijn <willemb@google.com>
Subject: [PATCH net-next 6/6] net: remove unused net_device::min_header_len
Date: Tue, 24 Nov 2026 12:05:44 -0500 [thread overview]
Message-ID: <20261124170551.1874487-7-willemdebruijn.kernel@gmail.com> (raw)
In-Reply-To: <20261124170551.1874487-1-willemdebruijn.kernel@gmail.com>
From: Willem de Bruijn <willemb@google.com>
dev->min_header_len was introduced in commit 217e6fa24ce2 ("net:
introduce device min_header_len") for dev_validate_header() when
header_ops->validate and the CAP_SYS_RAWIO bypass could accept frames
shorter than hard_header_len.
Now that dev_validate_header() and the remaining workarounds in
af_packet have been removed, dev->min_header_len has no readers left.
Remove the field from struct net_device along with its remaining
assignments in ether_setup() and loopback setup.
Signed-off-by: Willem de Bruijn <willemb@google.com>
---
Documentation/networking/net_cachelines/net_device.rst | 1 -
drivers/net/loopback.c | 1 -
include/linux/netdevice.h | 2 --
net/ethernet/eth.c | 1 -
4 files changed, 5 deletions(-)
diff --git a/Documentation/networking/net_cachelines/net_device.rst b/Documentation/networking/net_cachelines/net_device.rst
index 7620d3fcb8dc..f73ea0069432 100644
--- a/Documentation/networking/net_cachelines/net_device.rst
+++ b/Documentation/networking/net_cachelines/net_device.rst
@@ -46,7 +46,6 @@ netdev_features_t gso_partial_features read_mostly
unsigned_int min_mtu
unsigned_int max_mtu
unsigned_short type
-unsigned_char min_header_len
unsigned_char name_assign_type
int group
struct net_device_stats stats
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index 1e6d1b7d71ba..6fdf00c223b9 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -173,7 +173,6 @@ static void gen_lo_setup(struct net_device *dev,
{
dev->mtu = mtu;
dev->hard_header_len = ETH_HLEN; /* 14 */
- dev->min_header_len = ETH_HLEN; /* 14 */
dev->addr_len = ETH_ALEN; /* 6 */
dev->type = ARPHRD_LOOPBACK; /* 0x0001*/
dev->flags = IFF_LOOPBACK;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 930899a7a577..2a1b3f48bed5 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1929,7 +1929,6 @@ enum netdev_reg_state {
* @max_mtu: Interface Maximum MTU value
* @type: Interface hardware type
* @hard_header_len: Maximum hardware header length.
- * @min_header_len: Minimum hardware header length
*
* @needed_headroom: Extra headroom the hardware may need, but not in all
* cases can this be guaranteed
@@ -2292,7 +2291,6 @@ struct net_device {
unsigned int min_mtu;
unsigned int max_mtu;
unsigned short type;
- unsigned char min_header_len;
unsigned char name_assign_type;
int group;
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index 39aab0f8035a..db39527d4704 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -330,7 +330,6 @@ void ether_setup(struct net_device *dev)
dev->header_ops = ð_header_ops;
dev->type = ARPHRD_ETHER;
dev->hard_header_len = ETH_HLEN;
- dev->min_header_len = ETH_HLEN;
dev->mtu = ETH_DATA_LEN;
dev->min_mtu = ETH_MIN_MTU;
dev->max_mtu = ETH_DATA_LEN;
--
2.56.1.839.g22a8290db9-goog
prev parent reply other threads:[~2026-11-24 17:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 17:05 [PATCH net-next 0/6] net: remove dev_validate_header() and net_device::min_header_len Willem de Bruijn
2026-11-24 17:05 ` [PATCH net-next 1/6] net: ipa: remove ethernet-specific artifacts from modem netdev setup Willem de Bruijn
2026-11-24 17:05 ` [PATCH net-next 2/6] net: remove header_ops->validate and dev_validate_header() Willem de Bruijn
2026-11-24 17:05 ` [PATCH net-next 3/6] packet: validate TX header length before skb allocation Willem de Bruijn
2026-11-24 17:05 ` [PATCH net-next 4/6] packet: reset network header on all headerless devices Willem de Bruijn
2026-11-24 17:05 ` [PATCH net-next 5/6] packet: use Ethernet header length in vlan_get_tci() Willem de Bruijn
2026-11-24 17:05 ` Willem de Bruijn [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261124170551.1874487-7-willemdebruijn.kernel@gmail.com \
--to=willemdebruijn.kernel@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=elder@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox