From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=KvMwsZ0m; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 425385A061D for ; Sun, 03 May 2026 23:56:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1777845394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=upD4pFK83AHp5q1dtitaIHbzfyocU9WkUBWF+/ZNMig=; b=KvMwsZ0mxlk5R6fJGi+V22y2hwwmvQnKB3r0aW3ypViWMACqOY+zaUlr0STQl0zOn/9QPH ewtF/u7qTMO+tXCmbcbxfaxMff+JRWPtJqQvlcXpQHQ9FyB26ayPpT6MNGs61k5asUj32a DcXj3ep1yp3u2+Mbd4U213F4c8neOgU= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-580-8ZAYVB2gNkew7s84hQGY9Q-1; Sun, 03 May 2026 17:56:33 -0400 X-MC-Unique: 8ZAYVB2gNkew7s84hQGY9Q-1 X-Mimecast-MFC-AGG-ID: 8ZAYVB2gNkew7s84hQGY9Q_1777845392 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-488f973ddfeso23793395e9.3 for ; Sun, 03 May 2026 14:56:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777845392; x=1778450192; h=date:content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=upD4pFK83AHp5q1dtitaIHbzfyocU9WkUBWF+/ZNMig=; b=nwMwTbxqMRiv4Fz6SGzecaKMt1s1CEWUBh0ewWs/czgwRH/m4DV/ac8sebfMCdQiFR Gd6A9EIshmqeUQuLRNyv3yx1oEmka9N325MLBB3CszqAUOfZmtgGZLlUYr79ASInNMHY 3JHTM/5ICbwtk7Xezmse/GQKv/C+LaojxNRzs0UREPR/JoSK6je12iulv4YifIrfpkXF cOxhnNCIIZ/HihUsqYocuLJT3yGsLBTU3gX9G7bKxMBTY2RrFuOf0P5IVIAzYQyptmC4 vRWyjAWGdz+yG4PDFb00QhBToxvqoGV3yfss1DWvH4VplwiHCWFOqDpdjY78RV/pltOH W6qA== X-Forwarded-Encrypted: i=1; AFNElJ9lh5fVh0G81QAzahRnKfBVeL9rX77om1Jiw7gfoAmcdWX7DM5TLexIeSSqofK1aH5XxSjeOTn2lmg=@passt.top X-Gm-Message-State: AOJu0YzmE+BiLlZ1SRloAV9/Fss7oJI+OxNfrJ20bHoD0yEiAOo1u1Lx icEbln/+j7ruBkS9R1HNRr6uecEMrmMN7T9govC+cbadJUBVToRfCqn13uLOevrx9ReO9U5pn5b IyiK2/C2IoAWInLPxZK4aEora9XhXVwiikVGNil9+6pVhGv23FCPfUQ== X-Gm-Gg: AeBDievkrQMGYCG+TvblllvjMedymysWqZpLjOGvabGjPI3gDlCFCXeyNXoBv5NRV4F ALrZb0kdeoVqnKFeGRdsCuNEWGI2drFjq776P21xKWE4CjgbvWekR0slokwLCBM2/SVyROp0wA5 UHURW30X3lkFyYs1qp6Vd7jW9xdcSg/woTojV4VvWGj7/IjwQhCTn7Tg+3YUDumOzb+n4sHCC0+ Lhl57CWkdZxmWsUSHFmFYTLChAO12OwnLDbFDDz/A0WYa4AjxGq9qONcw1Z8KyJ5if6RFvnzw+1 tUDRrHGgFjAxXA8pMWgWjRMLmHbh88POeKU2CeZl5zDgDbFuCrVwPTTVMJp8C9JISKv6vI0UniV C8S3LxNL3Ju0O8uzsF2UdnoeWQputVPixqSmR2N6CGukeZ3QKQKXzqsmfqoij X-Received: by 2002:a05:600c:a40a:b0:485:3a03:ceca with SMTP id 5b1f17b1804b1-48d09ccf58fmr18209275e9.23.1777845391866; Sun, 03 May 2026 14:56:31 -0700 (PDT) X-Received: by 2002:a05:600c:a40a:b0:485:3a03:ceca with SMTP id 5b1f17b1804b1-48d09ccf58fmr18209045e9.23.1777845391383; Sun, 03 May 2026 14:56:31 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fea704asm64087775e9.11.2026.05.03.14.56.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 May 2026 14:56:27 -0700 (PDT) From: Stefano Brivio To: David Gibson Subject: Re: [PATCH v5 12/18] pesto: Expose list of pifs to pesto and optionally display Message-ID: <20260503235626.6d5ff978@elisabeth> In-Reply-To: References: <20260421062516.2601204-1-david@gibson.dropbear.id.au> <20260421062516.2601204-13-david@gibson.dropbear.id.au> <6b108478-260d-4df6-abfd-cc66c279b693@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Sun, 03 May 2026 23:56:27 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: vUYtXgFpU4H0vrMqad9GSlZe0dggFerUanos1PV_Sbg_1777845392 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 4WUZRJNQS4YADJKJL44HNQJHJZHKVBYG X-Message-ID-Hash: 4WUZRJNQS4YADJKJL44HNQJHJZHKVBYG X-MailFrom: sbrivio@redhat.com 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: Jon Maloy , passt-dev@passt.top, 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: On Wed, 29 Apr 2026 15:17:34 +1000 David Gibson wrote: > On Sun, Apr 26, 2026 at 09:45:14AM -0400, Jon Maloy wrote: > > > > > > On 2026-04-21 02:25, David Gibson wrote: > > > Extend the dynamic update protocol to expose the pif indices and names > > > from a running passt/pasta to the pesto tool. pesto records that data > > > and, if requested with a new --show flag, prints it out. > > > > > > Signed-off-by: David Gibson > > > --- > > > Makefile | 1 + > > > common.h | 2 + > > > conf.c | 41 ++++++++++++++++ > > > pesto.c | 132 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > > > pesto.h | 19 +++++++- > > > pif.h | 4 +- > > > serialise.c | 4 ++ > > > serialise.h | 1 + > > > util.h | 2 - > > > 9 files changed, 200 insertions(+), 6 deletions(-) > > > > > > > [...] > > > > > diff --git a/pesto.h b/pesto.h > > > index 92d4df3a..ac4c2b58 100644 > > > --- a/pesto.h > > > +++ b/pesto.h > > > @@ -17,18 +17,33 @@ > > > /* Version 0 is reserved for unreleased / unsupported experimental versions */ > > > #define PESTO_PROTOCOL_VERSION 0 > > > +/* Maxmimum size of a pif name, including \0 */ > > > +#define PIF_NAME_SIZE (128) > > > +#define PIF_NONE 0 > > > + > > > /** > > > * struct pesto_hello - Server introduction message > > > - * @magic: PESTO_SERVER_MAGIC > > > - * @version: Version number > > > + * @magic: PESTO_SERVER_MAGIC > > > + * @version: Version number > > > + * @pif_name_size: Server's value for PIF_NAME_SIZE > > > */ > > > struct pesto_hello { > > > char magic[8]; > > > uint32_t version; > > > + uint32_t pif_name_size; > > > } __attribute__ ((__packed__)); > > > static_assert(sizeof(PESTO_SERVER_MAGIC) > > > == sizeof(((struct pesto_hello *)0)->magic), > > > "PESTO_SERVER_MAGIC has wrong size"); > > > +/** > > > + * struct pesto_pif_info - Message with basic metadata about a pif > > > + * @resv_: Alignment gap (must be 0) > > > > You forgot to remove this one. > > Oops, yes. Fixed in v6. > > > + * @name: Name (\0 terminated) > > > + */ > > > +struct pesto_pif_info { > > > + char name[PIF_NAME_SIZE]; > > > +} __attribute__ ((__packed__)); > > > + > > > #endif /* PESTO_H */ > > > diff --git a/pif.h b/pif.h > > > index 90dd3a32..d7708603 100644 > > > --- a/pif.h > > > +++ b/pif.h > > > @@ -11,6 +11,7 @@ > > > #include > > > +#include "pesto.h" > > > #include "epoll_type.h" > > > union inany_addr; > > > @@ -24,7 +25,7 @@ union sockaddr_inany; > > > */ > > > enum pif_type { > > > /* Invalid or not present pif */ > > > - PIF_NONE = 0, > > > + PIF_NONE_ = PIF_NONE, > > > > This looks a bit weird. > > Yes, but it seemed less weird that the other approaches I could think > of to do what I needed. The key point here is that the specific value > of PIF_NONE is locked as part of the configuration protocol. The > values of all other pif indices are (intentionally) passt internal and > should not be known by the client. > > > As fara as I can see this one is never used. > > Yes, that's correct. > > > If it is important that PIF_NONE is zero and PIF_HOST is 1, > > It's important that PIF_NONE is zero. It's not important that > PIF_HOST is 1. > > > you could just do: > > > > enum pif_type { > > > > PIF_HOST = 1, > > > > PIF_TAP, > > PIF_SPLICE, > > > > PIF_NUM_TYPES, > > }; > > I could, but I think this makes the connection between the public > PIF_NONE and the private PIF_* less obvious. > > > > > or > > #define PESTO_PIF_END 0 > > in pesto.h > > and leave this one as is. > > I could - indeed an earlier draft did essentially this. Hoewver, that > wouldn't enforce that PIF_NONE is equal to the terminator value, which > it should be. Left as it was in v6. -- Stefano