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 BD8EA5A004E for ; Thu, 06 Jun 2024 00:13:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717625589; 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=dPkMHFPBEhJoe5jyFX1bQ7e8CiwyzOI5OxfVBcL0LPo=; b=I27S331anYkYlJMsEWhnX/sIsRenqswyYT+ZcuRKpwNPQm69Jtzo388CfLtGT684w9znkr bhC3Dc1ArqXZ6ORqFNRJh/DafPHGQ6KiQ+m0/og0S+2E6GPp6tsCU6WzkiUHbNyJB9C6nr 8L8pLd79bw8m26q+1kjD9+Kct20nVug= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-584-Qxwh-6nvPIKdAgV58RK2Vw-1; Wed, 05 Jun 2024 15:59:25 -0400 X-MC-Unique: Qxwh-6nvPIKdAgV58RK2Vw-1 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-6ad706fab2aso1948926d6.1 for ; Wed, 05 Jun 2024 12:59:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717617563; x=1718222363; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=dPkMHFPBEhJoe5jyFX1bQ7e8CiwyzOI5OxfVBcL0LPo=; b=vU2ERVZN06K7pi+Fq3XqukLB2PPF5OTmSoXBM3ey/cbiLW1fPXUDYSHEt2edIoq+hI yJAboonAqP67qrHztNy/0UiUb74+05Qqt0/3/4hj9P0sqZXP20BWrgDIjzIfovXFPJvp Zs1v0etxUFLTG8LcR3BBKwAM8FxpQSKmTKuCjro3eM4cJ9Q4PaY2ACtIysPVIn8qpnLI U5GUDc6MiPNdhZOp4LScDsy7tIOpXKJPNtRYU73MA35mO3/9ZZeNAz6l2tdubKZjF4gw 6ytKIxfNGZnO3p0eyH9g2ph1xl8eJHooF4HhEzHisvbyOzQLucUnHEJh+F2tNDlxYhgl b/0w== X-Gm-Message-State: AOJu0YwCSq+YZ2nmseGd587o0IL6NRQbGPkVXLCjD6nGnBujsRMp5U8q vZfRN+tm3DRGcyfnzL4Q1VvNQLPULGNr6iJaEogf+bVWWWvhHIFonJdSaYzj5Y57ap3GsJCbtQD XjCyTQvEL20LLdu8BgLMRNRrCYwfgKJkSrxGpKc9rIPaMxaRfRyOvZPN8sH7+meAV8qG6YXjR70 DmQ+p5DlStQvU7oplXEsrwJOpQZKkHUaRtIe0= X-Received: by 2002:a05:6214:319c:b0:6ad:82be:9bb4 with SMTP id 6a1803df08f44-6b030a5fb4amr33885576d6.49.1717617562632; Wed, 05 Jun 2024 12:59:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYRwlOKqQBn3pT5Sd/nA8Vw33g3dbUYWsV2quxGC7gXXDTXj1oOXEJI47BNfkbs6FzkixUcQ== X-Received: by 2002:a05:6214:319c:b0:6ad:82be:9bb4 with SMTP id 6a1803df08f44-6b030a5fb4amr33885326d6.49.1717617561928; Wed, 05 Jun 2024 12:59:21 -0700 (PDT) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ae4a747b9csm50547226d6.51.2024.06.05.12.59.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jun 2024 12:59:21 -0700 (PDT) Date: Wed, 5 Jun 2024 21:58:45 +0200 From: Stefano Brivio To: Jon Maloy Subject: Re: [PATCH v8] tcp: move seq_to_tap update to when frame is queued Message-ID: <20240605215846.18919974@elisabeth> In-Reply-To: <20240604182908.1833186-1-jmaloy@redhat.com> References: <20240604182908.1833186-1-jmaloy@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: DNTUK5G3KE2OO7IIIID7R5TNK2SRCU6Y X-Message-ID-Hash: DNTUK5G3KE2OO7IIIID7R5TNK2SRCU6Y 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, lvivier@redhat.com, dgibson@redhat.com 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: On Tue, 4 Jun 2024 14:29:08 -0400 Jon Maloy wrote: > commit a469fc393fa1 ("tcp, tap: Don't increase tap-side sequence counter for dropped frames") > delayed update of conn->seq_to_tap until the moment the corresponding > frame has been successfully pushed out. This has the advantage that we > immediately can make a new attempt to transmit a frame after a failed > trasnmit, rather than waiting for the peer to later discover a gap and > trigger the fast retransmit mechanism to solve the problem. > > This approach has turned out to cause a problem with spurious sequence > number updates during peer-initiated retransmits, and we have realized > it may not be the best way to solve the above issue. > > We now restore the previous method, by updating the said field at the > moment a frame is added to the outqueue. To retain the advantage of > having a quick re-attempt based on local failure detection, we now scan > through the part of the outqueue that had do be dropped, and restore the > sequence counter for each affected connection to the most appropriate > value. > > Signed-off-by: Jon Maloy > > --- > v2: - Re-spun loop in tcp_revert_seq() and some other changes based on > feedback from Stefano Brivio. > - Added paranoid test to avoid that seq_to_tap becomes lower than > seq_ack_from_tap. > > v3: - Identical to v2. Called v3 because it was embedded in a series > with that version. > > v4: - In tcp_revert_seq(), we read the sequence number from the TCP > header instead of keeping a copy in struct tcp_buf_seq_update. > - Since the only remaining field in struct tcp_buf_seq_update is > a pointer to struct tcp_tap_conn, we eliminate the struct > altogether, and make the tcp6/tcp3_buf_seq_update arrays into > arrays of said pointer. > - Removed 'paranoid' test in tcp_revert_seq. If it happens, it > is not fatal, and will be caught by other code anyway. > - Separated from the series again. > > v5: - Changed way to index array within tcp_revert_seq() > > v6-v7: No changes. > > v8: Fixed missing indexing of tcp4/6_frame_conns array in > tcp_payload_flush(). Applied, thanks. -- Stefano