From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202410 header.b=iUIzKBi8; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id A41B55A061B for ; Tue, 05 Nov 2024 03:32:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202410; t=1730773941; bh=Askzv7nBjigh2mF8XG+dEwE0Ut9TfCUFSzgrc+9dDK4=; h=From:To:Cc:Subject:Date:From; b=iUIzKBi8iBNVRgIuGfItqxCVDqnnGO8C5FH9vkYcliwbmoiU2wqUuEpMtMJ/B4yVH VeSdzKg+iMoA2LHLGe20ooYkNtqxL3Iq7znFqoqv4ZVyHYl6oMyvbHCMJoTaxWu83H fEd3e5afkDbleKycSAkvkelFFjC6oilF5Ked3gPZnDNrMVdwhZxdRIwGJ/PtpRItX/ 7MzJe9+Wvn668OJKfL8h6eviROXzpQIPOc0tE7Hggh8f1DBz5DkO/0cqrvplO6mX/5 uhS/usuIf2AL3aLY4Lnz30JzV3U9WJcZ4sWTa9DflmYroP4pLHGdvB4iqouWyX6uvZ 1tk2CKwiG9nVw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4XjC6F6kFGz4x33; Tue, 5 Nov 2024 13:32:21 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH 0/1] RFC: IOV tail helpers Date: Tue, 5 Nov 2024 13:32:21 +1100 Message-ID: <20241105023222.698658-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.47.0 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: QC42H4GWKT3HU27I4C7Y7R355LZZBISX X-Message-ID-Hash: QC42H4GWKT3HU27I4C7Y7R355LZZBISX 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: David Gibson 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: 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