From nobody Thu Sep 24 22:16:50 2026 X-Original-To: dev-commits-src-main@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 4hrSqQ5bcsz6tL0W for ; Thu, 24 Sep 2026 22:16:50 +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 4hrSqQ4vJCz4MRm for ; Thu, 24 Sep 2026 22:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790288210; 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=Nz9Pd6EoHK4j4mBzO3Dfqgp3Z9r9iuxMWUy/BfIFp4Vks/Rr8B1pX095bmbsic9QHiNZUM D1ukRKEgp8B0cRs+VmARarfgu/Jo1rqfYCoW6f5C388Y6Y8FbsX6yW2f7x5hMt+S9s9LXm IXzFoMXZVimegAPzb7UQ0cR+W1rEIzrfosmJRLEErmM/FUc2ksSns+4OMsEPjww0ax0Ytf I+KgpgAEd24NmR48f5VrlPc/isZi2L1AnDT6v9vp2jd5OnQU5gu+PrYETXoqmwH7ZkVoMB PahOTgOSskHo4m3tHS5HLCCo0kEENr8v0Hou+YZVajTRfvlqND+vd3ueOwcnsw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1790288210; b=azndXKJ6kAfhKPd8so9/KekFS3hG0G0x6INleOus6gP8RCU29tbKzYrzyO5zTT6i0o7XHr HPA8btZlt1v/jM6BiDwl7lKUqPVlSQ14bZMpjrztC+FXFcEKpPkxv86RKZZ07iZeH8SBHy cR8NaIdZWytUA1TlJs5tQgSw1b6eQ6ABxKykHH/qWLC1/x1pFHmL74LeF+hgva+Szj6Yr9 J2hqFa5vjpP6I1Um66l6ntFUO09R4z6gT3ONNMXka5QeKusE+ib2PjjzFoPIH09bSirtdj G2zGjAnoV4AO3/HCHsbD/aGdVVIco/UrXpKvz/wKF3smbMkj5kq0MhJC01/VMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790288210; 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=ErssRL/+JAfi0rKFjwhbwn/tX/ix3cJDJjtMe6ZP5hVIo6geIRLp4fvbsMx1QC9/+6ry+R 6VecSE1VhGAQU/truTg33pmyp+Bd5JA3pex3GvMCZi6ZZfE9lwf3kPvPJKb5iJ1dLC5gz1 klMhcDrqlLcfA2Y4lu00ds6e2bnPdGN75Y+rNNjQdGcTpe19yA92jcVxky1ZjkFlwofYJg XmPaGAgh11IaehABXFixjM8c+Y739cvoDWMLf1qBMPia30UNL2hpfsbVeJaq1ELN45nBNu VThmPsmQxwgNTD3gksddfqWh/pjQ6C7mRxrA4kjQx2SJUC7sMTC4NLqfCPOZIg== 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 4hrSqQ3jnyzkYx for ; Thu, 24 Sep 2026 22:16:50 +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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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++;