{"id":825816,"url":"http://patchwork.ozlabs.org/api/1.2/patches/825816/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/20171014114714.3694-5-natale.patriciello@gmail.com/","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/1.2/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,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20171014114714.3694-5-natale.patriciello@gmail.com>","list_archive_url":null,"date":"2017-10-14T11:47:13","name":"[RFC,v2,4/5] tcp: added segment sent","commit_ref":null,"pull_url":null,"state":"rfc","archived":true,"hash":"a20734ebf7ce5b23c4da90bd32486166bf1144f3","submitter":{"id":72063,"url":"http://patchwork.ozlabs.org/api/1.2/people/72063/?format=json","name":"Natale Patriciello","email":"natale.patriciello@gmail.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/1.2/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/20171014114714.3694-5-natale.patriciello@gmail.com/mbox/","series":[{"id":8182,"url":"http://patchwork.ozlabs.org/api/1.2/series/8182/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/list/?series=8182","date":"2017-10-14T11:47:09","name":"TCP Wave","version":2,"mbox":"http://patchwork.ozlabs.org/series/8182/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/825816/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/825816/checks/","tags":{},"related":[],"headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"vBly9Az3\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yDjZ26kQzz9sNx\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 14 Oct 2017 22:50:02 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753524AbdJNLt5 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSat, 14 Oct 2017 07:49:57 -0400","from mail-wr0-f196.google.com ([209.85.128.196]:33772 \"EHLO\n\tmail-wr0-f196.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1753291AbdJNLtw (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Sat, 14 Oct 2017 07:49:52 -0400","by mail-wr0-f196.google.com with SMTP id z96so2188019wrb.0\n\tfor <netdev@vger.kernel.org>; Sat, 14 Oct 2017 04:49:52 -0700 (PDT)","from localhost.localdomain (62.57.152.197.dyn.user.ono.com.\n\t[62.57.152.197])\n\tby smtp.gmail.com with ESMTPSA id 4sm4560337wmm.1.2017.10.14.04.49.50\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tSat, 14 Oct 2017 04:49:50 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=4A5wqISqjLReyRy6fiA1/MAp2aW1R3ztkFHQeU2q7Jo=;\n\tb=vBly9Az3KxyucvQDT7M9xqDRQlK6GwB8E4VKXccSn4K0u/OlUzE/rdpBWCzcOovi6f\n\t+h4+2V4wTquRoEi1SMiDo4cnN0gYL7z5h+IURH+qUGHeluQTv3moQpA+kfIElWU/by1G\n\t0cZlLBRV83PeOArjR5TnrD/sbBVkS16233YatVYXgW75EajOjifKhFnQUqhU7aspaHx5\n\t2zbN2amCgy40MOGyEq2qEQG6h/dk7WenZfEhDLxtCtfbU9IJDqedE4MoP1sPYSwwZcmm\n\tAa7CcuGcAoabkLLi0tP4/R+W0qFj8kRp79ZWvaHXd843P9L5LxlnBm5VlKhd/8+be5b9\n\tfvCQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=4A5wqISqjLReyRy6fiA1/MAp2aW1R3ztkFHQeU2q7Jo=;\n\tb=giZfSbRjH0NxqT0m6fDcJXdLFWjXYmACy3ncA+UjdNr4GwpSyrA8IfB0wqEer4sfMu\n\t9pX3tUtYziYTryGLWAO9XIs0OHTg8w+n1A1mZRL0HSQI6QDWWgkV2MzcekwmuLx9g0nV\n\tjlO0V6NaKAfSk4tKvn5nnzq4xWbaI4Ob9jEIkW/QOB0I1wggKv+z+8M5Lx4iTMB1Yqrp\n\tMpnHKK3jxBHevB6gml+nUDDsCq5adeNi4nOwoivvxGtrBOyv+FXyXaC2kZsfAmBSmqHL\n\tqhTp18dxM2c9EdfR6Gse40spZAvWUywacnwE1RzDph4Z2dtucCISE2/N5PI4VIPyAjRb\n\tj6Sg==","X-Gm-Message-State":"AMCzsaUtAMbUPLMK4SJsDxuhNBO7S/6oTA3H+9DQxznQ8zzkrPMWJnFc\n\tdMd+d235xLqyU0+h9Ke4suJ+xlOW","X-Google-Smtp-Source":"AOwi7QDEc2Cth5tpLobh7TfeJo2SzZQeB0Z/p4Z4Vse3g+8At1q8tH+oTwiNdet3S6RjyJ0yjfkfhQ==","X-Received":"by 10.223.158.74 with SMTP id v10mr3912601wre.201.1507981791459; \n\tSat, 14 Oct 2017 04:49:51 -0700 (PDT)","From":"Natale Patriciello <natale.patriciello@gmail.com>","To":"\"David S . Miller\" <davem@davemloft.net>,\n\tEric Dumazet <eric.dumazet@gmail.com>","Cc":"netdev <netdev@vger.kernel.org>, Ahmed Said <ahmed.said@uniroma2.it>,\n\tNatale Patriciello <natale.patriciello@gmail.com>,\n\tFrancesco Zampognaro <zampognaro@ing.uniroma2.it>,\n\tCesare Roseti <roseti@ing.uniroma2.it>","Subject":"[RFC PATCH v2 4/5] tcp: added segment sent","Date":"Sat, 14 Oct 2017 13:47:13 +0200","Message-Id":"<20171014114714.3694-5-natale.patriciello@gmail.com>","X-Mailer":"git-send-email 2.14.2","In-Reply-To":"<20171014114714.3694-1-natale.patriciello@gmail.com>","References":"<20171014114714.3694-1-natale.patriciello@gmail.com>","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"Inform the congestion control of the number of segment sent in normal\nconditions, it means segments that left the node without involving\nrecovery or retransmission procedures.\n\nSigned-off-by: Natale Patriciello <natale.patriciello@gmail.com>\n---\n include/net/tcp.h     |  2 ++\n net/ipv4/tcp_output.c | 10 +++++++++-\n 2 files changed, 11 insertions(+), 1 deletion(-)","diff":"diff --git a/include/net/tcp.h b/include/net/tcp.h\nindex 3561eca5a61f..aebe225ab8b1 100644\n--- a/include/net/tcp.h\n+++ b/include/net/tcp.h\n@@ -1021,6 +1021,8 @@ struct tcp_congestion_ops {\n \tvoid (*pacing_timer_expired)(struct sock *sk);\n \t/* get the # segs to send out when the timer expires (optional) */\n \tu32 (*get_segs_per_round)(struct sock *sk);\n+\t/* the TCP has sent some segments (optional) */\n+\tvoid (*segments_sent)(struct sock *sk, u32 sent);\n \n \tchar \t\tname[TCP_CA_NAME_MAX];\n \tstruct module \t*owner;\ndiff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c\nindex e37941e4328b..ef50202659da 100644\n--- a/net/ipv4/tcp_output.c\n+++ b/net/ipv4/tcp_output.c\n@@ -2250,6 +2250,7 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,\n \tbool is_cwnd_limited = false, is_rwnd_limited = false;\n \tu32 max_segs;\n \tu32 pacing_allowed_segs = 0;\n+\tbool notify = false;\n \n \tsent_pkts = 0;\n \n@@ -2268,8 +2269,12 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,\n \n \tif (!tcp_pacing_timer_check(sk)) {\n \t\tpacing_allowed_segs = 1;\n-\t\tif (ca_ops && ca_ops->pacing_timer_expired)\n+\n+\t\tif (ca_ops && ca_ops->pacing_timer_expired) {\n \t\t\tca_ops->pacing_timer_expired(sk);\n+\t\t\tnotify = true;\n+\t\t}\n+\n \t\tif (ca_ops && ca_ops->get_segs_per_round)\n \t\t\tpacing_allowed_segs = ca_ops->get_segs_per_round(sk);\n \t}\n@@ -2348,6 +2353,9 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,\n \t\t\tbreak;\n \t}\n \n+\tif (ca_ops && notify && ca_ops->segments_sent)\n+\t\tca_ops->segments_sent(sk, sent_pkts);\n+\n \tif (is_rwnd_limited)\n \t\ttcp_chrono_start(sk, TCP_CHRONO_RWND_LIMITED);\n \telse\n","prefixes":["RFC","v2","4/5"]}