public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>, passt-dev@passt.top
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH 0/1] RFC: IOV tail helpers
Date: Tue,  5 Nov 2024 13:32:21 +1100	[thread overview]
Message-ID: <20241105023222.698658-1-david@gibson.dropbear.id.au> (raw)

As mentioned here's my draft patch adding a helper to pull headers off
an IOV, checking for contiguity, alignment and so forth.  It's based
around the idea of an "iov tail", that is an iov from which you've
already consumed (in some sense) some data from the beginning.  It
uses an explicit offset to track this, so we don't have to copy an
entire iovec array in order to trim a bit off it.  But, it's built so
that if you pull enough off the front to remove some entire buffers,
it won't repeatedly have to step through them working out later
offsets.

It may be somewhat overengineered, let me know what you think of the
interface.

David Gibson (1):
  iov: iov tail helpers

 iov.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 iov.h | 24 +++++++++++++++++
 2 files changed, 107 insertions(+)

-- 
2.47.0


             reply	other threads:[~2024-11-05  2:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-05  2:32 David Gibson [this message]
2024-11-05  2:32 ` [PATCH 1/1] iov: iov tail helpers David Gibson
2024-11-06  0:56   ` Stefano Brivio
2024-11-06  2:38     ` David Gibson
2024-11-06 10:06       ` Stefano Brivio
2024-11-08  4:18         ` David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241105023222.698658-1-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).