netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND net-next v3 0/2] tcp: add a new TW_PAWS drop reason
@ 2025-04-07 13:59 Jiayuan Chen
  2025-04-07 13:59 ` [PATCH RESEND net-next v3 1/2] tcp: add TCP_RFC7323_TW_PAWS " Jiayuan Chen
  2025-04-07 13:59 ` [PATCH RESEND net-next v3 2/2] tcp: add LINUX_MIB_PAWS_TW_REJECTED counter Jiayuan Chen
  0 siblings, 2 replies; 8+ messages in thread
From: Jiayuan Chen @ 2025-04-07 13:59 UTC (permalink / raw)
  To: bpf
  Cc: mrpre, Jiayuan Chen, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Jonathan Corbet,
	Neal Cardwell, Kuniyuki Iwashima, David Ahern, Steffen Klassert,
	Sabrina Dubroca, Antony Antony, Christian Hopps, netdev,
	linux-doc, linux-kernel

PAWS is a long-standing issue, especially when there are upstream network
devices, making it more prone to occur.

Currently, packet loss statistics for PAWS can only be viewed through MIB,
which is a global metric and cannot be precisely obtained through tracing
to get the specific 4-tuple of the dropped packet. In the past, we had to
use kprobe ret to retrieve relevant skb information from
tcp_timewait_state_process().

---
Re-sending the patch after merge window.

v2 -> v3: use new SNMP counter and drop reason suggested by Eric.
https://lore.kernel.org/netdev/5cdc1bdd9caee92a6ae932638a862fd5c67630e8@linux.dev/T/#t

I didn't provide a packetdrill script.
I struggled for a long time to get packetdrill to fix the client port, but
ultimately failed to do so...

Instead, I wrote my own program to trigger PAWS, which can be found at
https://github.com/mrpre/nettrigger/tree/main
'''
//assume nginx running on 172.31.75.114:9999, current host is 172.31.75.115
iptables -t filter -I OUTPUT -p tcp --sport 12345 --tcp-flags RST RST -j DROP
./nettrigger -i eth0 -s 172.31.75.115:12345 -d 172.31.75.114:9999 -action paws
'''


Jiayuan Chen (2):
  tcp: add TCP_RFC7323_TW_PAWS drop reason
  tcp: add LINUX_MIB_PAWS_TW_REJECTED counter

 Documentation/networking/net_cachelines/snmp.rst | 2 ++
 include/net/dropreason-core.h                    | 7 +++++++
 include/net/tcp.h                                | 3 ++-
 include/uapi/linux/snmp.h                        | 1 +
 net/ipv4/proc.c                                  | 1 +
 net/ipv4/tcp_ipv4.c                              | 3 ++-
 net/ipv4/tcp_minisocks.c                         | 9 ++++++---
 net/ipv6/tcp_ipv6.c                              | 3 ++-
 8 files changed, 23 insertions(+), 6 deletions(-)

-- 
2.47.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-04-08 15:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-07 13:59 [PATCH RESEND net-next v3 0/2] tcp: add a new TW_PAWS drop reason Jiayuan Chen
2025-04-07 13:59 ` [PATCH RESEND net-next v3 1/2] tcp: add TCP_RFC7323_TW_PAWS " Jiayuan Chen
2025-04-08 14:16   ` Eric Dumazet
2025-04-07 13:59 ` [PATCH RESEND net-next v3 2/2] tcp: add LINUX_MIB_PAWS_TW_REJECTED counter Jiayuan Chen
2025-04-08 14:18   ` Eric Dumazet
2025-04-08 14:57     ` Jiayuan Chen
2025-04-08 15:19       ` Jakub Kicinski
2025-04-08 15:49         ` Jiayuan Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).