netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: netperf TCP_CRR test fails in bonding interfaces(mode 0)
@ 2023-12-10 15:16 ditang chen
  2023-12-10 18:06 ` Stephen Hemminger
  2023-12-12  8:45 ` Eric Dumazet
  0 siblings, 2 replies; 3+ messages in thread
From: ditang chen @ 2023-12-10 15:16 UTC (permalink / raw)
  To: netdev

Reproduce
1. client/server:
# modprobe bonding
# ifconfig enp1s3 down
# ifconfig enp2s3 down
# echo "+bond0" > /sys/class/net/bonding_masters
# edho "enp1s3" > /sys/class/net/bond0/bonding/slaves
# edho "enp2s3" > /sys/class/net/bond0/bonding/slaves
# ifconfig bond0 up

2. server
# ifconfig bond0 192.168.50.101
# netserver -D -d -f

3. client
# ifconfig bond0 192.168.50.100
# netperf -t TCP_CRR -H 192.168.50.101 -l 3600

netperf may terminated with "netperf:send_omni:recv_data failed:
Connection reset by peer".
the client correctly establishes connection and then send its
data(psh+ack), but if the server process the data(psh+ack) before the
ack, and then server side just resets connection.

---
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 8afb0950a697..630bbe78539f 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -6502,8 +6502,11 @@ int tcp_rcv_state_process(struct sock *sk,
struct sk_buff *skb)
                goto discard;

        case TCP_LISTEN:
-               if (th->ack)
+               if (th->ack) {
+                       if (th->psh)
+                               goto discard;
                        return 1;
+               }

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

* Re: [PATCH] net: netperf TCP_CRR test fails in bonding interfaces(mode 0)
  2023-12-10 15:16 [PATCH] net: netperf TCP_CRR test fails in bonding interfaces(mode 0) ditang chen
@ 2023-12-10 18:06 ` Stephen Hemminger
  2023-12-12  8:45 ` Eric Dumazet
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2023-12-10 18:06 UTC (permalink / raw)
  To: ditang chen; +Cc: netdev

On Sun, 10 Dec 2023 23:16:20 +0800
ditang chen <ditang.c@gmail.com> wrote:

> 1. client/server:
> # modprobe bonding
> # ifconfig enp1s3 down
> # ifconfig enp2s3 down
> # echo "+bond0" > /sys/class/net/bonding_masters
> # edho "enp1s3" > /sys/class/net/bond0/bonding/slaves
> # edho "enp2s3" > /sys/class/net/bond0/bonding/slaves
> # ifconfig bond0 up

This is a really old legacy way to configure bonding.
The better method is:

# ip link add dev bond0 type bond
# ip link set dev enp1s3 down master bond0
# ip link set dev enp2s3 down master bond0
# ip link set dev bond0 up

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

* Re: [PATCH] net: netperf TCP_CRR test fails in bonding interfaces(mode 0)
  2023-12-10 15:16 [PATCH] net: netperf TCP_CRR test fails in bonding interfaces(mode 0) ditang chen
  2023-12-10 18:06 ` Stephen Hemminger
@ 2023-12-12  8:45 ` Eric Dumazet
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2023-12-12  8:45 UTC (permalink / raw)
  To: ditang chen, netdev


On 12/10/23 16:16, ditang chen wrote:
> Reproduce
> 1. client/server:
> # modprobe bonding
> # ifconfig enp1s3 down
> # ifconfig enp2s3 down
> # echo "+bond0" > /sys/class/net/bonding_masters
> # edho "enp1s3" > /sys/class/net/bond0/bonding/slaves
> # edho "enp2s3" > /sys/class/net/bond0/bonding/slaves
> # ifconfig bond0 up
>
> 2. server
> # ifconfig bond0 192.168.50.101
> # netserver -D -d -f
>
> 3. client
> # ifconfig bond0 192.168.50.100
> # netperf -t TCP_CRR -H 192.168.50.101 -l 3600
>
> netperf may terminated with "netperf:send_omni:recv_data failed:
> Connection reset by peer".
> the client correctly establishes connection and then send its
> data(psh+ack), but if the server process the data(psh+ack) before the
> ack, and then server side just resets connection.
>
> ---
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index 8afb0950a697..630bbe78539f 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -6502,8 +6502,11 @@ int tcp_rcv_state_process(struct sock *sk,
> struct sk_buff *skb)
>                  goto discard;
>
>          case TCP_LISTEN:
> -               if (th->ack)
> +               if (th->ack) {
> +                       if (th->psh)
> +                               goto discard;
>                          return 1;
> +               }


This seems to be an invalid patch.

Please tell us which RFC would mandate such a thing...

It would help if you could cook a packetdrill test demonstrating the issue.

Also make sure to cc me next time (edumazet@google.com)





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

end of thread, other threads:[~2023-12-12  8:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-10 15:16 [PATCH] net: netperf TCP_CRR test fails in bonding interfaces(mode 0) ditang chen
2023-12-10 18:06 ` Stephen Hemminger
2023-12-12  8:45 ` Eric Dumazet

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).