[{"id":1787051,"web_url":"http://patchwork.ozlabs.org/comment/1787051/","msgid":"<1508088729.31614.66.camel@edumazet-glaptop3.roam.corp.google.com>","list_archive_url":null,"date":"2017-10-15T17:32:09","subject":"Re: [RFC PATCH v2 3/5] tcp: added get_segs_per_round","submitter":{"id":2404,"url":"http://patchwork.ozlabs.org/api/people/2404/","name":"Eric Dumazet","email":"eric.dumazet@gmail.com"},"content":"On Sat, 2017-10-14 at 13:47 +0200, Natale Patriciello wrote:\n> Usually, the pacing time is provided per-segment. In some occasion, this\n> time refers to the time between a group of segments. With this commit, add\n> the possibility for the congestion control module to tell the TCP socket\n> how many segments can be sent out before pausing and setting a pacing\n> timer.\n> \n> Signed-off-by: Natale Patriciello <natale.patriciello@gmail.com>\n> ---\n>  include/net/tcp.h     |  2 ++\n>  net/ipv4/tcp_output.c | 13 +++++++++----\n>  2 files changed, 11 insertions(+), 4 deletions(-)\n> \n> diff --git a/include/net/tcp.h b/include/net/tcp.h\n> index e817f0669d0e..3561eca5a61f 100644\n> --- a/include/net/tcp.h\n> +++ b/include/net/tcp.h\n> @@ -1019,6 +1019,8 @@ struct tcp_congestion_ops {\n>  \tu64 (*get_pacing_time)(struct sock *sk);\n>  \t/* the pacing timer is expired (optional) */\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>  \n>  \tchar \t\tname[TCP_CA_NAME_MAX];\n>  \tstruct module \t*owner;\n> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c\n> index 25b4cf0802f2..e37941e4328b 100644\n> --- a/net/ipv4/tcp_output.c\n> +++ b/net/ipv4/tcp_output.c\n> @@ -2249,6 +2249,7 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,\n>  \tint result;\n>  \tbool is_cwnd_limited = false, is_rwnd_limited = false;\n>  \tu32 max_segs;\n> +\tu32 pacing_allowed_segs = 0;\n>  \n>  \tsent_pkts = 0;\n>  \n> @@ -2265,14 +2266,18 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,\n>  \tmax_segs = tcp_tso_segs(sk, mss_now);\n>  \ttcp_mstamp_refresh(tp);\n>  \n> -\tif (!tcp_pacing_timer_check(sk) &&\n> -\t    ca_ops && ca_ops->pacing_timer_expired)\n> -\t\tca_ops->pacing_timer_expired(sk);\n> +\tif (!tcp_pacing_timer_check(sk)) {\n> +\t\tpacing_allowed_segs = 1;\n> +\t\tif (ca_ops && ca_ops->pacing_timer_expired)\n> +\t\t\tca_ops->pacing_timer_expired(sk);\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>  \n>  \twhile ((skb = tcp_send_head(sk))) {\n>  \t\tunsigned int limit;\n>  \n> -\t\tif (tcp_pacing_check(sk))\n> +\t\tif (sent_pkts >= pacing_allowed_segs)\n>  \t\t\tbreak;\n>  \n\nSo, if pacing_allowed_segs == 0, we break immediately of the loop ????\n\nAre you sure you have tested this patch with normal CC like CUBIC and\nBBR ?","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=\"HVJtqRDK\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yFT6T3qxvz9t1t\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon, 16 Oct 2017 04:32:17 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751898AbdJORcM (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSun, 15 Oct 2017 13:32:12 -0400","from mail-pg0-f67.google.com ([74.125.83.67]:57265 \"EHLO\n\tmail-pg0-f67.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751502AbdJORcL (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Sun, 15 Oct 2017 13:32:11 -0400","by mail-pg0-f67.google.com with SMTP id m18so4994181pgd.13\n\tfor <netdev@vger.kernel.org>; Sun, 15 Oct 2017 10:32:10 -0700 (PDT)","from [192.168.86.171] (c-67-180-167-114.hsd1.ca.comcast.net.\n\t[67.180.167.114]) by smtp.googlemail.com with ESMTPSA id\n\tr18sm9508967pfi.59.2017.10.15.10.32.09\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tSun, 15 Oct 2017 10:32:10 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=message-id:subject:from:to:cc:date:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=y9dxeDYybQcxIN740TfBDrsG8oQCUHjKH4IXh4HdPAI=;\n\tb=HVJtqRDK3JycmGp7C8olLQsSb9gd6eHE4UpXp1NH6bzBvSssh55T2fmL4lyd2dJmD4\n\tYmQoRKXw8qtm2XHOcFXlGGFu1vyTPRAJqiHxBwgrtPGTub2LkPJzBJS5xwcinfzrg1XJ\n\twm7Fhkpaim+jp8flRfWZkmBsmJHTkDj0wXWS8vS9jTK62wvbpZ5dVC2ggVWccdZoRf8h\n\t2h7pvWdYobC5tOjkHHXkT8cvnTBXpTxa5mm4Bixn+zHHv6+66THNpyUe6oKmLuZuCrls\n\tqiq2UGur5xzhgkU+oAoE2byMeBx4NA94yartcGpYVGt9ifYyrmzELTx6NpweD1vmcAvF\n\tN8rA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=y9dxeDYybQcxIN740TfBDrsG8oQCUHjKH4IXh4HdPAI=;\n\tb=EDsuVMzU+OPaDjlTJtnxZF1zwyiu6X8jYFbnz5kkrCee2m1fjr5z4tiZqE7TL7XHff\n\t5H0plGNUivUEJjyhBwUCLh/FsQVFnkF8H4kWUBk++9TJ77B5W76gywjtV1rFiMsVnrwN\n\tlA6MscdrtRzI5CdpcKDh6TUFqRkddMUP1RyFxnsfditAmCVHKwJH3hIr2acH4fQbC5Re\n\tGcVlp38Q+yeFDeDeYHWms9UwPfGd9PhIn26j+C7GspGwE08U9V3QtNEzT4hJT6byhbFh\n\tdx4cto/MsmcOoYW2Oa9q7uNtpEtIuyYTsxBBypttxgUJZMuVt26q8kR1ykz1n6azEuCv\n\tBxig==","X-Gm-Message-State":"AMCzsaWNGs+dyJIO7SC4DWC5APclIAQlCHZ7wdEAjQSsHT4G58BKD6zM\n\txrtpwvygmtEzPYO4/ttbyxY=","X-Google-Smtp-Source":"AOwi7QAqxTlg+Ds1H/qr/pCe1Su5ulLLTIIBVK2AMfKKYARVdh0bsJI4pzoqLpW2AJ+drKKgcGg5Lg==","X-Received":"by 10.99.43.6 with SMTP id r6mr6121456pgr.353.1508088730711;\n\tSun, 15 Oct 2017 10:32:10 -0700 (PDT)","Message-ID":"<1508088729.31614.66.camel@edumazet-glaptop3.roam.corp.google.com>","Subject":"Re: [RFC PATCH v2 3/5] tcp: added get_segs_per_round","From":"Eric Dumazet <eric.dumazet@gmail.com>","To":"Natale Patriciello <natale.patriciello@gmail.com>","Cc":"\"David S . Miller\" <davem@davemloft.net>,\n\tnetdev <netdev@vger.kernel.org>, Ahmed Said <ahmed.said@uniroma2.it>,\n\tFrancesco Zampognaro <zampognaro@ing.uniroma2.it>,\n\tCesare Roseti <roseti@ing.uniroma2.it>","Date":"Sun, 15 Oct 2017 10:32:09 -0700","In-Reply-To":"<20171014114714.3694-4-natale.patriciello@gmail.com>","References":"<20171014114714.3694-1-natale.patriciello@gmail.com>\n\t<20171014114714.3694-4-natale.patriciello@gmail.com>","Content-Type":"text/plain; charset=\"UTF-8\"","X-Mailer":"Evolution 3.10.4-0ubuntu2 ","Mime-Version":"1.0","Content-Transfer-Encoding":"7bit","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}}]