All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemb@google.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 v2 5/5] net: remove unused net_device::min_header_len
Date: Sun, 29 Nov 2026 11:30:40 -0500	[thread overview]
Message-ID: <20261129163327.893403-6-willemb@google.com> (raw)
In-Reply-To: <20261129163327.893403-1-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		= &eth_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


  parent reply	other threads:[~2026-11-29 16:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 16:30 [PATCH net-next v2 0/5] net: remove dev_validate_header() and net_device::min_header_len Willem de Bruijn
2026-11-29 16:30 ` [PATCH net-next v2 1/5] net: ipa: remove ethernet-specific artifacts from modem netdev setup Willem de Bruijn
2026-11-29 16:30 ` [PATCH net-next v2 2/5] net: remove header_ops->validate and dev_validate_header() Willem de Bruijn
2026-11-30 17:36   ` netdev-bot+sashiko
2026-11-29 16:30 ` [PATCH net-next v2 3/5] packet: reset network header on all headerless devices Willem de Bruijn
2026-11-30 17:36   ` netdev-bot+sashiko
2026-11-29 16:30 ` [PATCH net-next v2 4/5] packet: use Ethernet header length in vlan_get_tci() Willem de Bruijn
2026-11-30 17:36   ` netdev-bot+sashiko
2026-11-29 16:30 ` Willem de Bruijn [this message]
2026-12-02  1:46 ` [PATCH net-next v2 0/5] net: remove dev_validate_header() and net_device::min_header_len willemb

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=20261129163327.893403-6-willemb@google.com \
    --to=willemb@google.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 \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.