public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Laurent Vivier <lvivier@redhat.com>
Cc: passt-dev@passt.top
Subject: Re: [PATCH v2 1/8] iov: add some functions to manage iovec
Date: Thu, 15 Feb 2024 11:32:58 +1100	[thread overview]
Message-ID: <Zc1but422Ovz49zG@zatzit> (raw)
In-Reply-To: <Zc1ZxhbringqXN5l@zatzit>

[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]

On Thu, Feb 15, 2024 at 11:24:38AM +1100, David Gibson wrote:
> On Wed, Feb 14, 2024 at 09:56:21AM +0100, Laurent Vivier wrote:
> > Introduce functions to copy to/from a buffer from/to an iovec array,
> > to compute data length in in bytes of an iovec and to copy memory from
> > an iovec to another.
> > 
> > iov_from_buf(), iov_to_buf(), iov_size(), iov_copy().
> > 
> > Signed-off-by: Laurent Vivier <lvivier@redhat.com>

[snip]
> > +size_t iov_from_buf(const struct iovec *iov, unsigned int iov_cnt,
> > +		    size_t offset, const void *buf, size_t bytes)

One other thing I didn't think of on my first reply: although it
probably doesn't matter in practice, struct msghdr uses a size_t for
the length of the vector.  So, I think it makes sense for us to
standardise on that too.  To confuse matters, writev() uses a (signed)
int, but we work with recvmsg() etc. more than we do with writev() so
I think size_t is a better choice.

-- 
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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-02-15  0:40 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-14  8:56 [PATCH v2 0/8] Add vhost-user support to passt (part 1) Laurent Vivier
2024-02-14  8:56 ` [PATCH v2 1/8] iov: add some functions to manage iovec Laurent Vivier
2024-02-15  0:24   ` David Gibson
2024-02-15  0:32     ` David Gibson [this message]
2024-02-16  5:29     ` Stefano Brivio
2024-02-14  8:56 ` [PATCH v2 2/8] pcap: add pcap_iov() Laurent Vivier
2024-02-15  0:35   ` David Gibson
2024-02-16  5:30   ` Stefano Brivio
2024-02-14  8:56 ` [PATCH v2 3/8] checksum: align buffers Laurent Vivier
2024-02-15  0:40   ` David Gibson
2024-02-14  8:56 ` [PATCH v2 4/8] checksum: add csum_iov() Laurent Vivier
2024-02-15  0:44   ` David Gibson
2024-02-14  8:56 ` [PATCH v2 5/8] util: move IP stuff from util.[ch] to ip.[ch] Laurent Vivier
2024-02-15  2:29   ` David Gibson
2024-02-14  8:56 ` [PATCH v2 6/8] checksum: use csum_ip4_header() in udp.c and tcp.c Laurent Vivier
2024-02-15  2:51   ` David Gibson
2024-02-16  9:08   ` Stefano Brivio
2024-02-16 14:17     ` Laurent Vivier
2024-02-16 14:54       ` Stefano Brivio
2024-02-16 18:05         ` Laurent Vivier
2024-02-16 18:24           ` Stefano Brivio
2024-02-17 14:22             ` Laurent Vivier
2024-02-17 14:37               ` Stefano Brivio
2024-02-19  2:06               ` David Gibson
2024-02-14  8:56 ` [PATCH v2 7/8] checksum: introduce functions to compute the header part checksum for TCP/UDP Laurent Vivier
2024-02-15  3:12   ` David Gibson
2024-02-14  8:56 ` [PATCH v2 8/8] tap: make tap_update_mac() generic Laurent Vivier
2024-02-15  3:13   ` 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=Zc1but422Ovz49zG@zatzit \
    --to=david@gibson.dropbear.id.au \
    --cc=lvivier@redhat.com \
    --cc=passt-dev@passt.top \
    /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).