From nobody Thu Sep 24 22:16:50 2026 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 4hrSqX11F7z6tKwx for ; Thu, 24 Sep 2026 22:16:56 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hrSqW6Hnlz4MqL for ; Thu, 24 Sep 2026 22:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790288215; 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=9CSzFwL2rSFoNDkPsyhtzXBPzyPhJN1hjammGlP0HYc=; b=ivKxPY7k+nXhRBS3OIvlx2IWjMcJns2bp0q5wgv4ukrpPnqZhv3HNyQhgrN0h4gw1/7e3v lgbn2oHj6aiicT5e1/wf5crOY1lRFDgMTNwd8/AIYNolsa9hSVR4B1SmCv3yNiGjVTMV6t DRr1BKjZJtF+DZ/17MdMsglBSgEzKsr79zj0lhawb3oos0WUCL7lRMKuDSDnPjj3YuaWZB n1i2r3jsY3pbykojw8EMVJ3W+uRL68mE8d/nubgx5ejMa3VIotfjS4iJ1BV4/IZqMLX3Jf HCxRnEB3oWywb7/OBC2+IP5yAL/UGitAqZ/tVhncYnfB3OZNn9k8io9tQ1mYtw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1790288215; b=jM3NDhdLIloK0zw/k6tQuNuMcaT5OPwKd1YIAc2Xx3S8D46ZOltESLVJk9aWLAXDpKCBIJ SzTrxuqsNJKLuOTRs+/4w2Y5340wZzmfDU9Ii4BGLoqz6u8GGt1LejEbVDy0Q/70WCq4rl We28h2BonqlxCcHX3SnJb6vaor/uwBIVsQn2uQTlOW+uHUvAhfJHtjnVNNObO+srQleskD WJ9D5Ss8pXfFFarFMtUiyjL4azpm9uYAvkivOUHdIIgcYYOGPkt4qJ30EqQRPy1vhnFYFD 1YQ+g1f4PWj45JDgkPaXj4Mwjdl2ubqpYieGfC/kAHdhIiVQVdPFjezvhMtdgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790288215; 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=9CSzFwL2rSFoNDkPsyhtzXBPzyPhJN1hjammGlP0HYc=; b=ggfWNyM8jKwrfETwILgg48rNmR9e2Op0fbA7sUHU8VeGJwNTbgfdXZPcnjr2yHa71r8bta XalK5/hnERVJL3XzHDD0w/l4NVML9h8LMUrktz1g7+Z8iNAqdEJ6VFaO0DMgMu/ZtPfLPx FrGV+TQ0UH7Qg3AU0O8cTl1u4IinNROFj0j2EdHhhvl6lLIIQoxXlqJa7xbBKud+tH0c9l EKaNUVo9onzsRR3VjMZD/3OJd37U/IArBO4lYo7+q09QtioCLz2thRm/9CJvuLHio2kVnJ 5u0rGNZ0oWMO/s2r0B+vF/IhBYfMCaj1JMGtZAcdFdtcjpkeAH7ruRIjSeOcJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hrSqW576Gzk3m for ; Thu, 24 Sep 2026 22:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 44b57 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 24 Sep 2026 22:16:50 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Kubaj Subject: git: 6429199a2113 - main - llan: byte swap the receive queue entries 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pkubaj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6429199a21136cad3c82b43618a6ca2958b90bbf Auto-Submitted: auto-generated Date: Thu, 24 Sep 2026 22:16:50 +0000 Message-Id: <6ab5a152.44b57.36b87b57@gitrepo.freebsd.org> The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/src/commit/?id=6429199a21136cad3c82b43618a6ca2958b90bbf commit 6429199a21136cad3c82b43618a6ca2958b90bbf Author: Piotr Kubaj AuthorDate: 2026-09-23 13:21:00 +0000 Commit: Piotr Kubaj CommitDate: 2026-09-24 22:16:33 +0000 llan: byte swap the receive queue entries The receive queue of a PAPR logical LAN is filled in by the hypervisor, so its fields are big endian, but llan_intr() read the offset and the length of each frame natively. On a little endian kernel the length of a 134 byte frame reads as 0x86000000, and ether_input() discards the mbuf because m_len is not even large enough for an ethernet header. No frame is ever received. Reproduced on a POWER9 pseries guest with a spapr-vlan interface. Before: llan0: discard frame w/o leading ethernet header (len -2046820352 pkt len -2046820352) llan0 1500 52:54:00:12:34:56 123 118 0 5838733312 7 0 that is 118 input errors out of 123 packets, dhclient(8) never completes and ping(8) loses every packet, although transmit works because the transmit path passes the lengths in hcall registers rather than through memory. Afterwards the interface gets a DHCP lease and ping reports no loss. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D59926 Approved by: jhibbits --- sys/powerpc/pseries/phyp_llan.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/powerpc/pseries/phyp_llan.c b/sys/powerpc/pseries/phyp_llan.c index 763eebc15b36..86ad7dc96fb7 100644 --- a/sys/powerpc/pseries/phyp_llan.c +++ b/sys/powerpc/pseries/phyp_llan.c @@ -385,8 +385,8 @@ restart: while ((sc->rx_buf[sc->rx_dma_slot].control >> 7) == sc->rx_valid_val) { rx = (struct llan_xfer *)sc->rx_buf[sc->rx_dma_slot].handle; m = rx->rx_mbuf; - m_adj(m, sc->rx_buf[sc->rx_dma_slot].offset - 8); - m->m_len = sc->rx_buf[sc->rx_dma_slot].length; + m_adj(m, be16toh(sc->rx_buf[sc->rx_dma_slot].offset) - 8); + m->m_len = be32toh(sc->rx_buf[sc->rx_dma_slot].length); /* llan_add_rxbuf does DMA sync and unload as well as requeue */ if (llan_add_rxbuf(sc, rx) != 0) { @@ -395,8 +395,8 @@ restart: } if_inc_counter(sc->ifp, IFCOUNTER_IPACKETS, 1); - m_adj(m, sc->rx_buf[sc->rx_dma_slot].offset); - m->m_len = sc->rx_buf[sc->rx_dma_slot].length; + m_adj(m, be16toh(sc->rx_buf[sc->rx_dma_slot].offset)); + m->m_len = be32toh(sc->rx_buf[sc->rx_dma_slot].length); m->m_pkthdr.rcvif = sc->ifp; m->m_pkthdr.len = m->m_len; sc->rx_dma_slot++;