tcp: add sk->sk_synq_overflow_ts
Subsystems (5)
PATCH 1/1 tcp: add sk->sk_synq_overflow_ts
tcp_synq_overflow() and tcp_synq_no_recent_overflow() are currently using tp->rx_opt.ts_recent_stamp to store a 32bit jiffie value.
Use instead full "unsigned long" storage, as an union with sk->sk_stamp which is not used by a TCP listener.
As a bonus, we can remove time_between32() from include/linux/time.h.
--- include/linux/time.h | 13 --------- include/net/sock.h | 5 +++- include/net/sock_reuseport.h | 2 +- include/net/tcp.h | 56 ++++++++++++------------------------ 4 files changed, 24 insertions(+), 52 deletions(-)
include/linux/time.h +0 -13
@@ -84,19 +84,6 @@ static inline bool itimerspec64_valid(const struct itimerspec64 *its)#define time_after32 (a, b) ((s32)((u32)(b) - (u32)(a)) < 0)#define time_before32 (b, a) time_after32(a, b) -/** -* time_between32 - check if a 32-bit timestamp is within a given time range -* @t: the time which may be within [l,h] -* @l: the lower bound of the range -* @h: the higher bound of the range -* -* time_before32(t, l, h) returns true if @l <= @t <= @h. All operands are -* treated as 32-bit integers. -* -* Equivalent to !(time_before32(@t, @l) || time_after32(@t, @h)). -*/ -#define time_between32 (t, l, h) ((u32)(h) - (u32)(l) >= (u32)(t) - (u32)(l)) -# include <vdso/time.h> #endif
include/net/sock.h +4 -1
@@ -548,7 +548,10 @@ struct sock {struct pid *sk_peer_pid;const struct cred *sk_peer_cred; -ktime_t sk_stamp; +union { +ktime_t sk_stamp; +unsigned long sk_synq_overflow_ts;/* tcp_synq_overflow */ + };#if BITS_PER_LONG ==32 seqlock_t sk_stamp_seq;#endif
include/net/sock_reuseport.h +1 -1
@@ -20,7 +20,7 @@ struct sock_reuseport {/* The last synq overflow event timestamp of this * reuse->socks[] group. */ -unsigned int synq_overflow_ts; +unsigned long synq_overflow_ts;/* ID stays the same even after the size of socks[] grows. */ unsigned int reuseport_id; unsigned int bind_inany:1;
include/net/tcp.h +19 -37
75 lines not on this page · raw message
Signature · 1 line
2.54.0.545.g6539524ca2-goog
Quoted 8 lines · Eric Dumazet
tcp_synq_overflow()andtcp_synq_no_recent_overflow()are currently usingtp->rx_opt.ts_recent_stampto store a 32bit jiffie value.Use instead full "unsigned long" storage, as an union with
sk->sk_stampwhich is not used by a TCP listener.As a bonus, we can remove
time_between32()frominclude/linux/time.h.
Please disregard this, I sent a wrong version of this patch.
pw-bot: cr