Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/723/?format=api
{ "id": 723, "url": "http://patchwork.ozlabs.org/api/patches/723/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1221933153-11874-4-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-4-git-send-email-ilpo.jarvinen@helsinki.fi>", "list_archive_url": null, "date": "2008-09-20T17:52:21", "name": "[net-next,03/15] tcp: add helper for lost bit toggling", "commit_ref": null, "pull_url": null, "state": "rejected", "archived": true, "hash": "b889b121892613bd2aa7871dce11daa3a3c46a83", "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-4-git-send-email-ilpo.jarvinen@helsinki.fi/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/723/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/723/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 8DF93DDED8\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSun, 21 Sep 2008 03:52:53 +1000 (EST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751281AbYITRwn (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSat, 20 Sep 2008 13:52:43 -0400", "(majordomo@vger.kernel.org) by vger.kernel.org id S1751335AbYITRwm\n\t(ORCPT <rfc822; netdev-outgoing>); Sat, 20 Sep 2008 13:52:42 -0400", "from courier.cs.helsinki.fi ([128.214.9.1]:39329 \"EHLO\n\tmail.cs.helsinki.fi\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1750979AbYITRwg (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Sat, 20 Sep 2008 13:52:36 -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 0005BED0.48D53862.00002BFC", "by wrl-59.cs.helsinki.fi (Postfix, from userid 50795)\n\tid 2A8A7A0095; Sat, 20 Sep 2008 20:52:33 +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 03/15] tcp: add helper for lost bit toggling", "Date": "Sat, 20 Sep 2008 20:52:21 +0300", "Message-Id": "<1221933153-11874-4-git-send-email-ilpo.jarvinen@helsinki.fi>", "X-Mailer": "git-send-email 1.5.4.2.156.ge3c5", "In-Reply-To": "<1221933153-11874-3-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>", "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": "Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>\n---\n include/net/tcp.h | 1 +\n net/ipv4/tcp_input.c | 36 +++++++++++++++++++-----------------\n net/ipv4/tcp_output.c | 3 +--\n 3 files changed, 21 insertions(+), 19 deletions(-)", "diff": "diff --git a/include/net/tcp.h b/include/net/tcp.h\nindex b716763..38551bb 100644\n--- a/include/net/tcp.h\n+++ b/include/net/tcp.h\n@@ -472,6 +472,7 @@ extern void tcp_send_delayed_ack(struct sock *sk);\n \n /* tcp_input.c */\n extern void tcp_cwnd_application_limited(struct sock *sk);\n+extern void tcp_skb_mark_lost(struct tcp_sock *tp, struct sk_buff *skb);\n \n /* tcp_timer.c */\n extern void tcp_init_xmit_timers(struct sock *);\ndiff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c\nindex 9e95ad6..f46c7fe 100644\n--- a/net/ipv4/tcp_input.c\n+++ b/net/ipv4/tcp_input.c\n@@ -992,6 +992,18 @@ static void tcp_verify_retransmit_hint(struct tcp_sock *tp, struct sk_buff *skb)\n \t\ttp->retransmit_skb_hint = NULL;\n }\n \n+static void __tcp_skb_mark_lost(struct tcp_sock *tp, struct sk_buff *skb)\n+{\n+\ttp->lost_out += tcp_skb_pcount(skb);\n+\tTCP_SKB_CB(skb)->sacked |= TCPCB_LOST;\n+}\n+\n+void tcp_skb_mark_lost(struct tcp_sock *tp, struct sk_buff *skb)\n+{\n+\t__tcp_skb_mark_lost(tp, skb);\n+\ttcp_verify_retransmit_hint(tp, skb);\n+}\n+\n /* This procedure tags the retransmission queue when SACKs arrive.\n *\n * We have three tag bits: SACKED(S), RETRANS(R) and LOST(L).\n@@ -1168,13 +1180,9 @@ static void tcp_mark_lost_retrans(struct sock *sk)\n \t\t\tTCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_RETRANS;\n \t\t\ttp->retrans_out -= tcp_skb_pcount(skb);\n \n-\t\t\t/* clear lost hint */\n-\t\t\ttp->retransmit_skb_hint = NULL;\n-\n-\t\t\tif (!(TCP_SKB_CB(skb)->sacked & (TCPCB_LOST|TCPCB_SACKED_ACKED))) {\n-\t\t\t\ttp->lost_out += tcp_skb_pcount(skb);\n-\t\t\t\tTCP_SKB_CB(skb)->sacked |= TCPCB_LOST;\n-\t\t\t}\n+\t\t\tif (!(TCP_SKB_CB(skb)->sacked & (TCPCB_LOST|TCPCB_SACKED_ACKED)))\n+\t\t\t\t__tcp_skb_mark_lost(tp, skb);\n+\t\t\ttcp_verify_retransmit_hint(tp, skb);\n \t\t\tNET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPLOSTRETRANSMIT);\n \t\t} else {\n \t\t\tif (before(ack_seq, new_low_seq))\n@@ -2216,11 +2224,8 @@ static void tcp_mark_head_lost(struct sock *sk, int packets)\n \t\t\tcnt = packets;\n \t\t}\n \n-\t\tif (!(TCP_SKB_CB(skb)->sacked & (TCPCB_SACKED_ACKED|TCPCB_LOST))) {\n-\t\t\tTCP_SKB_CB(skb)->sacked |= TCPCB_LOST;\n-\t\t\ttp->lost_out += tcp_skb_pcount(skb);\n-\t\t\ttcp_verify_retransmit_hint(tp, skb);\n-\t\t}\n+\t\tif (!(TCP_SKB_CB(skb)->sacked & (TCPCB_SACKED_ACKED|TCPCB_LOST)))\n+\t\t\ttcp_skb_mark_lost(tp, skb);\n \t}\n \ttcp_verify_left_out(tp);\n }\n@@ -2262,11 +2267,8 @@ static void tcp_update_scoreboard(struct sock *sk, int fast_rexmit)\n \t\t\tif (!tcp_skb_timedout(sk, skb))\n \t\t\t\tbreak;\n \n-\t\t\tif (!(TCP_SKB_CB(skb)->sacked & (TCPCB_SACKED_ACKED|TCPCB_LOST))) {\n-\t\t\t\tTCP_SKB_CB(skb)->sacked |= TCPCB_LOST;\n-\t\t\t\ttp->lost_out += tcp_skb_pcount(skb);\n-\t\t\t\ttcp_verify_retransmit_hint(tp, skb);\n-\t\t\t}\n+\t\t\tif (!(TCP_SKB_CB(skb)->sacked & (TCPCB_SACKED_ACKED|TCPCB_LOST)))\n+\t\t\t\ttcp_skb_mark_lost(tp, skb);\n \t\t}\n \n \t\ttp->scoreboard_skb_hint = skb;\ndiff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c\nindex 2242c2c..1b8d980 100644\n--- a/net/ipv4/tcp_output.c\n+++ b/net/ipv4/tcp_output.c\n@@ -1848,8 +1848,7 @@ void tcp_simple_retransmit(struct sock *sk)\n \t\t\t\ttp->retrans_out -= tcp_skb_pcount(skb);\n \t\t\t}\n \t\t\tif (!(TCP_SKB_CB(skb)->sacked & TCPCB_LOST)) {\n-\t\t\t\tTCP_SKB_CB(skb)->sacked |= TCPCB_LOST;\n-\t\t\t\ttp->lost_out += tcp_skb_pcount(skb);\n+\t\t\t\ttcp_skb_mark_lost(tp, skb);\n \t\t\t\tlost = 1;\n \t\t\t}\n \t\t}\n", "prefixes": [ "net-next", "03/15" ] }