diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2010-11-10 15:20:07 -0500 |
---|---|---|
committer | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2010-11-10 15:20:07 -0500 |
commit | f17a37c9b8c4b32c01e501a84fa6f30e344c6110 (patch) | |
tree | 7ff8e9a232aaddcd33c302c5c6a577af26634212 /net/dccp/ccids | |
parent | 973a34aa8593dbfe84386343c694f5beecb51d8a (diff) |
dccp ccid-2: Ack Vector interface clean-up
This patch brings the Ack Vector interface up to date. Its main purpose is
to lay the basis for the subsequent patches of this set, which will use the
new data structure fields and routines.
There are no real algorithmic changes, rather an adaptation:
(1) Replaced the static Ack Vector size (2) with a #define so that it can
be adapted (with low loss / Ack Ratio, a value of 1 works, so 2 seems
to be sufficient for the moment) and added a solution so that computing
the ECN nonce will continue to work - even with larger Ack Vectors.
(2) Replaced the #defines for Ack Vector states with a complete enum.
(3) Replaced #defines to compute Ack Vector length and state with general
purpose routines (inlines), and updated code to use these.
(4) Added a `tail' field (conversion to circular buffer in subsequent patch).
(5) Updated the (outdated) documentation for Ack Vector struct.
(6) All sequence number containers now trimmed to 48 bits.
(7) Removal of unused bits:
* removed dccpav_ack_nonce from struct dccp_ackvec, since this is already
redundantly stored in the `dccpavr_ack_nonce' (of Ack Vector record);
* removed Elapsed Time for Ack Vectors (it was nowhere used);
* replaced semantics of dccpavr_sent_len with dccpavr_ack_runlen, since
the code needs to be able to remember the old run length;
* reduced the de-/allocation routines (redundant / duplicate tests).
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Diffstat (limited to 'net/dccp/ccids')
-rw-r--r-- | net/dccp/ccids/ccid2.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c index 6576eae9e779..cb1b4a0d1877 100644 --- a/net/dccp/ccids/ccid2.c +++ b/net/dccp/ccids/ccid2.c | |||
@@ -513,8 +513,7 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
513 | &vector, &veclen)) != -1) { | 513 | &vector, &veclen)) != -1) { |
514 | /* go through this ack vector */ | 514 | /* go through this ack vector */ |
515 | while (veclen--) { | 515 | while (veclen--) { |
516 | const u8 rl = *vector & DCCP_ACKVEC_LEN_MASK; | 516 | u64 ackno_end_rl = SUB48(ackno, dccp_ackvec_runlen(vector)); |
517 | u64 ackno_end_rl = SUB48(ackno, rl); | ||
518 | 517 | ||
519 | ccid2_pr_debug("ackvec start:%llu end:%llu\n", | 518 | ccid2_pr_debug("ackvec start:%llu end:%llu\n", |
520 | (unsigned long long)ackno, | 519 | (unsigned long long)ackno, |
@@ -537,17 +536,15 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
537 | * run length | 536 | * run length |
538 | */ | 537 | */ |
539 | while (between48(seqp->ccid2s_seq,ackno_end_rl,ackno)) { | 538 | while (between48(seqp->ccid2s_seq,ackno_end_rl,ackno)) { |
540 | const u8 state = *vector & | 539 | const u8 state = dccp_ackvec_state(vector); |
541 | DCCP_ACKVEC_STATE_MASK; | ||
542 | 540 | ||
543 | /* new packet received or marked */ | 541 | /* new packet received or marked */ |
544 | if (state != DCCP_ACKVEC_STATE_NOT_RECEIVED && | 542 | if (state != DCCPAV_NOT_RECEIVED && |
545 | !seqp->ccid2s_acked) { | 543 | !seqp->ccid2s_acked) { |
546 | if (state == | 544 | if (state == DCCPAV_ECN_MARKED) |
547 | DCCP_ACKVEC_STATE_ECN_MARKED) { | ||
548 | ccid2_congestion_event(sk, | 545 | ccid2_congestion_event(sk, |
549 | seqp); | 546 | seqp); |
550 | } else | 547 | else |
551 | ccid2_new_ack(sk, seqp, | 548 | ccid2_new_ack(sk, seqp, |
552 | &maxincr); | 549 | &maxincr); |
553 | 550 | ||