{"id":724,"url":"http://patchwork.ozlabs.org/api/1.0/patches/724/?format=json","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/1.0/projects/7/?format=json","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},"msgid":"<1221933153-11874-8-git-send-email-ilpo.jarvinen@helsinki.fi>","date":"2008-09-20T17:52:25","name":"[net-next,07/15] tcp: add tcp_can_forward_retransmit","commit_ref":null,"pull_url":null,"state":"rejected","archived":true,"hash":"17611c1611e5ce7e0f8c6c201e954a2144d3e5db","submitter":{"id":255,"url":"http://patchwork.ozlabs.org/api/1.0/people/255/?format=json","name":"Ilpo Järvinen","email":"ilpo.jarvinen@helsinki.fi"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/1221933153-11874-8-git-send-email-ilpo.jarvinen@helsinki.fi/mbox/","series":[],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/724/checks/","tags":{},"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 30579DDE00\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSun, 21 Sep 2008 03:52:54 +1000 (EST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751357AbYITRwp (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSat, 20 Sep 2008 13:52:45 -0400","(majordomo@vger.kernel.org) by vger.kernel.org id S1751344AbYITRwn\n\t(ORCPT <rfc822; netdev-outgoing>); Sat, 20 Sep 2008 13:52:43 -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 S1750884AbYITRwi (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 0005BED6.48D53862.00002CA5","by wrl-59.cs.helsinki.fi (Postfix, from userid 50795)\n\tid 69B52A00A8; 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 07/15] tcp: add tcp_can_forward_retransmit","Date":"Sat, 20 Sep 2008 20:52:25 +0300","Message-Id":"<1221933153-11874-8-git-send-email-ilpo.jarvinen@helsinki.fi>","X-Mailer":"git-send-email 1.5.4.2.156.ge3c5","In-Reply-To":"<1221933153-11874-7-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>\n\t<1221933153-11874-5-git-send-email-ilpo.jarvinen@helsinki.fi>\n\t<1221933153-11874-6-git-send-email-ilpo.jarvinen@helsinki.fi>\n\t<1221933153-11874-7-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 net/ipv4/tcp_output.c |   46 ++++++++++++++++++++++++++++------------------\n 1 files changed, 28 insertions(+), 18 deletions(-)","diff":"diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c\nindex fbe10f4..2cec9b2 100644\n--- a/net/ipv4/tcp_output.c\n+++ b/net/ipv4/tcp_output.c\n@@ -1994,6 +1994,33 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)\n \treturn err;\n }\n \n+static int tcp_can_forward_retransmit(struct sock *sk)\n+{\n+\tconst struct inet_connection_sock *icsk = inet_csk(sk);\n+\tstruct tcp_sock *tp = tcp_sk(sk);\n+\n+\t/* Forward retransmissions are possible only during Recovery. */\n+\tif (icsk->icsk_ca_state != TCP_CA_Recovery)\n+\t\treturn 0;\n+\n+\t/* No forward retransmissions in Reno are possible. */\n+\tif (tcp_is_reno(tp))\n+\t\treturn 0;\n+\n+\t/* Yeah, we have to make difficult choice between forward transmission\n+\t * and retransmission... Both ways have their merits...\n+\t *\n+\t * For now we do not retransmit anything, while we have some new\n+\t * segments to send. In the other cases, follow rule 3 for\n+\t * NextSeg() specified in RFC3517.\n+\t */\n+\n+\tif (tcp_may_send_now(sk))\n+\t\treturn 0;\n+\n+\treturn 1;\n+}\n+\n /* This gets called after a retransmit timeout, and the initially\n  * retransmitted data is acknowledged.  It tries to continue\n  * resending the rest of the retransmit queue, until either\n@@ -2059,24 +2086,7 @@ void tcp_xmit_retransmit_queue(struct sock *sk)\n \t}\n \n \t/* OK, demanded retransmission is finished. */\n-\n-\t/* Forward retransmissions are possible only during Recovery. */\n-\tif (icsk->icsk_ca_state != TCP_CA_Recovery)\n-\t\treturn;\n-\n-\t/* No forward retransmissions in Reno are possible. */\n-\tif (tcp_is_reno(tp))\n-\t\treturn;\n-\n-\t/* Yeah, we have to make difficult choice between forward transmission\n-\t * and retransmission... Both ways have their merits...\n-\t *\n-\t * For now we do not retransmit anything, while we have some new\n-\t * segments to send. In the other cases, follow rule 3 for\n-\t * NextSeg() specified in RFC3517.\n-\t */\n-\n-\tif (tcp_may_send_now(sk))\n+\tif (!tcp_can_forward_retransmit(sk))\n \t\treturn;\n \n \t/* If nothing is SACKed, highest_sack in the loop won't be valid */\n","prefixes":["net-next","07/15"]}