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 3FA9C5A0268 for ; Thu, 5 Jan 2023 06:45:48 +0100 (CET) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Nnb6Z15f3z4y0Q; Thu, 5 Jan 2023 16:45:42 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1672897542; bh=uIbYlg3mYtGh/LXeun65lCqHsZVjwChdhzhMzkeERD8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=e3OerN/Mv/2hPRCW358YYWLp6ieMcVeBvIGc/IP6MTvFWIQXSACCdLm/g7UZ+Wzul WmsIuVnhIODYFC2VIKYQrVnFLitYg9MXhH3QdigJEpdjLe5N/p0X8zDjJ3BpLmrjQ6 a3nZL8mRossC70bnMyUPalJxf6wu4nF4psP4clME= Date: Thu, 5 Jan 2023 15:47:37 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v2 01/18] pcap: Introduce pcap_frame() helper Message-ID: References: <20221209054228.4085990-1-david@gibson.dropbear.id.au> <20221209054228.4085990-2-david@gibson.dropbear.id.au> <20230104184503.2d7d0966@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3eFIbU3JzozFn1MZ" Content-Disposition: inline In-Reply-To: <20230104184503.2d7d0966@elisabeth> Message-ID-Hash: IBFWFQLDSFTVG4TZQSMQKLEVWQZ32EJL X-Message-ID-Hash: IBFWFQLDSFTVG4TZQSMQKLEVWQZ32EJL 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.3 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: --3eFIbU3JzozFn1MZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 04, 2023 at 06:45:03PM +0100, Stefano Brivio wrote: > On Fri, 9 Dec 2022 16:42:11 +1100 > David Gibson wrote: >=20 > > pcap(), pcapm() and pcapmm() duplicate some code, for the actual writing > > to the capture file. The main purpose pf pcapm() and pcampp() not call= ing > > pcap seems to be to avoid repeatedly calling gettimeofday(). We can > > accomplish that while still sharing code by adding a new helper which > > takes the packet timestamp as a parameter. >=20 > Another purpose is to avoid logging errors for single messages in > batches -- if something goes wrong with the log file, it gets noisy to > the point of making passt unusable during throughput tests. >=20 > Sure, it's quite unlikely to happen during normal operation -- still, > should you re-spin, pcap_frame() could return errors and callers could > abort early in case. Good point, adjusted. --=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 --3eFIbU3JzozFn1MZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoULxWu4/Ws0dB+XtgypY4gEwYSIFAmO2VmIACgkQgypY4gEw YSKWvQ/+NG6Tzacvoi1iYDoBpSVikKWSyC01CrlY6BAN1d43RMl5ELgiWRoqlSdC v9uCJSBcdrMKcIokH8a5M6E6/rn58emt36NpbXuj5UqPlf2rdN8gklKYPPovDD8r o1XeLfaY+wAc2xHypYuyNXNg4cWr5J8HqjPl12FDI3n3TdGRizK+e80ZsnAdGUcT yGcuSJ+z1GRsTZVzJk1SpW19G2Nx6nC22morSfSV/rCTOsphCRv/Al7UdD0I7rvA pDXvPorxRh5vgc1LxDpDXjiinn/qJlNVjuNN49JkG9jYc3KUb2JI4tNtCfpx/zHF Oq5G27trvY1VW6tCXQDmmJ0oUC3pYT1yWTQheEEAMaz0M7LbZCJOLrH52kri0oYm FNMGUIEWTraZy3hted0kGwdLK1voIQTyfJ95exf3GmvBjWMKaft6aEyrdlPyw1A/ NpZmfm2wFePStQjxto5ihMpl1lFLBbQXg0cn9Gb3UmS+x9buGGhD+4IeEqSJJLH6 +v058Mogk+wb5vQLXHayPJ4RemBek6epWtIufUdAmAzHG2Ll0M1xpM7pANhnW5Yp XW/GDc7YHGD5Yzawl7+WZHiIcH5pQXvvonHXSlCjp00FqKz5e0QV8txOaZlzroRJ XGJO5EzI6CEmt7cTeFI0HWEDZG8JTbcOfKYL0rWvikQ6BjlOdok= =SiCc -----END PGP SIGNATURE----- --3eFIbU3JzozFn1MZ--