lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 14 Oct 2017 13:47:13 +0200
From:   Natale Patriciello <natale.patriciello@...il.com>
To:     "David S . Miller" <davem@...emloft.net>,
        Eric Dumazet <eric.dumazet@...il.com>
Cc:     netdev <netdev@...r.kernel.org>,
        Ahmed Said <ahmed.said@...roma2.it>,
        Natale Patriciello <natale.patriciello@...il.com>,
        Francesco Zampognaro <zampognaro@....uniroma2.it>,
        Cesare Roseti <roseti@....uniroma2.it>
Subject: [RFC PATCH v2 4/5] tcp: added segment sent

Inform the congestion control of the number of segment sent in normal
conditions, it means segments that left the node without involving
recovery or retransmission procedures.

Signed-off-by: Natale Patriciello <natale.patriciello@...il.com>
---
 include/net/tcp.h     |  2 ++
 net/ipv4/tcp_output.c | 10 +++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index 3561eca5a61f..aebe225ab8b1 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1021,6 +1021,8 @@ struct tcp_congestion_ops {
 	void (*pacing_timer_expired)(struct sock *sk);
 	/* get the # segs to send out when the timer expires (optional) */
 	u32 (*get_segs_per_round)(struct sock *sk);
+	/* the TCP has sent some segments (optional) */
+	void (*segments_sent)(struct sock *sk, u32 sent);
 
 	char 		name[TCP_CA_NAME_MAX];
 	struct module 	*owner;
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index e37941e4328b..ef50202659da 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2250,6 +2250,7 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
 	bool is_cwnd_limited = false, is_rwnd_limited = false;
 	u32 max_segs;
 	u32 pacing_allowed_segs = 0;
+	bool notify = false;
 
 	sent_pkts = 0;
 
@@ -2268,8 +2269,12 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
 
 	if (!tcp_pacing_timer_check(sk)) {
 		pacing_allowed_segs = 1;
-		if (ca_ops && ca_ops->pacing_timer_expired)
+
+		if (ca_ops && ca_ops->pacing_timer_expired) {
 			ca_ops->pacing_timer_expired(sk);
+			notify = true;
+		}
+
 		if (ca_ops && ca_ops->get_segs_per_round)
 			pacing_allowed_segs = ca_ops->get_segs_per_round(sk);
 	}
@@ -2348,6 +2353,9 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
 			break;
 	}
 
+	if (ca_ops && notify && ca_ops->segments_sent)
+		ca_ops->segments_sent(sk, sent_pkts);
+
 	if (is_rwnd_limited)
 		tcp_chrono_start(sk, TCP_CHRONO_RWND_LIMITED);
 	else
-- 
2.14.2

Powered by blists - more mailing lists