Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/727/?format=api
{ "id": 727, "url": "http://patchwork.ozlabs.org/api/patches/727/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1221933153-11874-5-git-send-email-ilpo.jarvinen@helsinki.fi/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api", "name": "Linux network development", "link_name": "netdev", "list_id": "netdev.vger.kernel.org", "list_email": "netdev@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1221933153-11874-5-git-send-email-ilpo.jarvinen@helsinki.fi>", "list_archive_url": null, "date": "2008-09-20T17:52:22", "name": "[net-next,04/15] tcp: convert retransmit_cnt_hint to seqno", "commit_ref": null, "pull_url": null, "state": "rejected", "archived": true, "hash": "2ac11781a6eeff557aae68fe6a0f3a2fa9d3940e", "submitter": { "id": 255, "url": "http://patchwork.ozlabs.org/api/people/255/?format=api", "name": "Ilpo Järvinen", "email": "ilpo.jarvinen@helsinki.fi" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/1221933153-11874-5-git-send-email-ilpo.jarvinen@helsinki.fi/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/727/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/727/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.176.167])\n\tby ozlabs.org (Postfix) with ESMTP id 3210BDDEDA\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSun, 21 Sep 2008 03:52:56 +1000 (EST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751415AbYITRwu (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSat, 20 Sep 2008 13:52:50 -0400", "(majordomo@vger.kernel.org) by vger.kernel.org id S1751370AbYITRwt\n\t(ORCPT <rfc822; netdev-outgoing>); Sat, 20 Sep 2008 13:52:49 -0400", "from courier.cs.helsinki.fi ([128.214.9.1]:59235 \"EHLO\n\tmail.cs.helsinki.fi\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751128AbYITRwi (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Sat, 20 Sep 2008 13:52:38 -0400", "from wrl-59.cs.helsinki.fi (wrl-59.cs.helsinki.fi\n\t[128.214.166.179])\n\t(AUTH: PLAIN cs-relay, TLS: TLSv1/SSLv3,256bits,AES256-SHA)\n\tby mail.cs.helsinki.fi with esmtp; Sat, 20 Sep 2008 20:52:34 +0300\n\tid 0005BED2.48D53862.00002C0F", "by wrl-59.cs.helsinki.fi (Postfix, from userid 50795)\n\tid 4E1D5A00A4; Sat, 20 Sep 2008 20:52:34 +0300 (EEST)" ], "From": "\"=?ISO-8859-1?Q?Ilpo_J=E4rvinen?=\" <ilpo.jarvinen@helsinki.fi>", "To": "David Miller <davem@davemloft.net>", "Cc": "netdev@vger.kernel.org,\n\t\"=?utf-8?q?Ilpo=20J=E4rvinen?=\" <ilpo.jarvinen@helsinki.fi>", "Subject": "[PATCH net-next 04/15] tcp: convert retransmit_cnt_hint to seqno", "Date": "Sat, 20 Sep 2008 20:52:22 +0300", "Message-Id": "<1221933153-11874-5-git-send-email-ilpo.jarvinen@helsinki.fi>", "X-Mailer": "git-send-email 1.5.4.2.156.ge3c5", "In-Reply-To": "<1221933153-11874-4-git-send-email-ilpo.jarvinen@helsinki.fi>", "References": "<1221933153-11874-1-git-send-email-ilpo.jarvinen@helsinki.fi>\n\t<1221933153-11874-2-git-send-email-ilpo.jarvinen@helsinki.fi>\n\t<1221933153-11874-3-git-send-email-ilpo.jarvinen@helsinki.fi>\n\t<1221933153-11874-4-git-send-email-ilpo.jarvinen@helsinki.fi>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=ISO-8859-1", "Content-Transfer-Encoding": "8bit", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "Main benefit in this is that we can then freely point\nthe retransmit_skb_hint to anywhere we want to because\nthere's no longer need to know what would be the count\nchanges involve, and since this is really used only as a\nterminator, unnecessary work is one time walk at most,\nand if some retransmissions are necessary after that\npoint later on, the walk is not full waste of time\nanyway.\n\nSigned-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>\n---\n include/linux/tcp.h | 2 +-\n include/net/tcp.h | 3 +++\n net/ipv4/tcp_input.c | 12 +++++++++---\n net/ipv4/tcp_output.c | 16 +++++-----------\n 4 files changed, 18 insertions(+), 15 deletions(-)", "diff": "diff --git a/include/linux/tcp.h b/include/linux/tcp.h\nindex 2e25573..d7637c4 100644\n--- a/include/linux/tcp.h\n+++ b/include/linux/tcp.h\n@@ -358,7 +358,7 @@ struct tcp_sock {\n \t\t\t\t\t */\n \n \tint lost_cnt_hint;\n-\tint retransmit_cnt_hint;\n+\tu32 retransmit_high;\t/* L-bits may be on up to this seqno */\n \n \tu32\tlost_retrans_low;\t/* Sent seq after any rxmit (lowest) */\n \ndiff --git a/include/net/tcp.h b/include/net/tcp.h\nindex 38551bb..9be41c9 100644\n--- a/include/net/tcp.h\n+++ b/include/net/tcp.h\n@@ -1044,6 +1044,9 @@ static inline void tcp_clear_all_retrans_hints(struct tcp_sock *tp)\n \ttp->forward_skb_hint = NULL;\n }\n \n+extern void tcp_verify_retransmit_hint(struct tcp_sock *tp,\n+\t\t\t\t struct sk_buff *skb);\n+\n /* MD5 Signature */\n struct crypto_hash;\n \ndiff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c\nindex f46c7fe..84935cf 100644\n--- a/net/ipv4/tcp_input.c\n+++ b/net/ipv4/tcp_input.c\n@@ -984,12 +984,16 @@ static void tcp_update_reordering(struct sock *sk, const int metric,\n * retransmitted past LOST markings in the first place? I'm not fully sure\n * about undo and end of connection cases, which can cause R without L?\n */\n-static void tcp_verify_retransmit_hint(struct tcp_sock *tp, struct sk_buff *skb)\n+void tcp_verify_retransmit_hint(struct tcp_sock *tp, struct sk_buff *skb)\n {\n-\tif ((tp->retransmit_skb_hint != NULL) &&\n+\tif ((tp->retransmit_skb_hint == NULL) ||\n \t before(TCP_SKB_CB(skb)->seq,\n \t\t TCP_SKB_CB(tp->retransmit_skb_hint)->seq))\n-\t\ttp->retransmit_skb_hint = NULL;\n+\t\ttp->retransmit_skb_hint = skb;\n+\n+\tif (!tp->lost_out ||\n+\t after(TCP_SKB_CB(skb)->end_seq, tp->retransmit_high))\n+\t\ttp->retransmit_high = TCP_SKB_CB(skb)->end_seq;\n }\n \n static void __tcp_skb_mark_lost(struct tcp_sock *tp, struct sk_buff *skb)\n@@ -1888,6 +1892,7 @@ static void tcp_enter_frto_loss(struct sock *sk, int allowed_segments, int flag)\n \t\tif (!(TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)) {\n \t\t\tTCP_SKB_CB(skb)->sacked |= TCPCB_LOST;\n \t\t\ttp->lost_out += tcp_skb_pcount(skb);\n+\t\t\ttp->retransmit_high = TCP_SKB_CB(skb)->end_seq;\n \t\t}\n \t}\n \ttcp_verify_left_out(tp);\n@@ -1972,6 +1977,7 @@ void tcp_enter_loss(struct sock *sk, int how)\n \t\t\tTCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_ACKED;\n \t\t\tTCP_SKB_CB(skb)->sacked |= TCPCB_LOST;\n \t\t\ttp->lost_out += tcp_skb_pcount(skb);\n+\t\t\ttp->retransmit_high = TCP_SKB_CB(skb)->end_seq;\n \t\t}\n \t}\n \ttcp_verify_left_out(tp);\ndiff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c\nindex 1b8d980..fbe10f4 100644\n--- a/net/ipv4/tcp_output.c\n+++ b/net/ipv4/tcp_output.c\n@@ -1851,6 +1851,7 @@ void tcp_simple_retransmit(struct sock *sk)\n \t\t\t\ttcp_skb_mark_lost(tp, skb);\n \t\t\t\tlost = 1;\n \t\t\t}\n+\t\t\ttcp_verify_retransmit_hint(tp, skb);\n \t\t}\n \t}\n \n@@ -2006,15 +2007,11 @@ void tcp_xmit_retransmit_queue(struct sock *sk)\n \tconst struct inet_connection_sock *icsk = inet_csk(sk);\n \tstruct tcp_sock *tp = tcp_sk(sk);\n \tstruct sk_buff *skb;\n-\tint packet_cnt;\n \n-\tif (tp->retransmit_skb_hint) {\n+\tif (tp->retransmit_skb_hint)\n \t\tskb = tp->retransmit_skb_hint;\n-\t\tpacket_cnt = tp->retransmit_cnt_hint;\n-\t} else {\n+\telse\n \t\tskb = tcp_write_queue_head(sk);\n-\t\tpacket_cnt = 0;\n-\t}\n \n \t/* First pass: retransmit lost packets. */\n \tif (tp->lost_out) {\n@@ -2025,7 +2022,6 @@ void tcp_xmit_retransmit_queue(struct sock *sk)\n \t\t\t\tbreak;\n \t\t\t/* we could do better than to assign each time */\n \t\t\ttp->retransmit_skb_hint = skb;\n-\t\t\ttp->retransmit_cnt_hint = packet_cnt;\n \n \t\t\t/* Assume this retransmit will generate\n \t\t\t * only one packet for congestion window\n@@ -2036,6 +2032,8 @@ void tcp_xmit_retransmit_queue(struct sock *sk)\n \t\t\t */\n \t\t\tif (tcp_packets_in_flight(tp) >= tp->snd_cwnd)\n \t\t\t\treturn;\n+\t\t\tif (!before(TCP_SKB_CB(skb)->seq, tp->retransmit_high))\n+\t\t\t\tbreak;\n \n \t\t\tif (sacked & TCPCB_LOST) {\n \t\t\t\tif (!(sacked & (TCPCB_SACKED_ACKED|TCPCB_SACKED_RETRANS))) {\n@@ -2056,10 +2054,6 @@ void tcp_xmit_retransmit_queue(struct sock *sk)\n \t\t\t\t\t\t\t\t\t inet_csk(sk)->icsk_rto,\n \t\t\t\t\t\t\t\t\t TCP_RTO_MAX);\n \t\t\t\t}\n-\n-\t\t\t\tpacket_cnt += tcp_skb_pcount(skb);\n-\t\t\t\tif (packet_cnt >= tp->lost_out)\n-\t\t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t}\n", "prefixes": [ "net-next", "04/15" ] }