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] [day] [month] [year] [list]
Message-ID: <CANn89iKQ4ga-CGOQOrSY+eZeSH-CggOFD8QkdDqOUZ6ovdxxdw@mail.gmail.com>
Date: Thu, 13 Feb 2025 15:51:07 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Shahar Shitrit <shshitrit@...dia.com>
Cc: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, 
	Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org, 
	Neal Cardwell <ncardwell@...gle.com>, Kevin Yang <yyd@...gle.com>, eric.dumazet@...il.com, 
	Gal Pressman <gal@...dia.com>, Tariq Toukan <tariqt@...dia.com>
Subject: Re: [PATCH net-next 3/3] tcp: try to send bigger TSO packets

Please do not top post on netdev mailing list.

On Thu, Feb 13, 2025 at 3:45 PM Shahar Shitrit <shshitrit@...dia.com> wrote:
>
> Hello,
>
> I'm troubleshooting an issue and would appreciate your input.
>
> The problem occurs when the SYNPROXY extension is configured with
> iptables on the server side, and the rmem_max value is set to 512MB on
> the same server. The combination of these two settings results in a
> significant performance drop - specifically, it reduces the iperf3
> bitrate from approximately 30 Gbps to a few Gbps (around 5).
>
> Here are some key points from my investigation:
> • When either of these configurations is applied independently, there is
> no noticeable impact on performance. The issue only arises when they are
> used together.
> • The issue persists even when TSO, GSO, and GRO are disabled on both sides.
> • The issue persists also with different congestion control algorithms.
> • In the pcap, I observe that the server's window size remains small (it
> only increases up to 9728 bytes, compared to around 64KB in normal traffic).
> • In the tcp_select_window() function, I noticed that increasing the
> rmem_max value causes tp->rx_opt.rcv_wscale to become larger (14 instead
> of the default value of 7). This, in turn, reduces the window size
> returned from the function because it gets shifted by
> tp->rx_opt.rcv_wscale. Additionally, sk->sk_rcvbuf stays stuck at its
> initial value (tcp_rmem[1]), whereas with normal traffic, it grows
> throughout the test. Similarly, sk->sk_backlog.len and sk->sk_rmem_alloc
> do not increase and remain at 0 for most of the traffic.
> • It appears that there may be an issue with the server’s ability to
> receive the skbs, which could explain why sk->sk_rmem_alloc doesn’t grow.
> • Based on the iptables counters, there doesn’t seem to be an issue with
> the SYNPROXY processing more packets than expected.
>
> Additionally, with a kernel version containing the commit below, the
> traffic performance worsens even further, dropping to 95 Kbps. As
> observed in the pcap, the server's window size remains at 512 bytes
> until it sends a RST. Moreover, from a certain point there's a 4-ms
> delay in the server ACK that persists until the RST. No retransmission
> is observed.
> One indicator of the issue is that the TSO counters don't increment and
> remain at 0, which is how we initially identified the problem.
> I'm still not sure what might be the connection between the described
> issue to this commit.
>
>
> I would appreciate any insights you might have on this issue, as well as
> suggestions for further investigation.
>
> Steps to reproduce:
>
> # server:
> ifconfig eth2 1.1.1.1
>
> sysctl -w net.netfilter.nf_conntrack_tcp_loose=0
> iptables -t raw -I PREROUTING -i eth2 -w 2 -p tcp -m tcp --syn -j CT
> --notrack
> iptables -A INPUT -i eth2 -w 2 -p tcp -m tcp -m state --state
> INVALID,UNTRACKED -j SYNPROXY --sack-perm --timestamp --wscale 7 --mss 1460
>
> echo '536870912' > /proc/sys/net/core/rmem_max

What happens if you set a more reasonable value ?

Note that TCP really uses /proc/sys/net/ipv4/tcp_rmem for its limits.

Setting a big /proc/sys/net/core/rmem_max value might have adverse effects.


>
> iperf3 -B 1.1.1.1 -s
>
> # client:
> ifconfig eth2 1.1.1.2
>
> iperf3 -B 1.1.1.2 -c 1.1.1.1
>
>
> If needed, I will send the pcaps.
>
> Thank you,
> Shahar Shitrit

Seeing that you force a small mss value, my guess is the (skb->len /
skb->truesize) ratio is small on your driver RX packets.

On receiver :

ss -temoi dst other_host

might help.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ