From: Natale Patriciello <natale.patriciello@gmail.com>
To: "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev <netdev@vger.kernel.org>,
Ahmed Said <ahmed.said@uniroma2.it>,
Natale Patriciello <natale.patriciello@gmail.com>,
Francesco Zampognaro <zampognaro@ing.uniroma2.it>,
Cesare Roseti <roseti@ing.uniroma2.it>
Subject: [RFC PATCH v2 2/5] tcp: implemented pacing_expired
Date: Sat, 14 Oct 2017 13:47:11 +0200 [thread overview]
Message-ID: <20171014114714.3694-3-natale.patriciello@gmail.com> (raw)
In-Reply-To: <20171014114714.3694-1-natale.patriciello@gmail.com>
Inform the congestion control that the pacing timer, previously set,
has expired. The commit does not consider situations in which another
kind of timer has expired (e.g., a tail loss probe, a retransmission
timer...)
Signed-off-by: Natale Patriciello <natale.patriciello@gmail.com>
---
include/net/tcp.h | 2 ++
net/ipv4/tcp_output.c | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 42c7aa96c4cf..e817f0669d0e 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1017,6 +1017,8 @@ struct tcp_congestion_ops {
union tcp_cc_info *info);
/* get the expiration time for the pacing timer (optional) */
u64 (*get_pacing_time)(struct sock *sk);
+ /* the pacing timer is expired (optional) */
+ void (*pacing_timer_expired)(struct sock *sk);
char name[TCP_CA_NAME_MAX];
struct module *owner;
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index ec5977156c26..25b4cf0802f2 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2241,6 +2241,7 @@ void tcp_chrono_stop(struct sock *sk, const enum tcp_chrono type)
static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
int push_one, gfp_t gfp)
{
+ const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops;
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *skb;
unsigned int tso_segs, sent_pkts;
@@ -2263,6 +2264,11 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
max_segs = tcp_tso_segs(sk, mss_now);
tcp_mstamp_refresh(tp);
+
+ if (!tcp_pacing_timer_check(sk) &&
+ ca_ops && ca_ops->pacing_timer_expired)
+ ca_ops->pacing_timer_expired(sk);
+
while ((skb = tcp_send_head(sk))) {
unsigned int limit;
--
2.14.2
next prev parent reply other threads:[~2017-10-14 11:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-14 11:47 [RFC PATCH v2 0/5] TCP Wave Natale Patriciello
2017-10-14 11:47 ` [RFC PATCH v2 1/5] tcp: Added a function to retrieve pacing timer Natale Patriciello
2017-10-14 11:47 ` Natale Patriciello [this message]
2017-10-15 17:30 ` [RFC PATCH v2 2/5] tcp: implemented pacing_expired Eric Dumazet
2017-10-14 11:47 ` [RFC PATCH v2 3/5] tcp: added get_segs_per_round Natale Patriciello
2017-10-15 17:32 ` Eric Dumazet
2017-10-14 11:47 ` [RFC PATCH v2 4/5] tcp: added segment sent Natale Patriciello
2017-10-14 11:47 ` [RFC PATCH v2 5/5] wave: Added TCP Wave Natale Patriciello
2017-10-15 17:43 ` Eric Dumazet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171014114714.3694-3-natale.patriciello@gmail.com \
--to=natale.patriciello@gmail.com \
--cc=ahmed.said@uniroma2.it \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=roseti@ing.uniroma2.it \
--cc=zampognaro@ing.uniroma2.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox