From nobody Tue Jun 07 20:14:20 2022 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 7F4F1845B85; Tue, 7 Jun 2022 20:14:20 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LHhQh300Vz3pyq; Tue, 7 Jun 2022 20:14:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654632860; 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=WZr9m4zFNqf8F7Fz+6S15rQpVHyhF7ygxayIuS7afWI=; b=EvLR+giTScFWrmiEsV3XTI/A6hyCuUWH7vzFoWECMTlhXO7EsZPkzfwh7garlupiRaNwD7 guDPQmJ6Yn15DiBAbpsfWbtU9WgFB9GC7kW0kehfX6ZQhryWwLgfjl4Stc67GmzQtkcXh0 zY29Ty+XWUvuGxCr/nN7b39YUbjOD+cafjfz02f9SR6qfMZj49lE+HYyQlNBfG2ufzbO6u Ye9ivPc2U6QGel8KVAdZ5iI5PqDYV1hDoYJUra9RfEb9waKBJ42OGeInXapPAB9c1bb86X 8NTk6OID2e+4IL/Dj4VFLaPGtbAn0LVLkyW4roqiyub3fWufc2y1Te59X9Ik6w== 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 3CB832177C; Tue, 7 Jun 2022 20:14:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 257KEKGm095493; Tue, 7 Jun 2022 20:14:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 257KEKsT095492; Tue, 7 Jun 2022 20:14:20 GMT (envelope-from git) Date: Tue, 7 Jun 2022 20:14:20 GMT Message-Id: <202206072014.257KEKsT095492@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: b8394039dc25 - main - mbuf(9): Fix size of mbuf for all 32-bit platforms (i386, ARM, PowerPC and RISCV) 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b8394039dc252698711ded30045af20481db79e0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654632860; 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=WZr9m4zFNqf8F7Fz+6S15rQpVHyhF7ygxayIuS7afWI=; b=nq2raWEnFFF5MtbNuOkTZs65G+n/5ccbll5OY2qqJwOuRPGmy3pFF9BxS2gV1+UGFOoZZ/ sDIi+UcevVTmPgbi9Ks4agjlyP7y3NDI5Q2N46AfFV0t6X+QhEqo7wKXNj+3CPBJM02vwf iArHJla14pLsKBLvehBnWH63um8Ko6P84Y/rdCIprP8jsT38AlIdRwVwYXhrJXy3tzIgl3 nudZuoOMd2VLps+8E4VwzNAd+3vFi0ZQOoScDnDo5huasxYXmtF2ip8CsXd30QV8R/hiWo 7L9oLHr0okHSTPAbHnGDOECkJC+2B/xLGNJDPyQX/NAPLi0tT/Oo/bTmOQy1hg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654632860; a=rsa-sha256; cv=none; b=yq0IFzoM/briRFhrkwGygHeC5UnE2Iy1Vc9QPa+lebDT8T0gaLtwjaWhpF+1T5P8OUCgZu 5YpILThjpeg8yVxMXC3pOat0WbjAIyuhiWLv9Auy/6CqCZlV/5A+iLv31BO+Zh43r4PqB6 ztD7pL8d+zp+/PrxOjhvWbItxtSUxOYV3ycIrs/hgKp3In0wp2Q7jXX0/34b8xzfBKLu/W 8hmY/MKSNwYzesoG8HPdZrV/3PhtPWfkThhiLm4AKb2rlhRZbK/lsVEgPO3sWhWAoUIUS5 fwOvDOvXNQ+7IyHS2gPFuyKyoZ0QkkpZHBBy36HZbqCO4fHdViCzSRPfbBTPmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=b8394039dc252698711ded30045af20481db79e0 commit b8394039dc252698711ded30045af20481db79e0 Author: Hans Petter Selasky AuthorDate: 2022-06-07 19:55:01 +0000 Commit: Hans Petter Selasky CommitDate: 2022-06-07 20:09:10 +0000 mbuf(9): Fix size of mbuf for all 32-bit platforms (i386, ARM, PowerPC and RISCV) Do this by reducing the size of the MBUF_PEXT_MAX_PGS, causing "struct mbuf" to be bigger than M_SIZE, and also add a missing padding field to ensure 64-bit alignment. Reviewed by: gallatin@ Reported by: Elliott Mitchell Differential revision: https://reviews.freebsd.org/D35339 MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/kern/uipc_mbuf.c | 6 +++--- sys/sys/mbuf.h | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 4a5bb45e9573..02a9a120b970 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -184,12 +184,12 @@ CTASSERT(sizeof(struct pkthdr) == 64); CTASSERT(sizeof(struct m_ext) == 160); #else CTASSERT(offsetof(struct mbuf, m_dat) == 24); -CTASSERT(sizeof(struct pkthdr) == 52); +CTASSERT(sizeof(struct pkthdr) == 56); #if defined(__powerpc__) && defined(BOOKE) /* PowerPC booke has 64-bit physical pointers. */ -CTASSERT(sizeof(struct m_ext) == 184); +CTASSERT(sizeof(struct m_ext) == 176); #else -CTASSERT(sizeof(struct m_ext) == 180); +CTASSERT(sizeof(struct m_ext) == 172); #endif #endif diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index c9b3df075105..dc32a1e23c38 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -180,6 +180,9 @@ struct pkthdr { uint16_t fibnum; /* this packet should use this fib */ uint8_t numa_domain; /* NUMA domain of recvd pkt */ uint8_t rsstype; /* hash type */ +#if !defined(__LP64__) + uint32_t pad; /* pad for 64bit alignment */ +#endif union { uint64_t rcv_tstmp; /* timestamp in ns */ struct { @@ -245,7 +248,7 @@ struct pkthdr { #if defined(__LP64__) #define MBUF_PEXT_MAX_PGS (40 / sizeof(vm_paddr_t)) #else -#define MBUF_PEXT_MAX_PGS (72 / sizeof(vm_paddr_t)) +#define MBUF_PEXT_MAX_PGS (64 / sizeof(vm_paddr_t)) #endif #define MBUF_PEXT_MAX_BYTES \