From: Stefano Brivio <sbrivio@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>
Cc: passt-dev@passt.top
Subject: Re: [PATCH v2 2/8] pcap: add pcap_iov()
Date: Fri, 16 Feb 2024 06:30:07 +0100 [thread overview]
Message-ID: <20240216063007.0bb68ed9@elisabeth> (raw)
In-Reply-To: <20240214085628.210783-3-lvivier@redhat.com>
On Wed, 14 Feb 2024 09:56:22 +0100
Laurent Vivier <lvivier@redhat.com> wrote:
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>
> Notes:
> v2:
> - introduce pcap_header(), a common helper to write
> packet header
> - use writev() rather than write() in a loop
> - add functions comment
>
> pcap.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
> pcap.h | 1 +
> 2 files changed, 55 insertions(+), 7 deletions(-)
>
> diff --git a/pcap.c b/pcap.c
> index 501d52d4992b..3869a403dd0f 100644
> --- a/pcap.c
> +++ b/pcap.c
> @@ -20,6 +20,7 @@
> #include <sys/time.h>
> #include <sys/types.h>
> #include <sys/stat.h>
> +#include <sys/uio.h>
> #include <fcntl.h>
> #include <time.h>
> #include <errno.h>
> @@ -31,6 +32,7 @@
> #include "util.h"
> #include "passt.h"
> #include "log.h"
> +#include "iov.h"
>
> #define PCAP_VERSION_MINOR 4
>
> @@ -65,6 +67,28 @@ struct pcap_pkthdr {
> uint32_t len;
> };
>
> +/*
> + * pcap_header - Write a pcap packet header to the pcap file descriptor (pcap_fd).
Nit: pcap_header(). And "(pcap_fd)" doesn't seem to be a valid
reference (anymore?).
> + *
> + * @len: Length of the packet data.
> + * @tv: Pointer to a timeval struct containing the timestamp for the packet.
> + *
> + * Returns; -1 in case of error, otherwise, 0 to indicate success.
"Return: -1" ...I know, it's wrong in pcap_frame().
--
Stefano
next prev parent reply other threads:[~2024-02-16 5:30 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
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 [this message]
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=20240216063007.0bb68ed9@elisabeth \
--to=sbrivio@redhat.com \
--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).