From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id DC9E35A0272 for ; Fri, 8 Mar 2024 02:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1709860635; bh=aZCdPrWDP7uifA76ngSTQy/3yokuxa6wsq7oGAlUFoU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mfNGx0vV3uF112jX/IippcdTTWqZ1+ppLELKAjGJ6spYIhyYD6Mj/B1Zx89ZUSOOM Nd6L1ibZDPu4z8YBhtxEQ8Dfn7A2AvMTgZpnMnd2ZQ/lNgg44iT1V4fUjXsDbx8VQl O2WtdecNkWmsAQBRAfiNOp0m5gZc2R59/hCNotu0InFw1bCZy+V4f9TwBjG6Q1YkLU qBgdCNKRnXYuPDcOqBDgjKKWNN13DcMFsc+2l34r/UBYLIzeoR8yUaArlbUnXZY9yf w15UMLf0SNZw7VKamU90V29CLbDOsJAttitDHlJCsJIIsn4WeZzAhdkk09dEO3Ws06 pEfh4aBkR7C0g== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4TrSvH4J1kz4wcT; Fri, 8 Mar 2024 12:17:15 +1100 (AEDT) Date: Fri, 8 Mar 2024 12:04:09 +1100 From: David Gibson To: Laurent Vivier Subject: Re: [PATCH] tap: Capture only packets that are actually sent Message-ID: References: <20240307112602.1279441-1-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LtwfCeKQFrOs2MXR" Content-Disposition: inline In-Reply-To: <20240307112602.1279441-1-lvivier@redhat.com> Message-ID-Hash: T73QB7KON7ZUKZNPDXSZJ5QLTKBFVW7O X-Message-ID-Hash: T73QB7KON7ZUKZNPDXSZJ5QLTKBFVW7O 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: 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: --LtwfCeKQFrOs2MXR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 07, 2024 at 12:26:02PM +0100, Laurent Vivier wrote: > In tap_send_frames(), if we failed to send all the frames, we must > only log the frames that have been sent, not all the frames we wanted > to send. >=20 > Fixes: dda7945ca9c9 ("pcap: Handle short writes in pcap_frame()") > Cc: david@gibson.dropbear.id.au > Signed-off-by: Laurent Vivier > --- >=20 > Notes: > David, I don't understand why you changed the 'm' by an 'n' in your > commit. Huh.. I'm not sure either. I can think of three possibilities: 1) I just made a typo 2) I was thinking of frames lost to write errors as being lost "on the wire", so should be still captured as "sent" on this side. But that's silly - excluding these is going to be more useful for debug in nearly every case. 3) The original version of this patch might have predated b62ed9ca0 "tap: Don't pcap frames that didn't get sent". In which case I may have just missed this subtlety when rebasing. In any case, this is a good change so, Reviewed-by: David Gibson > tap.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/tap.c b/tap.c > index c7b9372668ec..f4051cecab84 100644 > --- a/tap.c > +++ b/tap.c > @@ -413,7 +413,7 @@ size_t tap_send_frames(const struct ctx *c, const str= uct iovec *iov, size_t n) > if (m < n) > debug("tap: failed to send %zu frames of %zu", n - m, n); > =20 > - pcap_multiple(iov, 1, n, c->mode =3D=3D MODE_PASST ? sizeof(uint32_t) := 0); > + pcap_multiple(iov, 1, m, c->mode =3D=3D MODE_PASST ? sizeof(uint32_t) := 0); > =20 > return m; > } --=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 --LtwfCeKQFrOs2MXR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmXqZAgACgkQzQJF27ox 2GdnMg//bKrENkUuKqXUrxELeTRIS4mSCPwqls9/yX+GiiXgcVf3IsttDD+h9+qY UZvdnxCoXPBcVvoS62QvUHx6s+1GeZLaKGbPasaH7fZGDqQKAvVqIWdVQ3YmdtYa aqgY2MxeyUIcziN71iqlQhhMF0EDZD1bikqyaTygTrABHcqHNcHsRvxOpskMyH6w RrmOiT/JLoo1uZZW9XbqbiNj7hCZoRpAhmr/ayMTGCAlhR4zhAAmDdNkMSOH8T/R M39iViODDxigiXGD32mqIlOXn9+wXfl27BhSS9v0O7Qpvo4u+jNKt86+FbxPCH9z Da28zFxckk3H3CR1KxgJ+EmilAKvgnC81NlsL3K8EScQ1zS3KWsPBI0FUvvoSDgs Cvw++wT59B1fWxF5xKlX6PaaWML0GY2KBl2D+Sca2faWGCbnutc0ROsTM6CW8WSi r21ZJdurla4rmcp5QryMQXEjcvqTpqBacZhCbIQ0qz1HpXzIDOJNy3E0DP4TxrWI ENg3aYW/XPBoEyRgY2lDMzBJuJrdGBPdJc/sg4l+qaNjziV2JfFKYuqEfG8EmtJR x/JfKiL/2ycRpiPoPNdaep3dEdSpYrtzM+qj/4mwfe84rX/jVuobIrB7hnYalrlE 7nBSWfwOJAI+WVD/uUINqx799i+BDDRiGpAP03q1npC28RFAC9w= =j9Fd -----END PGP SIGNATURE----- --LtwfCeKQFrOs2MXR--