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: > > > pcap(), pcapm() and pcapmm() duplicate some code, for the actual writing > > to the capture file. The main purpose pf pcapm() and pcampp() not calling > > 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. > > 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. > > 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. -- 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