diff options
Diffstat (limited to 'net/dccp/ackvec.h')
-rw-r--r-- | net/dccp/ackvec.h | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/net/dccp/ackvec.h b/net/dccp/ackvec.h index 23880be8fc29..e2ab0627a5ff 100644 --- a/net/dccp/ackvec.h +++ b/net/dccp/ackvec.h | |||
@@ -29,6 +29,9 @@ | |||
29 | /* Estimated minimum average Ack Vector length - used for updating MPS */ | 29 | /* Estimated minimum average Ack Vector length - used for updating MPS */ |
30 | #define DCCPAV_MIN_OPTLEN 16 | 30 | #define DCCPAV_MIN_OPTLEN 16 |
31 | 31 | ||
32 | /* Threshold for coping with large bursts of losses */ | ||
33 | #define DCCPAV_BURST_THRESH (DCCPAV_MAX_ACKVEC_LEN / 8) | ||
34 | |||
32 | enum dccp_ackvec_states { | 35 | enum dccp_ackvec_states { |
33 | DCCPAV_RECEIVED = 0x00, | 36 | DCCPAV_RECEIVED = 0x00, |
34 | DCCPAV_ECN_MARKED = 0x40, | 37 | DCCPAV_ECN_MARKED = 0x40, |
@@ -61,7 +64,6 @@ static inline u8 dccp_ackvec_state(const u8 *cell) | |||
61 | * %DCCP_SINGLE_OPT_MAXLEN cells in the live portion of @av_buf | 64 | * %DCCP_SINGLE_OPT_MAXLEN cells in the live portion of @av_buf |
62 | * @av_overflow: if 1 then buf_head == buf_tail indicates buffer wraparound | 65 | * @av_overflow: if 1 then buf_head == buf_tail indicates buffer wraparound |
63 | * @av_records: list of %dccp_ackvec_record (Ack Vectors sent previously) | 66 | * @av_records: list of %dccp_ackvec_record (Ack Vectors sent previously) |
64 | * @av_veclen: length of the live portion of @av_buf | ||
65 | */ | 67 | */ |
66 | struct dccp_ackvec { | 68 | struct dccp_ackvec { |
67 | u8 av_buf[DCCPAV_MAX_ACKVEC_LEN]; | 69 | u8 av_buf[DCCPAV_MAX_ACKVEC_LEN]; |
@@ -72,7 +74,6 @@ struct dccp_ackvec { | |||
72 | bool av_buf_nonce[DCCPAV_NUM_ACKVECS]; | 74 | bool av_buf_nonce[DCCPAV_NUM_ACKVECS]; |
73 | u8 av_overflow:1; | 75 | u8 av_overflow:1; |
74 | struct list_head av_records; | 76 | struct list_head av_records; |
75 | u16 av_vec_len; | ||
76 | }; | 77 | }; |
77 | 78 | ||
78 | /** struct dccp_ackvec_record - Records information about sent Ack Vectors | 79 | /** struct dccp_ackvec_record - Records information about sent Ack Vectors |
@@ -98,29 +99,38 @@ struct dccp_ackvec_record { | |||
98 | u8 avr_ack_nonce:1; | 99 | u8 avr_ack_nonce:1; |
99 | }; | 100 | }; |
100 | 101 | ||
101 | struct sock; | ||
102 | struct sk_buff; | ||
103 | |||
104 | extern int dccp_ackvec_init(void); | 102 | extern int dccp_ackvec_init(void); |
105 | extern void dccp_ackvec_exit(void); | 103 | extern void dccp_ackvec_exit(void); |
106 | 104 | ||
107 | extern struct dccp_ackvec *dccp_ackvec_alloc(const gfp_t priority); | 105 | extern struct dccp_ackvec *dccp_ackvec_alloc(const gfp_t priority); |
108 | extern void dccp_ackvec_free(struct dccp_ackvec *av); | 106 | extern void dccp_ackvec_free(struct dccp_ackvec *av); |
109 | 107 | ||
110 | extern int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk, | 108 | extern void dccp_ackvec_input(struct dccp_ackvec *av, struct sk_buff *skb); |
111 | const u64 ackno, const u8 state); | ||
112 | |||
113 | extern void dccp_ackvec_check_rcv_ackno(struct dccp_ackvec *av, | ||
114 | struct sock *sk, const u64 ackno); | ||
115 | extern int dccp_ackvec_parse(struct sock *sk, const struct sk_buff *skb, | ||
116 | u64 *ackno, const u8 opt, | ||
117 | const u8 *value, const u8 len); | ||
118 | |||
119 | extern int dccp_ackvec_update_records(struct dccp_ackvec *av, u64 seq, u8 sum); | 109 | extern int dccp_ackvec_update_records(struct dccp_ackvec *av, u64 seq, u8 sum); |
110 | extern void dccp_ackvec_clear_state(struct dccp_ackvec *av, const u64 ackno); | ||
120 | extern u16 dccp_ackvec_buflen(const struct dccp_ackvec *av); | 111 | extern u16 dccp_ackvec_buflen(const struct dccp_ackvec *av); |
121 | 112 | ||
122 | static inline bool dccp_ackvec_is_empty(const struct dccp_ackvec *av) | 113 | static inline bool dccp_ackvec_is_empty(const struct dccp_ackvec *av) |
123 | { | 114 | { |
124 | return av->av_overflow == 0 && av->av_buf_head == av->av_buf_tail; | 115 | return av->av_overflow == 0 && av->av_buf_head == av->av_buf_tail; |
125 | } | 116 | } |
117 | |||
118 | /** | ||
119 | * struct dccp_ackvec_parsed - Record offsets of Ack Vectors in skb | ||
120 | * @vec: start of vector (offset into skb) | ||
121 | * @len: length of @vec | ||
122 | * @nonce: whether @vec had an ECN nonce of 0 or 1 | ||
123 | * @node: FIFO - arranged in descending order of ack_ackno | ||
124 | * This structure is used by CCIDs to access Ack Vectors in a received skb. | ||
125 | */ | ||
126 | struct dccp_ackvec_parsed { | ||
127 | u8 *vec, | ||
128 | len, | ||
129 | nonce:1; | ||
130 | struct list_head node; | ||
131 | }; | ||
132 | |||
133 | extern int dccp_ackvec_parsed_add(struct list_head *head, | ||
134 | u8 *vec, u8 len, u8 nonce); | ||
135 | extern void dccp_ackvec_parsed_cleanup(struct list_head *parsed_chunks); | ||
126 | #endif /* _ACKVEC_H */ | 136 | #endif /* _ACKVEC_H */ |