From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id 9C1E35A026D for ; Sat, 23 Sep 2023 00:31:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695421916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tMWIMHoKh3UbRNyBQYldDHOpeRHcqMB23qQYS77DMxU=; b=VIPVFSO8Q3Q7Zbzs89yduAS28VSLJ0hi96eUT+MJtmVuURCMqrO9ETaaWOxX/LjGR8koVF nfwf7aj+JOozTFFxmu0JC6yBlJ6nISlkCmwzckvN806uUyy2CYZC7V/8hLrZPZX+jSznYp PlQnj0YsSYRcp+OOLR8ssIlnE54B/KE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-693-T-sQMlBxNkyl8vbn2bn5cw-1; Fri, 22 Sep 2023 18:31:53 -0400 X-MC-Unique: T-sQMlBxNkyl8vbn2bn5cw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D444B811E7D; Fri, 22 Sep 2023 22:31:52 +0000 (UTC) Received: from elisabeth (unknown [10.39.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0A0EC2156A27; Fri, 22 Sep 2023 22:31:51 +0000 (UTC) Date: Sat, 23 Sep 2023 00:31:47 +0200 From: Stefano Brivio To: David Gibson , Matej Hrica Subject: Re: [PATCH RFT 3/5] tcp: Force TCP_WINDOW_CLAMP before resetting STALLED flag Message-ID: <20230923003147.7dbbc945@elisabeth> In-Reply-To: <20230922220610.58767-4-sbrivio@redhat.com> References: <20230922220610.58767-1-sbrivio@redhat.com> <20230922220610.58767-4-sbrivio@redhat.com> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: CSUVHKXZ5UXVXQPOV5JS4TOCI2MNQBKJ X-Message-ID-Hash: CSUVHKXZ5UXVXQPOV5JS4TOCI2MNQBKJ X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Oops, On Sat, 23 Sep 2023 00:06:08 +0200 Stefano Brivio wrote: > It looks like we need it as workaround for this situation, readily > reproducible at least with a 6.5 Linux kernel, with default rmem_max > and wmem_max values: > > - an iperf3 client on the host sends about 160 KiB, typically > segmented into five frames by passt. We read this data using > MSG_PEEK > > - the iperf3 server on the guest starts receiving > > - meanwhile, the host kernel advertised a zero-sized window to the > receiver, as expected ^^^ sender > > - eventually, the guest acknowledges all the data sent so far, and > we drop it from the buffer, courtesy of tcp_sock_consume(), using > recv() with MSG_TRUNC > > - the client, however, doesn't get an updated window value, and > even keepalive packets are answered with zero-window segments, > until the connection is closed > > It looks like dropping data from a socket using MSG_TRUNC doesn't > cause a recalculation of the window, which would be expected as a > result of any receiving operation that invalidates data on a buffer > (that is, not with MSG_PEEK). > > Strangely enough, setting TCP_WINDOW_CLAMP via setsockopt(), even to > the previous value we clamped to, forces a recalculation of the > window which is advertised to the guest. ^^^ sender -- Stefano