Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/cxgbe/t4_sge.c
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | |||||
/* Internal mbuf flags stored in PH_loc.eight[1]. */ | /* Internal mbuf flags stored in PH_loc.eight[1]. */ | ||||
#define MC_RAW_WR 0x02 | #define MC_RAW_WR 0x02 | ||||
/* | /* | ||||
* Ethernet frames are DMA'd at this byte offset into the freelist buffer. | * Ethernet frames are DMA'd at this byte offset into the freelist buffer. | ||||
* 0-7 are valid values. | * 0-7 are valid values. | ||||
*/ | */ | ||||
static int fl_pktshift = 0; | static int fl_pktshift = 0; | ||||
TUNABLE_INT("hw.cxgbe.fl_pktshift", &fl_pktshift); | SYSCTL_INT(_hw_cxgbe, OID_AUTO, fl_pktshift, CTLFLAG_RDTUN, &fl_pktshift, 0, | ||||
"payload DMA offset in rx buffer (bytes)"); | |||||
/* | /* | ||||
* Pad ethernet payload up to this boundary. | * Pad ethernet payload up to this boundary. | ||||
* -1: driver should figure out a good value. | * -1: driver should figure out a good value. | ||||
* 0: disable padding. | * 0: disable padding. | ||||
* Any power of 2 from 32 to 4096 (both inclusive) is also a valid value. | * Any power of 2 from 32 to 4096 (both inclusive) is also a valid value. | ||||
*/ | */ | ||||
int fl_pad = -1; | int fl_pad = -1; | ||||
TUNABLE_INT("hw.cxgbe.fl_pad", &fl_pad); | SYSCTL_INT(_hw_cxgbe, OID_AUTO, fl_pad, CTLFLAG_RDTUN, &fl_pad, 0, | ||||
"payload pad boundary (bytes)"); | |||||
/* | /* | ||||
* Status page length. | * Status page length. | ||||
* -1: driver should figure out a good value. | * -1: driver should figure out a good value. | ||||
* 64 or 128 are the only other valid values. | * 64 or 128 are the only other valid values. | ||||
*/ | */ | ||||
static int spg_len = -1; | static int spg_len = -1; | ||||
TUNABLE_INT("hw.cxgbe.spg_len", &spg_len); | SYSCTL_INT(_hw_cxgbe, OID_AUTO, spg_len, CTLFLAG_RDTUN, &spg_len, 0, | ||||
"status page size (bytes)"); | |||||
/* | /* | ||||
* Congestion drops. | * Congestion drops. | ||||
* -1: no congestion feedback (not recommended). | * -1: no congestion feedback (not recommended). | ||||
* 0: backpressure the channel instead of dropping packets right away. | * 0: backpressure the channel instead of dropping packets right away. | ||||
* 1: no backpressure, drop packets for the congested queue immediately. | * 1: no backpressure, drop packets for the congested queue immediately. | ||||
*/ | */ | ||||
static int cong_drop = 0; | static int cong_drop = 0; | ||||
TUNABLE_INT("hw.cxgbe.cong_drop", &cong_drop); | SYSCTL_INT(_hw_cxgbe, OID_AUTO, cong_drop, CTLFLAG_RDTUN, &cong_drop, 0, | ||||
"Congestion control for RX queues (0 = backpressure, 1 = drop"); | |||||
/* | /* | ||||
* Deliver multiple frames in the same free list buffer if they fit. | * Deliver multiple frames in the same free list buffer if they fit. | ||||
* -1: let the driver decide whether to enable buffer packing or not. | * -1: let the driver decide whether to enable buffer packing or not. | ||||
* 0: disable buffer packing. | * 0: disable buffer packing. | ||||
* 1: enable buffer packing. | * 1: enable buffer packing. | ||||
*/ | */ | ||||
static int buffer_packing = -1; | static int buffer_packing = -1; | ||||
TUNABLE_INT("hw.cxgbe.buffer_packing", &buffer_packing); | SYSCTL_INT(_hw_cxgbe, OID_AUTO, buffer_packing, CTLFLAG_RDTUN, &buffer_packing, | ||||
0, "Enable buffer packing"); | |||||
/* | /* | ||||
* Start next frame in a packed buffer at this boundary. | * Start next frame in a packed buffer at this boundary. | ||||
* -1: driver should figure out a good value. | * -1: driver should figure out a good value. | ||||
* T4: driver will ignore this and use the same value as fl_pad above. | * T4: driver will ignore this and use the same value as fl_pad above. | ||||
* T5: 16, or a power of 2 from 64 to 4096 (both inclusive) is a valid value. | * T5: 16, or a power of 2 from 64 to 4096 (both inclusive) is a valid value. | ||||
*/ | */ | ||||
static int fl_pack = -1; | static int fl_pack = -1; | ||||
TUNABLE_INT("hw.cxgbe.fl_pack", &fl_pack); | SYSCTL_INT(_hw_cxgbe, OID_AUTO, fl_pack, CTLFLAG_RDTUN, &fl_pack, 0, | ||||
"payload pack boundary (bytes)"); | |||||
/* | /* | ||||
* Allow the driver to create mbuf(s) in a cluster allocated for rx. | * Allow the driver to create mbuf(s) in a cluster allocated for rx. | ||||
* 0: never; always allocate mbufs from the zone_mbuf UMA zone. | * 0: never; always allocate mbufs from the zone_mbuf UMA zone. | ||||
* 1: ok to create mbuf(s) within a cluster if there is room. | * 1: ok to create mbuf(s) within a cluster if there is room. | ||||
*/ | */ | ||||
static int allow_mbufs_in_cluster = 1; | static int allow_mbufs_in_cluster = 1; | ||||
TUNABLE_INT("hw.cxgbe.allow_mbufs_in_cluster", &allow_mbufs_in_cluster); | SYSCTL_INT(_hw_cxgbe, OID_AUTO, allow_mbufs_in_cluster, CTLFLAG_RDTUN, | ||||
&allow_mbufs_in_cluster, 0, | |||||
"Allow driver to create mbufs within a rx cluster"); | |||||
/* | /* | ||||
* Largest rx cluster size that the driver is allowed to allocate. | * Largest rx cluster size that the driver is allowed to allocate. | ||||
*/ | */ | ||||
static int largest_rx_cluster = MJUM16BYTES; | static int largest_rx_cluster = MJUM16BYTES; | ||||
TUNABLE_INT("hw.cxgbe.largest_rx_cluster", &largest_rx_cluster); | SYSCTL_INT(_hw_cxgbe, OID_AUTO, largest_rx_cluster, CTLFLAG_RDTUN, | ||||
&largest_rx_cluster, 0, "Largest rx cluster (bytes)"); | |||||
/* | /* | ||||
* Size of cluster allocation that's most likely to succeed. The driver will | * Size of cluster allocation that's most likely to succeed. The driver will | ||||
* fall back to this size if it fails to allocate clusters larger than this. | * fall back to this size if it fails to allocate clusters larger than this. | ||||
*/ | */ | ||||
static int safest_rx_cluster = PAGE_SIZE; | static int safest_rx_cluster = PAGE_SIZE; | ||||
TUNABLE_INT("hw.cxgbe.safest_rx_cluster", &safest_rx_cluster); | SYSCTL_INT(_hw_cxgbe, OID_AUTO, safest_rx_cluster, CTLFLAG_RDTUN, | ||||
&safest_rx_cluster, 0, "Safe rx cluster (bytes)"); | |||||
#ifdef RATELIMIT | #ifdef RATELIMIT | ||||
/* | /* | ||||
* Knob to control TCP timestamp rewriting, and the granularity of the tick used | * Knob to control TCP timestamp rewriting, and the granularity of the tick used | ||||
* for rewriting. -1 and 0-3 are all valid values. | * for rewriting. -1 and 0-3 are all valid values. | ||||
* -1: hardware should leave the TCP timestamps alone. | * -1: hardware should leave the TCP timestamps alone. | ||||
* 0: 1ms | * 0: 1ms | ||||
* 1: 100us | * 1: 100us | ||||
* 2: 10us | * 2: 10us | ||||
* 3: 1us | * 3: 1us | ||||
*/ | */ | ||||
static int tsclk = -1; | static int tsclk = -1; | ||||
TUNABLE_INT("hw.cxgbe.tsclk", &tsclk); | SYSCTL_INT(_hw_cxgbe, OID_AUTO, tsclk, CTLFLAG_RDTUN, &tsclk, 0, | ||||
"Control TCP timestamp rewriting when using pacing"); | |||||
static int eo_max_backlog = 1024 * 1024; | static int eo_max_backlog = 1024 * 1024; | ||||
TUNABLE_INT("hw.cxgbe.eo_max_backlog", &eo_max_backlog); | SYSCTL_INT(_hw_cxgbe, OID_AUTO, eo_max_backlog, CTLFLAG_RDTUN, &eo_max_backlog, | ||||
0, "Maximum backlog of ratelimited data per flow"); | |||||
#endif | #endif | ||||
/* | /* | ||||
* The interrupt holdoff timers are multiplied by this value on T6+. | * The interrupt holdoff timers are multiplied by this value on T6+. | ||||
* 1 and 3-17 (both inclusive) are legal values. | * 1 and 3-17 (both inclusive) are legal values. | ||||
*/ | */ | ||||
static int tscale = 1; | static int tscale = 1; | ||||
TUNABLE_INT("hw.cxgbe.tscale", &tscale); | SYSCTL_INT(_hw_cxgbe, OID_AUTO, tscale, CTLFLAG_RDTUN, &tscale, 0, | ||||
"Interrupt holdoff timer scale on T6+"); | |||||
/* | /* | ||||
* Number of LRO entries in the lro_ctrl structure per rx queue. | * Number of LRO entries in the lro_ctrl structure per rx queue. | ||||
*/ | */ | ||||
static int lro_entries = TCP_LRO_ENTRIES; | static int lro_entries = TCP_LRO_ENTRIES; | ||||
TUNABLE_INT("hw.cxgbe.lro_entries", &lro_entries); | SYSCTL_INT(_hw_cxgbe, OID_AUTO, lro_entries, CTLFLAG_RDTUN, &lro_entries, 0, | ||||
"Number of LRO entries per RX queue"); | |||||
/* | /* | ||||
* This enables presorting of frames before they're fed into tcp_lro_rx. | * This enables presorting of frames before they're fed into tcp_lro_rx. | ||||
*/ | */ | ||||
static int lro_mbufs = 0; | static int lro_mbufs = 0; | ||||
TUNABLE_INT("hw.cxgbe.lro_mbufs", &lro_mbufs); | SYSCTL_INT(_hw_cxgbe, OID_AUTO, lro_mbufs, CTLFLAG_RDTUN, &lro_mbufs, 0, | ||||
"Enable presorting of LRO frames"); | |||||
struct txpkts { | struct txpkts { | ||||
u_int wr_type; /* type 0 or type 1 */ | u_int wr_type; /* type 0 or type 1 */ | ||||
u_int npkt; /* # of packets in this work request */ | u_int npkt; /* # of packets in this work request */ | ||||
u_int plen; /* total payload (sum of all packets) */ | u_int plen; /* total payload (sum of all packets) */ | ||||
u_int len16; /* # of 16B pieces used by this work request */ | u_int len16; /* # of 16B pieces used by this work request */ | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 5,820 Lines • Show Last 20 Lines |