From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id C54955A027F for ; Fri, 1 Dec 2023 01:08:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1701389330; bh=2z9I/H3H1hNvyWwHuMQXbIROjshu8zxBg1TAXRrMxGM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nZLWKRcklYKnWB63hBTbfqOJrZH1NW7oC7Of9ojSc1/zLKt5MeWgGCQ5XCNgJwOdB Yb/IcF19aM2o5H0RTKQg1+ZB0/lxujoL3wNseTAW6dl1uDONanygeJiBSMwidJ4jmq YfyzuLZ1ly5MEvPGk5bJm14TUkCvqE5w33qhcqUI= Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4ShD1Z1kWZz4xNH; Fri, 1 Dec 2023 11:08:50 +1100 (AEDT) Date: Fri, 1 Dec 2023 11:08:46 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v3 14/16] pif: Add helpers to get the name of a pif Message-ID: References: <20231130020222.4056647-1-david@gibson.dropbear.id.au> <20231130020222.4056647-15-david@gibson.dropbear.id.au> <20231130134525.141020ef@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="CV00J0ta01bYVQF0" Content-Disposition: inline In-Reply-To: <20231130134525.141020ef@elisabeth> Message-ID-Hash: FKNPS5RXIM6ITZKMFVFP7OC6ATJ77RD2 X-Message-ID-Hash: FKNPS5RXIM6ITZKMFVFP7OC6ATJ77RD2 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: passt-dev@passt.top 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: --CV00J0ta01bYVQF0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 30, 2023 at 01:45:25PM +0100, Stefano Brivio wrote: > On Thu, 30 Nov 2023 13:02:20 +1100 > David Gibson wrote: >=20 > > Future debugging will want to identify a specific passt interface. We = make > > a distinction in these helpers between the name of the *type* of pif, a= nd > > name of the pif itself. For the time being these are always the same > > thing, since we have at most instance of each type of pif. However, th= at > > might change in future. > >=20 > > Signed-off-by: David Gibson > > --- > > Makefile | 3 ++- > > pif.c | 21 +++++++++++++++++++++ > > pif.h | 19 +++++++++++++++++++ > > 3 files changed, 42 insertions(+), 1 deletion(-) > > create mode 100644 pif.c > >=20 > > diff --git a/Makefile b/Makefile > > index d14b029..af4fa87 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -46,7 +46,8 @@ FLAGS +=3D -DDUAL_STACK_SOCKETS=3D$(DUAL_STACK_SOCKET= S) > > =20 > > PASST_SRCS =3D arch.c arp.c checksum.c conf.c dhcp.c dhcpv6.c flow.c i= cmp.c \ > > igmp.c isolation.c lineread.c log.c mld.c ndp.c netlink.c packet.c \ > > - passt.c pasta.c pcap.c port_fwd.c tap.c tcp.c tcp_splice.c udp.c util= =2Ec > > + passt.c pasta.c pcap.c pif.c port_fwd.c tap.c tcp.c tcp_splice.c udp.= c \ > > + util.c > > QRAP_SRCS =3D qrap.c > > SRCS =3D $(PASST_SRCS) $(QRAP_SRCS) > > =20 > > diff --git a/pif.c b/pif.c > > new file mode 100644 > > index 0000000..ebf01cc > > --- /dev/null > > +++ b/pif.c > > @@ -0,0 +1,21 @@ > > +/* SPDX-License-Identifier: GPL-2.0-or-later > > + * Copyright Red Hat > > + * Author: David Gibson > > + * > > + * Passt/pasta interface types and IDs > > + */ > > + > > +#include > > +#include > > + > > +#include "util.h" > > +#include "pif.h" > > + > > +const char *pif_type_str[] =3D { > > + [PIF_NONE] =3D "", > > + [PIF_HOST] =3D "HOST", > > + [PIF_TAP] =3D "TAP", > > + [PIF_SPLICE] =3D "SPLICE", >=20 > Nit, not worth respinning in my opinion: those are just English > nouns, not acronyms, so they could simply be printed as "host", "tap", > and "splice". I'd been thinking of pif names in caps to make them stand out from other things, but it doesn't really matter that much. --=20 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 --CV00J0ta01bYVQF0 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmVpJA0ACgkQzQJF27ox 2GcWqBAAo0wpA3mcAniUnw+pDChtiNqCl2IywS1tfMcdx6NAlLyxpxnk5vhq1K3Z N/cdkMF5kfxJjSMbGNB5nX0tAoeYBHgv0rG5c/2/H7I2CFqHMeUURZsWMJYT5xRq E2TPri91f+Z+ZF3rYhhVCkoFdaEIwX415+1Wa65b7XaUavXvsBhurmnI5fSlFgDM GoOLZlPhuYmoyNNnapDvbxL2RbDselV8Tn+m+i5ZsAv7Esbzv0q35g7+klah/sUn 6HYuFWbey7uzbXa75aIKSpl+Ew4I7mUmxP+pVQ4J6qxVy+5z2hAbmJbY35hGzBmH eD0cBLXmVPvGc2QpI24F5GCnVm5cbnM/eZbsALB0KGEXfd3OVfTje/lY8KJ5Kdm/ +hZYJ0mV0DiqUPKKC0i23BCX5SlKHr1ekxM3AHLCnMabnFzWtYyGSq5yt82TYKkS yJQ8gYRRTbZF8lWmZzVi25ud64qzq+lQj+OhpYYC79Hz+bfPyy+eURGSIKP+lE6a 8KkOlnMH3r96s6KcP4SEEoMh5bB6xi99RA6IOGwOsGxR71lRo8IDUxQO61/utjhr +i011gXkiBlb4xWvxn6Ddul77ufTK4dHasixvrRkXvCVOmL3UsgtmJMjMD12hA+L xRbCQFp0H5Y6GPg3XTwaKdplDfJ1ktYHRdO9UGpHfq9K7pONbE8= =2485 -----END PGP SIGNATURE----- --CV00J0ta01bYVQF0--