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.133.124]) by passt.top (Postfix) with ESMTP id 8115A5A004C for ; Wed, 05 Jun 2024 11:53:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717581218; 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=vwK+1+pDlCF/OFWf6Ou/itSACndJT7zayavgx8PAKHY=; b=CpdrkOGuKvs37M57s94K8/qsiB+mTjOrG2dEJDGAMQAhlgcB7WiunpTSE4ZVKlL/yUkIjn KtS9L3Yl2kYoBC4ErHKggsqHDfqwKMHVJ2yL220bhTaLgzixwnz8EtsdIdKo3zLI8FKBIg jLpilo1KrHbodTts0In6uhirmkl/Iv0= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-176-qiHsovwAMpaXB1BDdFIzPw-1; Wed, 05 Jun 2024 05:53:36 -0400 X-MC-Unique: qiHsovwAMpaXB1BDdFIzPw-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-6ad67a38c2cso81357846d6.0 for ; Wed, 05 Jun 2024 02:53:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717581216; x=1718186016; 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=vwK+1+pDlCF/OFWf6Ou/itSACndJT7zayavgx8PAKHY=; b=hD6ZHePSYt0j2VURVU+zESVTKBejMB7IG0Ff5P22j4n0vL25uug9kRCCxwKWvifYqn bADeQyfX3v5pKHUXKCgsANo3qA27YfnowLbiGo18gWbGc9CWC1mpsWm0ZWClp6z7tI4+ SQwcprW0zkOmmZEB9RtOlikO6CD4A4vbKaeud1IsQ1a7+ohEKOAKOZjD9qfzbeJmubQG R5O7yN7r6sQRGZO2J0MhtCmLIXHP+U//wLdl1MdgsNQ+nTuDs6FqGmAhi25UGNt0bSms jlRkfsMnsIr/b9rXXrYnz3GBRZ7C3baucuk5bNUyQzep0tAsnx3bdqUWW46sJ24e66vv KHSg== X-Forwarded-Encrypted: i=1; AJvYcCUGP2aLNmdSeuqjsTDetYVMK6gPD6eGh2mvMRjjK/Co6fe7b0YR/30ITQtRS6h/p6TkjQ8Oqbu6OCE8AV49BnMEMbP0 X-Gm-Message-State: AOJu0YzEjJT+o3fBVRM1fM7wGea8XNVvdRZrQuCPSserK1Aupn9bPSNg 4kjT4lBqgyHsYK4txIZD09nhsEarlyRR3ZCdFZeJsRhALtQLfPwJIbcIHr9pZoiPybH+ibZhaO+ t4qaUnbQNi0Mi7Lbr/Cuf2Bxa2NSAkXdu+SQYyYFl7RIgwmcHgg== X-Received: by 2002:ad4:58e6:0:b0:6b0:41e6:784c with SMTP id 6a1803df08f44-6b041e678cdmr9760126d6.38.1717581216121; Wed, 05 Jun 2024 02:53:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDvd4XE4QMt4H6AxBXkHA+qolbbGED2IDuHiV4e2RzYXRLJVE/rgafVXcuuZ09WzLwG+8YBw== X-Received: by 2002:ad4:58e6:0:b0:6b0:41e6:784c with SMTP id 6a1803df08f44-6b041e678cdmr9759976d6.38.1717581215584; Wed, 05 Jun 2024 02:53:35 -0700 (PDT) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ae4a750298sm46808616d6.70.2024.06.05.02.53.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jun 2024 02:53:35 -0700 (PDT) Date: Wed, 5 Jun 2024 11:53:00 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH v8] tcp: move seq_to_tap update to when frame is queued Message-ID: <20240605115247.4df1f27c@elisabeth> In-Reply-To: References: <20240604182908.1833186-1-jmaloy@redhat.com> <20240604233020.1edad3a9@elisabeth> 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: MD3JRIWR6XOV75JJG23GT2YTHFYXCDH2 X-Message-ID-Hash: MD3JRIWR6XOV75JJG23GT2YTHFYXCDH2 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: Jon Maloy , 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 Wed, 5 Jun 2024 09:59:58 +1000 David Gibson wrote: > On Tue, Jun 04, 2024 at 11:30:20PM +0200, Stefano Brivio wrote: > > On Tue, 4 Jun 2024 14:29:08 -0400 > > Jon Maloy wrote: > > > > > +/** > > > + * tcp_revert_seq() - Revert affected conn->seq_to_tap after failed transmission > > > + * @conns: Array of connection pointers corresponding to queued frames > > > + * @frames: Two-dimensional array containing queued frames with sub-iovs > > > + * @num_frames: Number of entries in the two arrays to be compared > > > + */ > > > +static void tcp_revert_seq(struct tcp_tap_conn **conns, struct iovec (*frames)[TCP_NUM_IOVS], > > > + int num_frames) > > > +{ > > > + int i; > > > + > > > + for (i = 0; i < num_frames; i++) { > > > + struct tcp_tap_conn *conn = conns[i]; > > > + struct tcphdr *th = frames[i][TCP_IOV_PAYLOAD].iov_base; > > > + uint32_t seq = ntohl(th->seq); > > > + > > > + if (SEQ_LE(conn->seq_to_tap, seq)) > > > + continue; > > > > See: > > https://archives.passt.top/passt-dev/Zkr_4LkjDImgFqSi@zatzit > > https://archives.passt.top/passt-dev/ZlkrBFkxliCCT3st@zatzit > > > > about this if (SEQ_LE) ... continue; > > As Jon mentioned in Monday's call, this looks weird in isolation but > makes sense after the change in the second patch. Ah, oops, sorry, you're right, I forgot about that. -- Stefano