From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 85F4D5A0307 for ; Wed, 05 Jun 2024 02:00:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1717545603; bh=9O1GnzdWNm4hFrUKFW1bGvvdPdxR0R2BeGE+yNrt9VE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LEclKof+JGLdtOWR/vJxR0yomaM8ZUw5RviBtOJCqgyc3t5tuHwY8RMwI1VtzA9Pp ew4nJ3Q/ZP+8T/GqLbnyLjhJazzjiMKG110X7RWBrMgkv5/YZlIwg26Ws4Ff/Iydga sgjFYqmnvaMpgsPHcgRf0LDz1z9Q9QB6OxFsWny0sL8KLftRf77fjrqG8JzPYIgi0P h29SkB3vGafcxSZTIMdV7kULps90c45riHIpeVEUSPo4vrnF3vvwLC+c6BYEAaIR7/ 4DnEt8hCG7jV/7kew2ekwSmnSZQRNThdc0D8jQ4VueDbN0taic7pvETK20lCzgYGGJ yZM/Bff3q4xuw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Vv6z753BJz4wcJ; Wed, 5 Jun 2024 10:00:03 +1000 (AEST) Date: Wed, 5 Jun 2024 09:59:58 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v8] tcp: move seq_to_tap update to when frame is queued Message-ID: References: <20240604182908.1833186-1-jmaloy@redhat.com> <20240604233020.1edad3a9@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EFTgOQg+WLkVZt8z" Content-Disposition: inline In-Reply-To: <20240604233020.1edad3a9@elisabeth> Message-ID-Hash: QBAMU5KZBVFNJDXTBKJIAIKH3XNNDF47 X-Message-ID-Hash: QBAMU5KZBVFNJDXTBKJIAIKH3XNNDF47 X-MailFrom: dgibson@gandalf.ozlabs.org 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: --EFTgOQg+WLkVZt8z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: >=20 > > +/** > > + * tcp_revert_seq() - Revert affected conn->seq_to_tap after failed tr= ansmission > > + * @conns: Array of connection pointers corresponding to queued = frames > > + * @frames: Two-dimensional array containing queued frames with s= ub-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 =3D 0; i < num_frames; i++) { > > + struct tcp_tap_conn *conn =3D conns[i]; > > + struct tcphdr *th =3D frames[i][TCP_IOV_PAYLOAD].iov_base; > > + uint32_t seq =3D ntohl(th->seq); > > + > > + if (SEQ_LE(conn->seq_to_tap, seq)) > > + continue; >=20 > See: > https://archives.passt.top/passt-dev/Zkr_4LkjDImgFqSi@zatzit > https://archives.passt.top/passt-dev/ZlkrBFkxliCCT3st@zatzit >=20 > 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. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --EFTgOQg+WLkVZt8z Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmZfqn0ACgkQzQJF27ox 2GdGtA/+K120w4z9JyTSPQYcrNv+SjxTQhNPylLqG22nlMLlXL71WaC7Zm3NMhcq UTq0ff5/YEaGJWCSwhHVjpr5yt2yi/bYmGUJTpnifvVZLF0R58gIS5f8i6xj4ABM EoCiTaVyJ8kUXjagAqZIHnjKYY7GBPQ3rTwyvW+mIuLWOz33jDzzJTluUWaEUMai RlZvHnyhOpoSIeDLZaZxDRcUazW5ZebU7uQ+2aKFnZQr6Pff5aw7FvoFMgNjqFeS l27HwHxEibKAI2dSxK5i39zxr92Lghk4qXsa7DCU8CwveiNTkVQQ2FKymXjVyj6L u43XWr+tInRN89oIcgRWIOlUiA9HEQiQNPtojvKp0L04pb36KpE/UeLOGidF3y2/ YnQOs5RQGdFOHaO2NFJCv98iwBm6cBEiv6IdKCDfxLDNMXpiHe+ffYn/cUPqKGVP 2KVtLS0izEQscPh2H3/cs6qylUcIe6oeR/PAvSCiGG7uqZ/XcFajQfwDD5ITvSff HZem2nO7wdVYp6csBASN1EKxEVs71Ia3YA7ZdXOU0PTwIs9zw5k4Zroo4p7VBVHy K45CxyOTQLh8GTf9fU7KSpA7gjAWrlezw0BuMO9IpqePgBZVpjsf0aoZxDWJUk58 HBkcCu0occEOdw47vzWko1ol5pONUvJZHKE0T675cC2LoK4Ehcc= =Yzmx -----END PGP SIGNATURE----- --EFTgOQg+WLkVZt8z--