Skip to content

Commit d23ca15

Browse files
Andrea BittauDavid S. Miller
authored andcommitted
[DCCP] ACKVEC: Optimization - Do not traverse records if none will be found
Do not traverse the list of ack vector records [proportional to window size] when we know we will not find what we are looking for. This is especially useful because ack vectors are checked twice: 1) Upon parsing of options. 2) Upon notification of a new ack. All of the work will occur during check #1. Therefore, when check #2 is performed, no new work will be done. This is now "detected" and there is no performance hit when doing #2. Signed-off-by: Andrea Bittau <[email protected]> Signed-off-by: Gerrit Renker <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 09dbc38 commit d23ca15

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/dccp/ackvec.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ void dccp_ackvec_check_rcv_ackno(struct dccp_ackvec *av, struct sock *sk,
383383
(unsigned long long)avr->dccpavr_ack_ackno);
384384
dccp_ackvec_throw_record(av, avr);
385385
break;
386-
}
386+
} else if (avr->dccpavr_ack_seqno > ackno)
387+
break; /* old news */
387388
}
388389
}
389390

0 commit comments

Comments
 (0)