From nobody Thu Jul 04 16:57:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WFNBB1mzvz5NttS; Thu, 04 Jul 2024 16:57:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WFNBB16pHz4txd; Thu, 4 Jul 2024 16:57:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720112274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=smPzIcFIEOR/K0NI2zyiZsrMXSMERKq62DGsqFwWB3k=; b=Gez7uncRXTwm7ydShn3O2DuLlpDEdjWmSKFENlCQKR7e+FSUOG9A3cVVloX+IGRUclkwsK bIWhRzIcYweC/PHkNYIFxAYto4JTlNuSxBm7v3blSBPjS5PD6nDn0HT6hTGUZbP3rN4p+s n2vXkiZwcqpMtdKFZeD1JZKUwRbGXjChRYd3+kKptyxsaiHCg0gbgE33lZDDWprtB720kN TLF/Cg4OwmL8kBGYNdEckL33V3dT+bEFzia/13mdMceh+lTWDF+53MfVwng7FUDV2QjicA BYQkXxEwnhn+nPc8X0rIZNvvPeLEE7bcyeOzuv0qwqiUXhlKBXL+/9ZZ1sqL/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720112274; a=rsa-sha256; cv=none; b=VCm0RPd4Z/Y2pQGbLM2C9oW7EWaQ3MJBzLAAe+RYjDrpVEU7Y2lP+uo6X86dP5a0M5Wgli 9hbEk/SgCb7Sa7guXOWxPQSIWckd5eDEvouCsAg5yPi5V9zWXspZxsQ4Iy+NL5JQVW35Nl niSgVygTXXXJ0OnKjROMIEl7ltynV13oJLo/6uO5AwE616JEHdjQ3ot9b5G3VplEUk2Vd2 HlJiT/yjOK/6CKEnadtRIwsveAxTBo18KoS7eSHngq+oP7eZsalOFuw7p9SNcof2NE3lAU LzvQq2E3IKi0D/PI3GkVYX/hOz3wS4FWzZ27Bg+IfTE5v+J3XBsRGg0XBvzVTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720112274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=smPzIcFIEOR/K0NI2zyiZsrMXSMERKq62DGsqFwWB3k=; b=kBB1QuekGVAqwJ+P4rXhkKuQ3jG3zLfN5auyl4FTOp7nnj4AmMcu25qpgH9CJ8LCaUgOVj XV48ceQnVW2YsJ1TJOZTF58Gz6Jr8XsFIrpQ2ooyRIKI3gXPNQtcwSv7RBPI0N3wueVTMM nVNhYqGGf/+x4/Nr4RpE+u9WFgDv30yMOOp3MIVP7XrO3P9t+YuYH4RnYVXMpjLIlp7ULT HbP53JclbcIJp2aP+ByEC3dQqZ7yoaO5QLzjNe83SHMZv6uIPTUGwn/BcRWUwv1Jn3aijB 3W2ojHy0wauJtlB385+HFSMO1zKVIy/YTEr5BBoCWzeBTJHys9SEXiGkOnd5hQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WFNBB0k3HzMQP; Thu, 4 Jul 2024 16:57:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 464GvrGj034085; Thu, 4 Jul 2024 16:57:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 464Gvrr6034082; Thu, 4 Jul 2024 16:57:53 GMT (envelope-from git) Date: Thu, 4 Jul 2024 16:57:53 GMT Message-Id: <202407041657.464Gvrr6034082@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 09164454aa4c - main - ethernet: Retire M_HASFCS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09164454aa4c1868abf1ea724ec6160c4a556bdd Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=09164454aa4c1868abf1ea724ec6160c4a556bdd commit 09164454aa4c1868abf1ea724ec6160c4a556bdd Author: Zhenlei Huang AuthorDate: 2024-07-04 16:53:51 +0000 Commit: Zhenlei Huang CommitDate: 2024-07-04 16:53:51 +0000 ethernet: Retire M_HASFCS The mbuf flag M_HASFCS was introduced for drivers to indicate the net stack that packets include FCS (Frame Check Sequence). In principle, to be efficient, FCS should always be processed by hardware, firmware, or at last sort the driver. Well, Ethernet specifies that damaged frames should be discarded, thus only good ones will be passed up to the net stack, then it makes no senses for the net stack to see FCS just to trim it. The last consumer of the flag M_HASFCS has been removed since change [1]. It is time to retire it. 1. 105a4f7b3cb6 ng_atmllc: remove Reviewed by: kp MFC after: never Differential Revision: https://reviews.freebsd.org/D42391 --- sys/net/debugnet.c | 4 ---- sys/net/ethernet.h | 1 - sys/net/if_ethersubr.c | 10 ---------- 3 files changed, 15 deletions(-) diff --git a/sys/net/debugnet.c b/sys/net/debugnet.c index c6f57ec84618..8b1419bcaa28 100644 --- a/sys/net/debugnet.c +++ b/sys/net/debugnet.c @@ -570,10 +570,6 @@ debugnet_input_one(struct ifnet *ifp, struct mbuf *m) m->m_len, m->m_pkthdr.len); goto done; } - if ((m->m_flags & M_HASFCS) != 0) { - m_adj(m, -ETHER_CRC_LEN); - m->m_flags &= ~M_HASFCS; - } eh = mtod(m, struct ether_header *); etype = ntohs(eh->ether_type); if ((m->m_flags & M_VLANTAG) != 0 || etype == ETHERTYPE_VLAN) { diff --git a/sys/net/ethernet.h b/sys/net/ethernet.h index e7313e78c5bb..cf92145eea8f 100644 --- a/sys/net/ethernet.h +++ b/sys/net/ethernet.h @@ -40,7 +40,6 @@ /* * Ethernet-specific mbuf flags. */ -#define M_HASFCS M_PROTO5 /* FCS included at end of frame */ #define M_BRIDGE_INJECT M_PROTO6 /* if_bridge-injected frame */ /* diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index eeb2c1ea4ef3..6cd5cefa9609 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -588,16 +588,6 @@ ether_input_internal(struct ifnet *ifp, struct mbuf *m) */ ETHER_BPF_MTAP(ifp, m); - /* - * If the CRC is still on the packet, trim it off. We do this once - * and once only in case we are re-entered. Nothing else on the - * Ethernet receive path expects to see the FCS. - */ - if (m->m_flags & M_HASFCS) { - m_adj(m, -ETHER_CRC_LEN); - m->m_flags &= ~M_HASFCS; - } - if (!(ifp->if_capenable & IFCAP_HWSTATS)) if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len);