diff options
-rw-r--r-- | net/dccp/ackvec.h | 3 | ||||
-rw-r--r-- | net/dccp/output.c | 22 |
2 files changed, 17 insertions, 8 deletions
diff --git a/net/dccp/ackvec.h b/net/dccp/ackvec.h index 45f95e55f873..7ea557b7c6b1 100644 --- a/net/dccp/ackvec.h +++ b/net/dccp/ackvec.h | |||
@@ -20,6 +20,9 @@ | |||
20 | /* We can spread an ack vector across multiple options */ | 20 | /* We can spread an ack vector across multiple options */ |
21 | #define DCCP_MAX_ACKVEC_LEN (DCCP_SINGLE_OPT_MAXLEN * 2) | 21 | #define DCCP_MAX_ACKVEC_LEN (DCCP_SINGLE_OPT_MAXLEN * 2) |
22 | 22 | ||
23 | /* Estimated minimum average Ack Vector length - used for updating MPS */ | ||
24 | #define DCCPAV_MIN_OPTLEN 16 | ||
25 | |||
23 | #define DCCP_ACKVEC_STATE_RECEIVED 0 | 26 | #define DCCP_ACKVEC_STATE_RECEIVED 0 |
24 | #define DCCP_ACKVEC_STATE_ECN_MARKED (1 << 6) | 27 | #define DCCP_ACKVEC_STATE_ECN_MARKED (1 << 6) |
25 | #define DCCP_ACKVEC_STATE_NOT_RECEIVED (3 << 6) | 28 | #define DCCP_ACKVEC_STATE_NOT_RECEIVED (3 << 6) |
diff --git a/net/dccp/output.c b/net/dccp/output.c index 22a618af4893..27c79bcc6a1e 100644 --- a/net/dccp/output.c +++ b/net/dccp/output.c | |||
@@ -161,21 +161,27 @@ unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu) | |||
161 | struct inet_connection_sock *icsk = inet_csk(sk); | 161 | struct inet_connection_sock *icsk = inet_csk(sk); |
162 | struct dccp_sock *dp = dccp_sk(sk); | 162 | struct dccp_sock *dp = dccp_sk(sk); |
163 | u32 ccmps = dccp_determine_ccmps(dp); | 163 | u32 ccmps = dccp_determine_ccmps(dp); |
164 | int cur_mps = ccmps ? min(pmtu, ccmps) : pmtu; | 164 | u32 cur_mps = ccmps ? min(pmtu, ccmps) : pmtu; |
165 | 165 | ||
166 | /* Account for header lengths and IPv4/v6 option overhead */ | 166 | /* Account for header lengths and IPv4/v6 option overhead */ |
167 | cur_mps -= (icsk->icsk_af_ops->net_header_len + icsk->icsk_ext_hdr_len + | 167 | cur_mps -= (icsk->icsk_af_ops->net_header_len + icsk->icsk_ext_hdr_len + |
168 | sizeof(struct dccp_hdr) + sizeof(struct dccp_hdr_ext)); | 168 | sizeof(struct dccp_hdr) + sizeof(struct dccp_hdr_ext)); |
169 | 169 | ||
170 | /* | 170 | /* |
171 | * FIXME: this should come from the CCID infrastructure, where, say, | 171 | * Leave enough headroom for common DCCP header options. |
172 | * TFRC will say it wants TIMESTAMPS, ELAPSED time, etc, for now lets | 172 | * This only considers options which may appear on DCCP-Data packets, as |
173 | * put a rough estimate for NDP + TIMESTAMP + TIMESTAMP_ECHO + ELAPSED | 173 | * per table 3 in RFC 4340, 5.8. When running out of space for other |
174 | * TIME + TFRC_OPT_LOSS_EVENT_RATE + TFRC_OPT_RECEIVE_RATE + padding to | 174 | * options (eg. Ack Vector which can take up to 255 bytes), it is better |
175 | * make it a multiple of 4 | 175 | * to schedule a separate Ack. Thus we leave headroom for the following: |
176 | * - 1 byte for Slow Receiver (11.6) | ||
177 | * - 6 bytes for Timestamp (13.1) | ||
178 | * - 10 bytes for Timestamp Echo (13.3) | ||
179 | * - 8 bytes for NDP count (7.7, when activated) | ||
180 | * - 6 bytes for Data Checksum (9.3) | ||
181 | * - %DCCPAV_MIN_OPTLEN bytes for Ack Vector size (11.4, when enabled) | ||
176 | */ | 182 | */ |
177 | 183 | cur_mps -= roundup(1 + 6 + 10 + dp->dccps_send_ndp_count * 8 + 6 + | |
178 | cur_mps -= roundup(5 + 6 + 10 + 6 + 6 + 6, 4); | 184 | (dp->dccps_hc_rx_ackvec ? DCCPAV_MIN_OPTLEN : 0), 4); |
179 | 185 | ||
180 | /* And store cached results */ | 186 | /* And store cached results */ |
181 | icsk->icsk_pmtu_cookie = pmtu; | 187 | icsk->icsk_pmtu_cookie = pmtu; |