Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/cc/cc.h
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
* University Research Program Fund at Community Foundation Silicon Valley. | * University Research Program Fund at Community Foundation Silicon Valley. | ||||
* More details are available at: | * More details are available at: | ||||
* http://caia.swin.edu.au/urp/newtcp/ | * http://caia.swin.edu.au/urp/newtcp/ | ||||
*/ | */ | ||||
#ifndef _NETINET_CC_CC_H_ | #ifndef _NETINET_CC_CC_H_ | ||||
#define _NETINET_CC_CC_H_ | #define _NETINET_CC_CC_H_ | ||||
#if !defined(_KERNEL) | #ifdef _KERNEL | ||||
#error "no user-serviceable parts inside" | |||||
#endif | |||||
/* Global CC vars. */ | /* Global CC vars. */ | ||||
extern STAILQ_HEAD(cc_head, cc_algo) cc_list; | extern STAILQ_HEAD(cc_head, cc_algo) cc_list; | ||||
extern const int tcprexmtthresh; | extern const int tcprexmtthresh; | ||||
extern struct cc_algo newreno_cc_algo; | extern struct cc_algo newreno_cc_algo; | ||||
/* Per-netstack bits. */ | /* Per-netstack bits. */ | ||||
VNET_DECLARE(struct cc_algo *, default_cc_ptr); | VNET_DECLARE(struct cc_algo *, default_cc_ptr); | ||||
Show All 38 Lines | |||||
#define CCF_IPHDR_CE 0x0010 /* Does this packet set CE bit? */ | #define CCF_IPHDR_CE 0x0010 /* Does this packet set CE bit? */ | ||||
#define CCF_TCPHDR_CWR 0x0020 /* Does this packet set CWR bit? */ | #define CCF_TCPHDR_CWR 0x0020 /* Does this packet set CWR bit? */ | ||||
/* ACK types passed to the ack_received() hook. */ | /* ACK types passed to the ack_received() hook. */ | ||||
#define CC_ACK 0x0001 /* Regular in sequence ACK. */ | #define CC_ACK 0x0001 /* Regular in sequence ACK. */ | ||||
#define CC_DUPACK 0x0002 /* Duplicate ACK. */ | #define CC_DUPACK 0x0002 /* Duplicate ACK. */ | ||||
#define CC_PARTIALACK 0x0004 /* Not yet. */ | #define CC_PARTIALACK 0x0004 /* Not yet. */ | ||||
#define CC_SACK 0x0008 /* Not yet. */ | #define CC_SACK 0x0008 /* Not yet. */ | ||||
#endif /* _KERNEL */ | |||||
/* | /* | ||||
julian: you could move this section to the top so that there are not intermixed user/kernel parts.. | |||||
Done Inline ActionsBut then we lose the grouping of those constants. Not sure which way is better, tbh. trasz: But then we lose the grouping of those constants. Not sure which way is better, tbh. | |||||
* Congestion signal types passed to the cong_signal() hook. The highest order 8 | * Congestion signal types passed to the cong_signal() hook. The highest order 8 | ||||
* bits (0x01000000 - 0x80000000) are reserved for CC algos to declare their own | * bits (0x01000000 - 0x80000000) are reserved for CC algos to declare their own | ||||
* congestion signal types. | * congestion signal types. | ||||
*/ | */ | ||||
#define CC_ECN 0x00000001 /* ECN marked packet received. */ | #define CC_ECN 0x00000001 /* ECN marked packet received. */ | ||||
#define CC_RTO 0x00000002 /* RTO fired. */ | #define CC_RTO 0x00000002 /* RTO fired. */ | ||||
#define CC_RTO_ERR 0x00000004 /* RTO fired in error. */ | #define CC_RTO_ERR 0x00000004 /* RTO fired in error. */ | ||||
#define CC_NDUPACK 0x00000008 /* Threshold of dupack's reached. */ | #define CC_NDUPACK 0x00000008 /* Threshold of dupack's reached. */ | ||||
#define CC_SIGPRIVMASK 0xFF000000 /* Mask to check if sig is private. */ | #define CC_SIGPRIVMASK 0xFF000000 /* Mask to check if sig is private. */ | ||||
#ifdef _KERNEL | |||||
/* | /* | ||||
* Structure to hold data and function pointers that together represent a | * Structure to hold data and function pointers that together represent a | ||||
* congestion control algorithm. | * congestion control algorithm. | ||||
*/ | */ | ||||
struct cc_algo { | struct cc_algo { | ||||
char name[TCP_CA_NAME_MAX]; | char name[TCP_CA_NAME_MAX]; | ||||
/* Init global module state on kldload. */ | /* Init global module state on kldload. */ | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
#define CC_LIST_RLOCK() rw_rlock(&cc_list_lock) | #define CC_LIST_RLOCK() rw_rlock(&cc_list_lock) | ||||
#define CC_LIST_RUNLOCK() rw_runlock(&cc_list_lock) | #define CC_LIST_RUNLOCK() rw_runlock(&cc_list_lock) | ||||
#define CC_LIST_WLOCK() rw_wlock(&cc_list_lock) | #define CC_LIST_WLOCK() rw_wlock(&cc_list_lock) | ||||
#define CC_LIST_WUNLOCK() rw_wunlock(&cc_list_lock) | #define CC_LIST_WUNLOCK() rw_wunlock(&cc_list_lock) | ||||
#define CC_LIST_LOCK_ASSERT() rw_assert(&cc_list_lock, RA_LOCKED) | #define CC_LIST_LOCK_ASSERT() rw_assert(&cc_list_lock, RA_LOCKED) | ||||
#define CC_ALGOOPT_LIMIT 2048 | #define CC_ALGOOPT_LIMIT 2048 | ||||
#endif /* _KERNEL */ | |||||
#endif /* _NETINET_CC_CC_H_ */ | #endif /* _NETINET_CC_CC_H_ */ |
you could move this section to the top so that there are not intermixed user/kernel parts..