diff options
Diffstat (limited to 'net/dccp/ackvec.h')
-rw-r--r-- | net/dccp/ackvec.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/net/dccp/ackvec.h b/net/dccp/ackvec.h index b34e5ed4c342..92f65b0fef5b 100644 --- a/net/dccp/ackvec.h +++ b/net/dccp/ackvec.h | |||
@@ -21,6 +21,7 @@ | |||
21 | * the maximum size of a single Ack Vector. Setting %DCCPAV_NUM_ACKVECS to 1 | 21 | * the maximum size of a single Ack Vector. Setting %DCCPAV_NUM_ACKVECS to 1 |
22 | * will be sufficient for most cases of low Ack Ratios, using a value of 2 gives | 22 | * will be sufficient for most cases of low Ack Ratios, using a value of 2 gives |
23 | * more headroom if Ack Ratio is higher or when the sender acknowledges slowly. | 23 | * more headroom if Ack Ratio is higher or when the sender acknowledges slowly. |
24 | * The maximum value is bounded by the u16 types for indices and functions. | ||
24 | */ | 25 | */ |
25 | #define DCCPAV_NUM_ACKVECS 2 | 26 | #define DCCPAV_NUM_ACKVECS 2 |
26 | #define DCCPAV_MAX_ACKVEC_LEN (DCCP_SINGLE_OPT_MAXLEN * DCCPAV_NUM_ACKVECS) | 27 | #define DCCPAV_MAX_ACKVEC_LEN (DCCP_SINGLE_OPT_MAXLEN * DCCPAV_NUM_ACKVECS) |
@@ -55,8 +56,10 @@ static inline u8 dccp_ackvec_state(const u8 *cell) | |||
55 | * @av_buf_head: head index; begin of live portion in @av_buf | 56 | * @av_buf_head: head index; begin of live portion in @av_buf |
56 | * @av_buf_tail: tail index; first index _after_ the live portion in @av_buf | 57 | * @av_buf_tail: tail index; first index _after_ the live portion in @av_buf |
57 | * @av_buf_ackno: highest seqno of acknowledgeable packet recorded in @av_buf | 58 | * @av_buf_ackno: highest seqno of acknowledgeable packet recorded in @av_buf |
59 | * @av_tail_ackno: lowest seqno of acknowledgeable packet recorded in @av_buf | ||
58 | * @av_buf_nonce: ECN nonce sums, each covering subsequent segments of up to | 60 | * @av_buf_nonce: ECN nonce sums, each covering subsequent segments of up to |
59 | * %DCCP_SINGLE_OPT_MAXLEN cells in the live portion of @av_buf | 61 | * %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 | ||
60 | * @av_records: list of %dccp_ackvec_record (Ack Vectors sent previously) | 63 | * @av_records: list of %dccp_ackvec_record (Ack Vectors sent previously) |
61 | * @av_veclen: length of the live portion of @av_buf | 64 | * @av_veclen: length of the live portion of @av_buf |
62 | */ | 65 | */ |
@@ -65,7 +68,9 @@ struct dccp_ackvec { | |||
65 | u16 av_buf_head; | 68 | u16 av_buf_head; |
66 | u16 av_buf_tail; | 69 | u16 av_buf_tail; |
67 | u64 av_buf_ackno:48; | 70 | u64 av_buf_ackno:48; |
71 | u64 av_tail_ackno:48; | ||
68 | bool av_buf_nonce[DCCPAV_NUM_ACKVECS]; | 72 | bool av_buf_nonce[DCCPAV_NUM_ACKVECS]; |
73 | u8 av_overflow:1; | ||
69 | struct list_head av_records; | 74 | struct list_head av_records; |
70 | u16 av_vec_len; | 75 | u16 av_vec_len; |
71 | }; | 76 | }; |
@@ -113,10 +118,11 @@ extern int dccp_ackvec_parse(struct sock *sk, const struct sk_buff *skb, | |||
113 | const u8 *value, const u8 len); | 118 | const u8 *value, const u8 len); |
114 | 119 | ||
115 | extern int dccp_ackvec_update_records(struct dccp_ackvec *av, u64 seq, u8 sum); | 120 | extern int dccp_ackvec_update_records(struct dccp_ackvec *av, u64 seq, u8 sum); |
121 | extern u16 dccp_ackvec_buflen(const struct dccp_ackvec *av); | ||
116 | 122 | ||
117 | static inline int dccp_ackvec_pending(const struct dccp_ackvec *av) | 123 | static inline bool dccp_ackvec_is_empty(const struct dccp_ackvec *av) |
118 | { | 124 | { |
119 | return av->av_vec_len; | 125 | return av->av_overflow == 0 && av->av_buf_head == av->av_buf_tail; |
120 | } | 126 | } |
121 | #else /* CONFIG_IP_DCCP_ACKVEC */ | 127 | #else /* CONFIG_IP_DCCP_ACKVEC */ |
122 | static inline int dccp_ackvec_init(void) | 128 | static inline int dccp_ackvec_init(void) |
@@ -160,9 +166,14 @@ static inline int dccp_ackvec_update_records(struct dccp_ackvec *av, u64 seq, u8 | |||
160 | return -1; | 166 | return -1; |
161 | } | 167 | } |
162 | 168 | ||
163 | static inline int dccp_ackvec_pending(const struct dccp_ackvec *av) | 169 | static inline u16 dccp_ackvec_buflen(const struct dccp_ackvec *av) |
164 | { | 170 | { |
165 | return 0; | 171 | return 0; |
166 | } | 172 | } |
173 | |||
174 | static inline bool dccp_ackvec_is_empty(const struct dccp_ackvec *av) | ||
175 | { | ||
176 | return true; | ||
177 | } | ||
167 | #endif /* CONFIG_IP_DCCP_ACKVEC */ | 178 | #endif /* CONFIG_IP_DCCP_ACKVEC */ |
168 | #endif /* _ACKVEC_H */ | 179 | #endif /* _ACKVEC_H */ |