Replace cosqos with numa_domain in mbuf pkthdr

The cosqos field was added nearly 6 years ago in r254804, and it is
still unused by any in-tree consumers.  I have a patchset that I'm
working on which aligns many network resources by NUMA domain,
including inps, inpcb lb group, tcp pacing, lagg output link
selection, backing pages for sendfile, and more.  It reduces
cross-domain traffic by roughly 50% for a real web workload.

This patchset relies on being able to store the numa domain in the
mbuf, and grabbing the unused cosqos field for this purpose is the
first step in starting to usptream it.

Reviewed by:	kib, markj
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D19862
This commit is contained in:
Andrew Gallatin 2019-04-16 16:49:34 +00:00
parent c0643d9011
commit 2866548c8a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=346281

View File

@ -98,6 +98,7 @@ struct mbuf;
#define MLEN ((int)(MSIZE - MHSIZE))
#define MHLEN ((int)(MSIZE - MPKTHSIZE))
#define MINCLSIZE (MHLEN + 1)
#define M_NODOM 255
#ifdef _KERNEL
/*-
@ -158,7 +159,7 @@ struct pkthdr {
uint32_t flowid; /* packet's 4-tuple system */
uint32_t csum_flags; /* checksum and offload features */
uint16_t fibnum; /* this packet should use this fib */
uint8_t cosqos; /* class/quality of service */
uint8_t numa_domain; /* NUMA domain of recvd pkt */
uint8_t rsstype; /* hash type */
union {
uint64_t rcv_tstmp; /* timestamp in ns */
@ -406,33 +407,6 @@ struct mbuf {
#define M_HASHTYPE_TEST(m, v) (M_HASHTYPE_GET(m) == (v))
#define M_HASHTYPE_ISHASH(m) (M_HASHTYPE_GET(m) & M_HASHTYPE_HASHPROP)
/*
* COS/QOS class and quality of service tags.
* It uses DSCP code points as base.
*/
#define QOS_DSCP_CS0 0x00
#define QOS_DSCP_DEF QOS_DSCP_CS0
#define QOS_DSCP_CS1 0x20
#define QOS_DSCP_AF11 0x28
#define QOS_DSCP_AF12 0x30
#define QOS_DSCP_AF13 0x38
#define QOS_DSCP_CS2 0x40
#define QOS_DSCP_AF21 0x48
#define QOS_DSCP_AF22 0x50
#define QOS_DSCP_AF23 0x58
#define QOS_DSCP_CS3 0x60
#define QOS_DSCP_AF31 0x68
#define QOS_DSCP_AF32 0x70
#define QOS_DSCP_AF33 0x78
#define QOS_DSCP_CS4 0x80
#define QOS_DSCP_AF41 0x88
#define QOS_DSCP_AF42 0x90
#define QOS_DSCP_AF43 0x98
#define QOS_DSCP_CS5 0xa0
#define QOS_DSCP_EF 0xb8
#define QOS_DSCP_CS6 0xc0
#define QOS_DSCP_CS7 0xe0
/*
* External mbuf storage buffer types.
*/