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 59481c7db2)
This commit is contained in:
Bjoern A. Zeeb 2025-04-14 21:05:38 +00:00
parent 85c811c9e3
commit ce537904d4

View file

@ -154,36 +154,45 @@ struct sk_buff {
};
struct list_head list;
};
uint32_t len; /* ? */
uint32_t data_len; /* ? If we have frags? */
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 mac_header; /* offset of mac_header */
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;
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. */
uint32_t priority;
uint16_t qmap; /* queue mapping */
uint16_t _flags; /* Internal flags. */
#define _SKB_FLAGS_SKBEXTFRAG 0x0001
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;
struct net_device *dev;
void *sk; /* XXX net/sock.h? */
/* FreeBSD specific bandaid (see linuxkpi_kfree_skb). */
void *m;