[{"id":1787050,"web_url":"http://patchwork.ozlabs.org/comment/1787050/","msgid":"<1508088648.31614.63.camel@edumazet-glaptop3.roam.corp.google.com>","list_archive_url":null,"date":"2017-10-15T17:30:48","subject":"Re: [RFC PATCH v2 2/5] tcp: implemented pacing_expired","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> Inform the congestion control that the pacing timer, previously set,\n> has expired. The commit does not consider situations in which another\n> kind of timer has expired (e.g., a tail loss probe, a retransmission\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 | 6 ++++++\n>  2 files changed, 8 insertions(+)\n> \n> diff --git a/include/net/tcp.h b/include/net/tcp.h\n> index 42c7aa96c4cf..e817f0669d0e 100644\n> --- a/include/net/tcp.h\n> +++ b/include/net/tcp.h\n> @@ -1017,6 +1017,8 @@ struct tcp_congestion_ops {\n>  \t\t\t   union tcp_cc_info *info);\n>  \t/* get the expiration time for the pacing timer (optional) */\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>  \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 ec5977156c26..25b4cf0802f2 100644\n> --- a/net/ipv4/tcp_output.c\n> +++ b/net/ipv4/tcp_output.c\n> @@ -2241,6 +2241,7 @@ void tcp_chrono_stop(struct sock *sk, const enum tcp_chrono type)\n>  static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,\n>  \t\t\t   int push_one, gfp_t gfp)\n>  {\n> +\tconst struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops;\n>  \tstruct tcp_sock *tp = tcp_sk(sk);\n>  \tstruct sk_buff *skb;\n>  \tunsigned int tso_segs, sent_pkts;\n> @@ -2263,6 +2264,11 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,\n>  \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> +\n>  \n\n1) We do not want hrtimer_active() being called for each\ntcp_write_xmit() ... :/\n\n2) ca_ops can not be NULL.\n\n\n->\n       if (ca_ops->pacing_timer_expired && !tcp_pacing_timer_check(sk))\n               ca_ops->pacing_timer_expired(sk);","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=\"IprYSmdt\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yFT576VqFz9sRn\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon, 16 Oct 2017 04:31:07 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751854AbdJORax (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSun, 15 Oct 2017 13:30:53 -0400","from mail-pg0-f65.google.com ([74.125.83.65]:48919 \"EHLO\n\tmail-pg0-f65.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751502AbdJORav (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Sun, 15 Oct 2017 13:30:51 -0400","by mail-pg0-f65.google.com with SMTP id v78so4989416pgb.5\n\tfor <netdev@vger.kernel.org>; Sun, 15 Oct 2017 10:30:51 -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\tq70sm11915135pfj.39.2017.10.15.10.30.49\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tSun, 15 Oct 2017 10:30:49 -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=EFT70D+kiRYkgYz9woYpHhYLs5h938Oo8iEpfZA/1Bw=;\n\tb=IprYSmdt6sfR/PVC5yAgc9DxVg5xweg+k0CyRXY1vIeGVG1arbiFXu/+/Zlv3+MCiS\n\tkj318BUqojcQCopWT0xHe5oxzdwGNEPsviHYDMt5XMunAs9MCSkjx9a16Fk8DYOyuGBE\n\tz+MA+HY67bV6lBzlp278RzJ1C0JpTt6xCJSmpZ3sl3Y+Rlaei1Rdyb9Chs41OxP3IdAs\n\thxIBBmsoEfTaPwFrq5Adnry5u3bH40pKNEC/T/H+pNLnVLSpYWjek65Dkb2Ln7mD1ysC\n\tfMTV5t0/0kgdra7MQG40IQtRn3LNvJpgB6rULuJyddlEcVMQNKw8yP1FXGOF6fhkgD08\n\tBG5A==","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=EFT70D+kiRYkgYz9woYpHhYLs5h938Oo8iEpfZA/1Bw=;\n\tb=PgyKF4bH6OzMqFfSIDhyQ8x+DHlEUwyHZiF8A4ynPAa8p1No/PgQ2WJloA0BwJCRya\n\tvFfEcDPNxtYOYfdKAxe68EuatvMlLIox98dh5jzRqSkhXMmW35vd1nQB+9ZPiNnopYZk\n\tTMi5ZIB6jG4vOz/FHJMrneW5hKPH/uFt2kZTGKl1Bc2D+AV7RnVW7hYVelF33iyFT9jV\n\ti/XfRB/Oj5Ae3jVbUvIGSqmEYR7IDA+YRNR2LUlUIEyHY4s+4Gr4vmiyk6Lm3h12mpQC\n\ty3vq0dHZG90eD7DipDRwAMOaabOSUX9nVs6BpBkfvsvqIzUXTMpmum/AyseM8wNcjcDW\n\trmCQ==","X-Gm-Message-State":"AMCzsaXDBYh4P9UkssKkL+J79yIs5TIZWdSCH7/anz2T22xfW5Rly08u\n\tby8NqyEgXq2bCavwjkbNmSA=","X-Google-Smtp-Source":"AOwi7QBzf8LHj0CQOgmd/DjCOsVAzBSEUU+bBuwo49zf1QYF2CH/YxbrjpjHPYcuA+dc1hx0k+qyUw==","X-Received":"by 10.99.110.7 with SMTP id j7mr4706065pgc.241.1508088651251;\n\tSun, 15 Oct 2017 10:30:51 -0700 (PDT)","Message-ID":"<1508088648.31614.63.camel@edumazet-glaptop3.roam.corp.google.com>","Subject":"Re: [RFC PATCH v2 2/5] tcp: implemented pacing_expired","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:30:48 -0700","In-Reply-To":"<20171014114714.3694-3-natale.patriciello@gmail.com>","References":"<20171014114714.3694-1-natale.patriciello@gmail.com>\n\t<20171014114714.3694-3-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"}}]