From: Stefano Brivio <sbrivio@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>
Cc: passt-dev@passt.top, Jon Maloy <jmaloy@redhat.com>,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH v6 12/18] ip: Prepare ip.[ch] for sharing with pesto tool
Date: Tue, 05 May 2026 01:10:59 +0200 (CEST) [thread overview]
Message-ID: <20260505011058.4a379100@elisabeth> (raw)
In-Reply-To: <a9a12ac3-7b38-4995-a179-689f953ac484@redhat.com>
On Mon, 4 May 2026 16:52:47 +0200
Laurent Vivier <lvivier@redhat.com> wrote:
> On 5/3/26 23:55, Stefano Brivio wrote:
> > From: David Gibson <david@gibson.dropbear.id.au>
> >
> > Most things in ip.[ch] related purely to IP addresses and headers with
> > no dependency on other passt/pasta internals. A number of these will be
> > useful to re-use in pesto. The exception is ipv6_l4hdr() which uses
> > iov_tail.
> >
> > The only caller of this is in tap.c, so move the function there. Along
> > with moving the constant byteswapping functions to common.h, that lets
> > ip.[ch] to be linked into pesto as well as passt/pasta.
> >
> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> > Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
>
> Reviewed-by: Laurent Vivier <lvivier@redhat.com>
>
> But we can fix a pre-existing error while doing the move, see below:
>
> > ---
> > common.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
> > inany.h | 2 ++
> > ip.c | 56 +++-----------------------------------------------------
> > ip.h | 4 +---
> > tap.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> > util.h | 48 ------------------------------------------------
> > 6 files changed, 106 insertions(+), 104 deletions(-)
> >
> > diff --git a/common.h b/common.h
> > index 45f66ea..4a167ae 100644
> > --- a/common.h
> > +++ b/common.h
> > @@ -55,4 +55,52 @@ static inline const char *strerror_(int errnum)
> >
> > #define ARRAY_SIZE(a) ((int)(sizeof(a) / sizeof((a)[0])))
> >
> > +#ifndef __bswap_constant_16
> > +#define __bswap_constant_16(x) \
> > + ((uint16_t) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))
> > +#endif
> > +
> > +#ifndef __bswap_constant_32
> > +#define __bswap_constant_32(x) \
> > + ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
> > + (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
> > +#endif
> > +
> > +#ifndef __bswap_constant_32
> > +#define __bswap_constant_32(x) \
> > + ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
> > + (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
> > +#endif
>
> __bswap_constant_32 block is written twice.
Fixed in v7.
--
Stefano
next prev parent reply other threads:[~2026-05-04 23:11 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-03 21:55 [PATCH v6 00/18] Dynamic configuration update implementation Stefano Brivio
2026-05-03 21:55 ` [PATCH v6 01/18] conf, fwd: Stricter rule checking in fwd_rule_add() Stefano Brivio
2026-05-04 8:38 ` Laurent Vivier
2026-05-03 21:55 ` [PATCH v6 02/18] fwd_rule: Move ephemeral port probing to fwd_rule.c Stefano Brivio
2026-05-03 21:55 ` [PATCH v6 03/18] fwd, conf: Move rule parsing code to fwd_rule.[ch] Stefano Brivio
2026-05-03 21:55 ` [PATCH v6 04/18] fwd_rule: Move conflict checking back within fwd_rule_add() Stefano Brivio
2026-05-03 21:55 ` [PATCH v6 05/18] fwd: Generalise fwd_rules_info() Stefano Brivio
2026-05-03 21:55 ` [PATCH v6 06/18] pif: Limit pif names to 128 bytes Stefano Brivio
2026-05-04 9:12 ` Laurent Vivier
2026-05-04 23:10 ` Stefano Brivio
2026-05-03 21:55 ` [PATCH v6 07/18] fwd_rule: Fix some format specifiers Stefano Brivio
2026-05-04 9:59 ` Laurent Vivier
2026-05-03 21:55 ` [PATCH v6 08/18] pesto: Introduce stub configuration tool Stefano Brivio
2026-05-04 10:51 ` Laurent Vivier
2026-05-04 23:10 ` Stefano Brivio
2026-05-03 21:55 ` [PATCH v6 09/18] pesto, log: Share log.h (but not log.c) with pesto tool Stefano Brivio
2026-05-04 9:49 ` Laurent Vivier
2026-05-04 23:11 ` Stefano Brivio
2026-05-03 21:55 ` [PATCH v6 10/18] pesto, conf: Have pesto connect to passt and check versions Stefano Brivio
2026-05-04 12:01 ` Laurent Vivier
2026-05-04 12:13 ` Laurent Vivier
2026-05-03 21:55 ` [PATCH v6 11/18] pesto: Expose list of pifs to pesto and optionally display Stefano Brivio
2026-05-04 14:34 ` Laurent Vivier
2026-05-04 23:10 ` Stefano Brivio
2026-05-03 21:55 ` [PATCH v6 12/18] ip: Prepare ip.[ch] for sharing with pesto tool Stefano Brivio
2026-05-04 14:52 ` Laurent Vivier
2026-05-04 23:10 ` Stefano Brivio [this message]
2026-05-03 21:55 ` [PATCH v6 13/18] inany: Prepare inany.[ch] " Stefano Brivio
2026-05-04 15:37 ` Laurent Vivier
2026-05-03 21:55 ` [PATCH v6 14/18] pesto: Read current ruleset from passt/pasta and optionally display it Stefano Brivio
2026-05-04 16:10 ` Laurent Vivier
2026-05-04 23:11 ` Stefano Brivio
2026-05-03 21:55 ` [PATCH v6 15/18] pesto: Parse and add new rules from command line Stefano Brivio
2026-05-04 16:44 ` Laurent Vivier
2026-05-04 23:11 ` Stefano Brivio
2026-05-04 23:18 ` Stefano Brivio
2026-05-03 21:55 ` [PATCH v6 16/18] pesto, conf: Send updated rules from pesto back to passt/pasta Stefano Brivio
2026-05-03 21:56 ` [PATCH v6 17/18] conf, fwd: Allow switching to new rules received from pesto Stefano Brivio
2026-05-03 21:56 ` [PATCH v6 18/18] fwd_rule: Fix static checkers warnings in fwd_rule_add() Stefano Brivio
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=20260505011058.4a379100@elisabeth \
--to=sbrivio@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=jmaloy@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).