While working on other stuff I stumbled across some patches I wrote quite a while back (part of a larger series on indefinite hiatus). These make it easier to use the pcap and tap functions with frames that aren't in a single contiguous buffer. This overlaps with some of the work in Laurent's vhost-user series, so I've included the first of his patches and integrated it with my changes. There will The first two patches have some overlap with the preliminary iovec patches in the vhost-user series (and will certainly conflict). I do think the pcap interface here is slightly better than the one in the vhost-user series, although I did ack that. Stefano, if you've already applied / run tests for Laurent's series then go ahead with it; I'll rework this on top of those. Changes since v1: * Stefano correctly pointed out that my iov_offset() function was unclear in its naming and description. Rename it to iov_skip_bytes() and change the wording around it to improve this. * Incorporate Laurent's iov helper patch, and also use iov_skip_bytes() to slightly simplify its functions. * Fix commit message for write_remainder() so that it correctly describes handling "short writes", not "sort writes", whatever that might mean. * Adjust parameter names and descriptions for pcap_multiple() for clarity. David Gibson (6): iov: Add helper to find skip over first n bytes of an io vector pcap: Update pcap_frame() to take an iovec and offset util: Add write_remainder() helper pcap: Handle short writes in pcap_frame() pcap: Allow pcap_frame() and pcap_multiple() to take multi-buffer frames tap: Use write_remainder() in tap_send_frames_passt() Laurent Vivier (1): iov: add some functions to manage iovec Makefile | 8 +-- iov.c | 198 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ iov.h | 31 +++++++++ pcap.c | 56 ++++++++-------- pcap.h | 3 +- tap.c | 41 +++--------- util.c | 33 ++++++++++ util.h | 1 + 8 files changed, 307 insertions(+), 64 deletions(-) create mode 100644 iov.c create mode 100644 iov.h -- 2.43.2