Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Apr 2025 11:41:47 GMT
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: ce537904d415 - stable/14 - LinuxKPI: skbuff: fix types, shuffle fields
Message-ID:  <202504291141.53TBfl1I046077@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by bz:

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

commit ce537904d415526246dcefcd11d35ff500ff3c14
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-04-14 21:05:38 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2025-04-29 10:49:29 +0000

    LinuxKPI: skbuff: fix types, shuffle fields
    
    Fix the types of a few remaining fields.
    Shuffle the fields around so the important ones align to 64byte on a
    64bit platform.
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 59481c7db2340c9e64f9d3d9d05dafc2d72c157e)
---
 sys/compat/linuxkpi/common/include/linux/skbuff.h | 45 ++++++++++++++---------
 1 file changed, 27 insertions(+), 18 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h
index 7a8521e6fd38..8fe6bf158bc6 100644
--- a/sys/compat/linuxkpi/common/include/linux/skbuff.h
+++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h
@@ -154,37 +154,46 @@ struct sk_buff {
 		};
 		struct list_head	list;
 	};
+
+	uint8_t			*head;			/* Head of buffer. */
+	uint8_t			*data;			/* Head of data. */
+	uint8_t			*tail;			/* End of data. */
+	uint8_t			*end;			/* End of buffer. */
+
 	uint32_t		len;		/* ? */
 	uint32_t		data_len;	/* ? If we have frags? */
+	union {
+		__wsum			csum;
+		struct {
+			uint16_t	csum_offset;
+			uint16_t	csum_start;
+		};
+	};
+	uint16_t		protocol;
+	uint8_t			ip_summed;
+	/* uint8_t */
+
+	/* "Scratch" area for layers to store metadata. */
+	/* ??? I see sizeof() operations so probably an array. */
+	uint8_t			cb[64] __aligned(CACHE_LINE_SIZE);
+
+	struct skb_shared_info	*shinfo	__aligned(CACHE_LINE_SIZE);
+
 	uint32_t		truesize;	/* The total size of all buffers, incl. frags. */
-	uint16_t		mac_len;	/* Link-layer header length. */
-	__sum16			csum;
-	uint16_t		l3hdroff;	/* network header offset from *head */
-	uint16_t		l4hdroff;	/* transport header offset from *head */
 	uint32_t		priority;
 	uint16_t		qmap;		/* queue mapping */
 	uint16_t		_flags;		/* Internal flags. */
 #define	_SKB_FLAGS_SKBEXTFRAG	0x0001
-	enum sk_buff_pkt_type	pkt_type;
+	uint16_t		l3hdroff;	/* network header offset from *head */
+	uint16_t		l4hdroff;	/* transport header offset from *head */
 	uint16_t		mac_header;	/* offset of mac_header */
+	uint16_t		mac_len;	/* Link-layer header length. */
+	enum sk_buff_pkt_type	pkt_type;
 	refcount_t		refcnt;
 
-	/* "Scratch" area for layers to store metadata. */
-	/* ??? I see sizeof() operations so probably an array. */
-	uint8_t			cb[64] __aligned(CACHE_LINE_SIZE);
-
 	struct net_device	*dev;
 	void			*sk;		/* XXX net/sock.h? */
 
-	int		csum_offset, csum_start, ip_summed, protocol;
-
-	uint8_t			*head;			/* Head of buffer. */
-	uint8_t			*data;			/* Head of data. */
-	uint8_t			*tail;			/* End of data. */
-	uint8_t			*end;			/* End of buffer. */
-
-	struct skb_shared_info	*shinfo;
-
 	/* FreeBSD specific bandaid (see linuxkpi_kfree_skb). */
 	void			*m;
 	void(*m_free_func)(void *);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202504291141.53TBfl1I046077>