From patchwork Mon Jul 9 17:53:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepti Raghavan X-Patchwork-Id: 941532 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mit.edu Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41PY3w5B0jz9rxs for ; Tue, 10 Jul 2018 03:58:52 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933973AbeGIR6u (ORCPT ); Mon, 9 Jul 2018 13:58:50 -0400 Received: from dmz-mailsec-scanner-8.mit.edu ([18.7.68.37]:54066 "EHLO dmz-mailsec-scanner-8.mit.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933676AbeGIR6t (ORCPT ); Mon, 9 Jul 2018 13:58:49 -0400 X-Greylist: delayed 301 seconds by postgrey-1.27 at vger.kernel.org; Mon, 09 Jul 2018 13:58:49 EDT X-AuditID: 12074425-50fff70000000686-eb-5b43a12c2708 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP id 2C.F6.01670.C21A34B5; Mon, 9 Jul 2018 13:53:48 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH-1.MIT.EDU [18.9.28.11]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id w69Hrlpl010050; Mon, 9 Jul 2018 13:53:48 -0400 Received: from ip-172-31-56-178.ec2.internal (ec2-34-227-158-253.compute-1.amazonaws.com [34.227.158.253]) (authenticated bits=0) (User authenticated as deeptir@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id w69Hrfi5017400 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 9 Jul 2018 13:53:46 -0400 From: Deepti Raghavan To: David Miller Cc: netdev@vger.kernel.org, Deepti Raghavan Subject: [PATCH net-next] tcp: expose both send and receive intervals for rate sample Date: Mon, 9 Jul 2018 17:53:39 +0000 Message-Id: <1531158819-7901-1-git-send-email-deeptir@mit.edu> X-Mailer: git-send-email 2.7.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRmVeSWpSXmKPExsUixG6noquz0Dna4NwcJYs551tYLPq7DrBZ HFsg5sDssWXlTSaPnbPusnt83iQXwBzFZZOSmpNZllqkb5fAlbFs1R2mghV8FU8WP2RqYLzC 3cXIySEhYCLxZ95t1i5GLg4hgcVMEk83/oNyNjBKdM1czAhSJSRwj0niwiJzEJtNQF1i6fEf rCC2iICaxMQTE5hBbGYBW4n7p+4ygdjCAqESp9feAbNZBFQlTk+bCjaHV8BOYveEu6wQm+Uk bp7rZJ7AyL2AkWEVo2xKbpVubmJmTnFqsm5xcmJeXmqRroVebmaJXmpK6SZGsOddVHcwzvnr dYhRgINRiYeXI8M5Wog1say4MvcQoyQHk5IoL9MCx2ghvqT8lMqMxOKM+KLSnNTiQ4wSHMxK IrwGOUDlvCmJlVWpRfkwKWkOFiVx3pxFjNFCAumJJanZqakFqUUwWRkODiUJ3u4FQI2CRanp qRVpmTklCGkmDk6Q4TxAw+/OBxleXJCYW5yZDpE/xWjMcaq5ZxIzx5/3UycxC7Hk5eelSonz bgYZJwBSmlGaBzcNFL1Kj+f9fcUoDvScMK8+SBUPMPLh5r0CWsUEtOr2fEeQVSWJCCmpBkY/ 0f0zX5YvF97Uv//78RkSBXPcXKULb2y4/3jlmqKYjLNynwtMlnu82at20f28q//JAqU7RxdL 2sUKqnE1Hz2lGqWRaxHnzcbVLN7A07Dxq1ZCB+vsjCs6cnyb9778McPi6IeA/M+tFuybXU2E fRxj2YtCloROV/0968m2+0L/QvSN33gsu6nEUpyRaKjFXFScCACWwgBJuQIAAA== Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Congestion control algorithms, which access the rate sample through the tcp_cong_control function, only have access to the maximum of the send and receive interval, for cases where the acknowledgment rate may be inaccurate due to ACK compression or decimation. Algorithms may want to use send rates and receive rates as separate signals. Signed-off-by: Deepti Raghavan Acked-by: Neal Cardwell Signed-off-by: Eric Dumazet --- include/net/tcp.h | 2 ++ net/ipv4/tcp_rate.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/include/net/tcp.h b/include/net/tcp.h index cce3769..f6cb20e 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -954,6 +954,8 @@ struct rate_sample { u32 prior_delivered; /* tp->delivered at "prior_mstamp" */ s32 delivered; /* number of packets delivered over interval */ long interval_us; /* time for tp->delivered to incr "delivered" */ + u32 snd_interval_us; /* snd interval for delivered packets */ + u32 rcv_interval_us; /* rcv interval for delivered packets */ long rtt_us; /* RTT of last (S)ACKed packet (or -1) */ int losses; /* number of packets marked lost upon ACK */ u32 acked_sacked; /* number of packets newly (S)ACKed upon ACK */ diff --git a/net/ipv4/tcp_rate.c b/net/ipv4/tcp_rate.c index c61240e..4dff40d 100644 --- a/net/ipv4/tcp_rate.c +++ b/net/ipv4/tcp_rate.c @@ -146,6 +146,10 @@ void tcp_rate_gen(struct sock *sk, u32 delivered, u32 lost, rs->prior_mstamp); /* ack phase */ rs->interval_us = max(snd_us, ack_us); + /* Record both segment send and ack receive intervals */ + rs->snd_interval_us = snd_us; + rs->rcv_interval_us = ack_us; + /* Normally we expect interval_us >= min-rtt. * Note that rate may still be over-estimated when a spuriously * retransmistted skb was first (s)acked because "interval_us"