git: 9890a0d5e04a - main - mbuf: move leaf_rcv union farther back in the pkthdr

From: Andrew Gallatin <gallatin_at_FreeBSD.org>
Date: Tue, 13 Oct 2026 15:40:35 UTC
The branch main has been updated by gallatin:

URL: https://cgit.FreeBSD.org/src/commit/?id=9890a0d5e04a1b4cd398a52be6374734b9496cd3

commit 9890a0d5e04a1b4cd398a52be6374734b9496cd3
Author:     Andrew Gallatin <gallatin@FreeBSD.org>
AuthorDate: 2026-10-13 13:12:10 +0000
Commit:     Andrew Gallatin <gallatin@FreeBSD.org>
CommitDate: 2026-10-13 15:39:17 +0000

    mbuf: move leaf_rcv union farther back in the pkthdr
    
    When the leaf_rcv union was introduced to support ktls RX offload in
    4d88d81c3166 it was put at the front of the pkthhdr, and pushed the
    more commonly accessed csum_flags and rsstype into the next cacheline.
    
    Given that csum_flags is accessed on every pkt sent and every pkt freed,
    but the leaf_rcv fields are only used for ktls rx offload, it makes more
    sense to have csum_flags in a cacheline that is already likely to be hot.
    
    Reviewed by: kib
    Differential Revision: https://reviews.freebsd.org/D60691
    Sponsored by: Netflix
---
 sys/sys/mbuf.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 504d2902b4fb..86b7f3770bf6 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -157,13 +157,6 @@ struct pkthdr {
 			uint16_t rcvgen;	/* ... and generation count */
 		};
 	};
-	union {
-		struct ifnet	*leaf_rcvif;	/* leaf rcv interface */
-		struct {
-			uint16_t leaf_rcvidx;	/* leaf rcv interface index ... */
-			uint16_t leaf_rcvgen;	/* ... and generation count */
-		};
-	};
 	SLIST_HEAD(packet_tags, m_tag) tags; /* list of packet tags */
 	int32_t		 len;		/* total packet length */
 
@@ -176,6 +169,13 @@ struct pkthdr {
 #if !defined(__LP64__)
 	uint32_t	 pad;		/* pad for 64bit alignment */
 #endif
+	union {
+		struct ifnet	*leaf_rcvif;	/* leaf rcv interface */
+		struct {
+			uint16_t leaf_rcvidx;	/* leaf rcv interface index ... */
+			uint16_t leaf_rcvgen;	/* ... and generation count */
+		};
+	};
 	union {
 		uint64_t	rcv_tstmp;	/* timestamp in ns */
 		struct {