From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.222.200 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795970011; b=Qu71DA5rzxikpP7B9thL+R/4lrnqxDsSzhtwLcmsAe2nqlOx6c7LqOSeAiFAnzXaS6cu Kyg2G5XWhif38VFh0mp96RwsVPrlKA/CNSA74aRsME7s8opMttK9xpzxLTG7CGYJWTnfN xpuOywql7B472K0jmg74QkdOzYGuVAtLbw6hbm4QtzWw+s2LE6AgKzZ5vKwcBCijYx0bU Vz5Ly5PK2rFZhl9XYlPwnOy3Jz1oSrSJ//cY80m2/HVwkRHIN1Voc7V24LSvNHw1sThbV BHrSInrVqx8dH9EgzEOAGuRsPTtuy6k2Ay/Ady/aBfq3dKolJp8smqX2HqsUbBOwP3w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795970011; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Received:Date:Mime-Version:X-Mailer:Message-ID: Subject:From:To:Cc:Content-Type; bh=yMAhr9lwoDKs53KV2rJhE2fHhNvfWkMZ8//R98mU5fw=; b=etfJqhFyEr156vAmK7W5StDU8Ehhvy9lGHrABRviBej9BtggyFnoQ5dWF5JzlPdRnLkA oiQN8X146cSWpo4EGfBxmPlFNolp2E2OLOIorIIObwI1YZYXnB1IgCexecEoGL2NCf5fd X5jvLD34jDVlM7l4Mzszj3CbhUqBtLhZZnUXpJRAz/+HYfujab2z1AqP8pxooTrKC7rar gFYK5yN+HpPq0ukJWtRZkRcpRO3YFE5d0/RUdjUskU329qztwLMTkn68MvLrlZcUh1N81 tcKc2MLV7ybePJ35mn1e/NI9nx1aXtwRldXU50rVuxeDFZgdcOpJwlmZ8O+DstRNQXA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--willemb.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=gqYVIpyW; arc=none smtp.remote-ip=209.85.222.200 Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D000606A31C for ; Sun, 29 Nov 2026 16:33:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1D000606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--willemb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=gqYVIpyW Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-9308eafb465so1869919085a.2 for ; Sun, 29 Nov 2026 08:33:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1795970010; x=1796574810; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:mime-version:date:from :to:cc:subject:date:message-id:reply-to:content-type; bh=yMAhr9lwoDKs53KV2rJhE2fHhNvfWkMZ8//R98mU5fw=; b=gqYVIpyWMeFYCVzApcnMrEVe3NEES+UvmJ9zf8VCJOEnd2Ddpn+Lk546Z3X81FQoxt mXIDEkDaahi+cFZ/pOpFcLLoGLoIWSM1aIWvUxZFJgAxSalenDk/HwpPTbBgkqiqLr4Y KNlloI/MnsBi2bPModxIEhaYTGmhY878TkzxHm9PdftaRUanxeRK1k5euNR9v6rYLTYU c6GnF5ON/IIgaTkKI/eCL6l8fw7Vx6u7B2IkaZDoOjOfoNXsBwgSFTzlQKc1rTR+qQH1 Ho2YZohycDHoUrBOPzk7QOn6lUvH7WaPqyCRTBvOa76nrMGsqeDPhhQnMdEsKFl9anKO M8lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795970010; x=1796574810; h=content-type:cc:to:from:subject:message-id:mime-version:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=yMAhr9lwoDKs53KV2rJhE2fHhNvfWkMZ8//R98mU5fw=; b=HiopMZV6Q8OuP3C+kiM7ErOQn7Zz7vH9s/J5o7JkhQe02ZMv3NHYNVCiDiafol1maW ONgXVNYAbupWlrYoXq4aE5JyY0Rdj3POv3WmsLPFHkt6W+JUOatjWCQwZiYx4/GMStPl EBOoDbqP8s0inNlOJJqnoYB/rwpc5H5/hurqIcas7ydnASXBjyW6/umGAeDIb/MnwJXB y9rRUwsyh6xmh66ajzTqD0qIC6IoZA/0+Km/tj51XSd4kZJchTHx2J82PwjedusNov1u SoN9sWbo0rLgWxR3v9QMbb6zECYN/LvJKxeyRWbdBJfHplKJF0t2GunOhNr3bhtOaRnd +lGg== X-Gm-Message-State: APuU4Z8w4Nz9Azk/FZbJgqAud27bCQ8dUPGBi0MQbek/Pn5QGt3rDZru sZr3tzTCc+ZNMxnwPzL633tFoP12i7aAObF27cpU/DW5BzzjsNPAwnBhmvEObT+/u6XIm5DwbJJ 8kGML5giCLo0DDbG9fyrXHkT2uu0Nn9z+kOjZQByU9cJ1WRILpGttCAs79X9kIXglAz8vsCUimD laJ6z/kGpdq5fJhWO52YM7QCic86DBLD4ktRcXoi8Apg== X-Received: from qknqc6.prod.google.com ([2002:a05:620a:6546:b0:93f:3e52:b5ba]) (user=willemb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:620a:4453:b0:93e:c12c:fbba with SMTP id af79cd13be357-949bab47df4mr5597143285a.71.1795970009735; Sun, 29 Nov 2026 08:33:29 -0800 (PST) Date: Sun, 29 Nov 2026 11:30:35 -0500 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 X-Mailer: git-send-email 2.56.1.839.g22a8290db9-goog Message-ID: <20261129163327.893403-1-willemb@google.com> Subject: [PATCH net-next v2 0/5] net: remove dev_validate_header() and net_device::min_header_len From: Willem de Bruijn 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 Content-Type: text/plain; charset="UTF-8" Remove unused link-layer header validation plumbing, clean up the remaining af_packet users, and drop net_device::min_header_len. Mostly cleanup, with two user-visible changes: - Patch 3: on devices that set hard_header_len but have no link layer header (e.g., PPP), SOCK_RAW sends, with or without a TX_RING, now always have skb->network_header at the start of the packet. Before, only short packets sent without a TX_RING did. - Patch 4: on SOCK_DGRAM, the VLAN TCI of non-offloaded tags is now reported on all Ethernet devices, including those with hard_header_len != ETH_HLEN, and omitted (without setting TP_STATUS_VLAN_VALID) on non-Ethernet devices. 1. Drop stale Ethernet fields (including min_header_len) in IPA modem. 2. Remove header_ops->validate and dev_validate_header(). 3. Reset network header on all headerless devices via dev_has_header(). 4. Use ARPHRD_ETHER / ARPHRD_LOOPBACK and ETH_HLEN in vlan_get_tci(). 5. Remove unused net_device::min_header_len. Testing (under vng): - tools/testing/selftests/net: psock_snd.sh, psock_tpacket, and txring_overwrite. - Custom tests for short/zero header validation (SOCK_RAW, SOCK_DGRAM, SOCK_PACKET, TX_RING), SOCK_PACKET retry device swap via userfaultfd (tun -> veth), non-offloaded outgoing VLAN TCI capture (AUXDATA with non-zero TCI, TCI 0, TP_STATUS_COPY, and tun; TPACKET_V2; TPACKET_V3), and SOCK_RAW network header offset over PPP (40B/100B IPv4, with and without TX_RING). Link: https://patch.msgid.link/willemdebruijn.kernel.251660d5aa3e@gmail.com Changes v1 -> v2 - rebase on net-next - cover letter: add Link: to the thread where this cleanup was proposed - cover letter: correct the summary of the network header change - cover letter: update the summary of the VLAN change and the list of custom tests to match v2 - patch 1/5: add Acked-by from Alex Elder - patch 1/5: replace with for ETH_P_MAP and ETH_MIN_MTU - patch 2/5: compare against live READ_ONCE(dev->hard_header_len) in all three af_packet callers instead of the snapshotted value. In packet_sendmsg_spkt() the snapshot could come from a different device than the one transmitted on (Sashiko) - drop v1 patch 3/6 ("packet: validate TX header length before skb allocation"): not needed to remove min_header_len. This keeps the TX header length checks against the live hard_header_len, after the skb is built, which also addresses the Sashiko report on that patch - patch 3/5: no code change; clarify commit message (needed_headroom vs hard_header_len, scope of the 6in4 workaround, why tpacket_fill_skb() is changed as well, and list hdlc_null_ops as a second header_ops without ->create) - patch 4/5: have vlan_get_tci() return bool so callers only set TP_STATUS_VLAN_VALID | TP_STATUS_VLAN_TPID_VALID when a VLAN header is extracted, avoiding false VLAN flags on TP_STATUS_COPY skbs (zeroed sll_hatype; Sashiko), non-Ethernet devices, and truncated frames - patch 4/5: update commit message to match v1: https://lore.kernel.org/netdev/20261124170551.1874487-1-willemdebruijn.kernel@gmail.com/ Willem de Bruijn (5): net: ipa: remove ethernet-specific artifacts from modem netdev setup net: remove header_ops->validate and dev_validate_header() packet: reset network header on all headerless devices packet: use Ethernet header length in vlan_get_tci() net: remove unused net_device::min_header_len .../networking/net_cachelines/net_device.rst | 1 - drivers/net/ipa/ipa_modem.c | 5 +- drivers/net/loopback.c | 1 - include/linux/netdevice.h | 18 ----- net/ethernet/eth.c | 1 - net/packet/af_packet.c | 78 +++++++++---------- 6 files changed, 36 insertions(+), 68 deletions(-) -- 2.56.1.839.g22a8290db9-goog