From: =?ISO-8859-1?q?Ilpo_J=E4rvinen?= <ilpo.jarvinen@helsinki.fi> Previously a number of cases in TCP SACK processing fail to take advantage of costly stored information in sack_recv_cache. Most importantly expected events such as cumulative ACK, new hole ACKs and first ACK after RTO fall to this category. Processing on such ACKs result in rather long walks building up latencies (which easily gets nasty when window is large), which are completely unnecessary, usually no new information was gathered except the new SACK block above the hole in the respective case. Since the inclusion of highest_sack, there's a lot information that is very likely redundant (SACK fastpath hint stuff, fackets_out, highest_sack), though there's no ultimate guarantee that they'll remain the same whole the time (in all unearthly scenarios). Take advantage of this too and drop fastpath hint. Effectively this drops "special cased" fastpath. This change adds some complexity to introduce better coveraged "fastpath". The current ACK's SACK blocks are compared against each cached block individially and only ranges that are new are then scanned by the high constant walk. For other parts of write queue, even when in previously known part of the SACK blocks, a faster skip function is used. In addition, whenever possible, TCP fast-forwards to highest_sack skb that was made available earlier. In typical case, no other things but this fast-forward and mandatory markings after that occur making the access pattern quite similar to the former fastpath. DSACKs are special case that must always be walked. Signed-off-by: Ilpo J
