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:   Fri,  5 Jan 2018 12:32:54 +0100
From:   Natale Patriciello <natale.patriciello@...il.com>
To:     netdev@...r.kernel.org
Cc:     Natale Patriciello <natale.patriciello@...il.com>,
        Carlo Augusto Grazia <carloaugusto.grazia@...more.it>,
        Eric Dumazet <edumazet@...gle.com>
Subject: [RFC PATCH 1/3] Revert "tcp: allow drivers to tweak TSQ logic"

There are a lot of drivers that are still outside the mainline, and it is
impossible to expect the authors (which in most cases do not maintain the
driver anymore) to check the best value for the device, and then to insert
it into the driver code. Moreover, if the users want to check or to use
other values, they have to recompile the driver (or the kernel).

This reverts commit 3a9b76fd0db9f0d426533f96a68a62a58753a51e, preparing the
field for tunable sysctl knobs.

Signed-off-by: Natale Patriciello <natale.patriciello@...il.com>
Signed-off-by: Carlo Augusto Grazia <carloaugusto.grazia@...more.it>
Cc: Eric Dumazet <edumazet@...gle.com>

---
 include/net/sock.h    | 2 --
 net/core/sock.c       | 1 -
 net/ipv4/tcp_output.c | 4 ++--
 3 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index 7a7b14e9628a..20c6a9ae25f4 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -267,7 +267,6 @@ struct sock_common {
   *	@sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4)
   *	@sk_gso_max_size: Maximum GSO segment size to build
   *	@sk_gso_max_segs: Maximum number of GSO segments
-  *	@sk_pacing_shift: scaling factor for TCP Small Queues
   *	@sk_lingertime: %SO_LINGER l_linger setting
   *	@sk_backlog: always used with the per-socket spinlock held
   *	@sk_callback_lock: used with the callbacks in the end of this struct
@@ -449,7 +448,6 @@ struct sock {
 				sk_type      : 16;
 #define SK_PROTOCOL_MAX U8_MAX
 	u16			sk_gso_max_segs;
-	u8			sk_pacing_shift;
 	unsigned long	        sk_lingertime;
 	struct proto		*sk_prot_creator;
 	rwlock_t		sk_callback_lock;
diff --git a/net/core/sock.c b/net/core/sock.c
index c0b5b2f17412..78e16e06b0b7 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2744,7 +2744,6 @@ void sock_init_data(struct socket *sock, struct sock *sk)
 
 	sk->sk_max_pacing_rate = ~0U;
 	sk->sk_pacing_rate = ~0U;
-	sk->sk_pacing_shift = 10;
 	sk->sk_incoming_cpu = -1;
 	/*
 	 * Before updating sk_refcnt, we must commit prior changes to memory
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index a4d214c7b506..ef1ae727320f 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1720,7 +1720,7 @@ u32 tcp_tso_autosize(const struct sock *sk, unsigned int mss_now,
 {
 	u32 bytes, segs;
 
-	bytes = min(sk->sk_pacing_rate >> sk->sk_pacing_shift,
+	bytes = min(sk->sk_pacing_rate >> 10,
 		    sk->sk_gso_max_size - 1 - MAX_TCP_HEADER);
 
 	/* Goal is to send at least one packet per ms,
@@ -2198,7 +2198,7 @@ static bool tcp_small_queue_check(struct sock *sk, const struct sk_buff *skb,
 {
 	unsigned int limit;
 
-	limit = max(2 * skb->truesize, sk->sk_pacing_rate >> sk->sk_pacing_shift);
+	limit = max(2 * skb->truesize, sk->sk_pacing_rate >> 10);
 	limit = min_t(u32, limit,
 		      sock_net(sk)->ipv4.sysctl_tcp_limit_output_bytes);
 	limit <<= factor;
-- 
2.15.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ