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=gIr1dxaZ; 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 61D025A065B for ; Sun, 26 Apr 2026 15:45:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1777211120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NIqTm5eDrjUkgltxf9OIwqdpMfPmVtajg5/i5rW13aM=; b=gIr1dxaZ+Nt7Gd5NCVXH2IDThuLSZqyBurokhyqmtXQ0+L+egjv31Os580EZbLerwajgR3 Z3NWrZDm1g4XjMKhZ9znk2N9eeQDD5n8/k47kc/Ju/BEZGTte8cqqzei5HuMBPuqgHKU5l lhAdKfVDAmNJ16FXW+l6GyWWRmK8908= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-86-kiiO9qXuOom6bWfSQTcuUQ-1; Sun, 26 Apr 2026 09:45:17 -0400 X-MC-Unique: kiiO9qXuOom6bWfSQTcuUQ-1 X-Mimecast-MFC-AGG-ID: kiiO9qXuOom6bWfSQTcuUQ_1777211117 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-50fb3c7b989so101789731cf.0 for ; Sun, 26 Apr 2026 06:45:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777211116; x=1777815916; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NIqTm5eDrjUkgltxf9OIwqdpMfPmVtajg5/i5rW13aM=; b=oD8BugHIA+BtmRWG7ILURZqXztDXB2mVV1k9n2Hfwz+lwrA6R/e0cHNhI/LsXhr4VW nK7qddUAIPUlJrX3Jrk6quHiM3iAvRl7EAZnFplc+CQvcPwAXcOJPouZDPzvYV5uqqH+ LuOwHzXMjWuKYwDbYA4S4ir5iXMnvMu/g7xoID9Pc7wsuaErIJDsLi6xT4cIOb4sTcAZ DZiaI2nqQqHUUvMf9X5XJm+wJcd5GUXwc7fpfsSRnGS9qbHKODygqzq2NMBvC+vf/1RR BGReS8wr9MUBd2uBS9fEyiNzAV0Qtwzte+k73rsBdoT9CDKsPUYYbw6fll8FSVcCpV4q DkvQ== X-Gm-Message-State: AOJu0YyOxvO69AzlpITwKUT7Ifl2CN69w90wKAE+oVbPwwsuRkAjB2OB 8TcgCYiVWoNMT/tcf3gUx92zRQspXA/aScduLH8cLHVVqdgR0P77i5tn+BQpZKZt5vm7XIzFqTF dclhE2SW9uaTum9S4b4w1ez5MLEyYiG2jXSFq5CijVncF5+4PxAMVFauG/5a5HcqYRxSVMJe9Xy lt4rTZulFlBc0ANVrubvnHsHk7XvT8WdxWoZH0Zg== X-Gm-Gg: AeBDievJPQM0K3VOdGxRVAdZxEbyUMfRLODQCTFw0zGYwJqA4h33z87dqAjSNMYBh6U srjkuP89Nm6aAJDF7bANPjkEdCAN9FIuYGE0xWwW1So2pCvJbNu9tOs/Y6xnERS+ZR6frPaYXl+ jcUadu7WrCmghdcOtpXcp1rEYYFzCAmIDdhkwABuuYj2rFbMQreP3YY9kccRALGylx7J7Te7Drv U/5PGYryW+VxSh1excJ683E9rAM8eRRTAaIVvFK98HfCc6CvWyovAeXyaRwRCj13eZfe1xWEsp0 GTqBUd4bIqYnIaghB4FvkqXtXQX+nvzv2G65d6V+Jwe/L9Yzliga4Zw0ScUhTD4ADEbLyUHND+3 fuSQAjH1Jj5KPY26g4leIDsqrtN/1qEp/1dbFQkcBXv3hANL0yqCShrgY+1BRs8CwQ+PrbHF9Rr V33Z2vrZcC78ApJBK90SAhvJw= X-Received: by 2002:a05:622a:18a0:b0:50f:b1e6:a8f6 with SMTP id d75a77b69052e-50fb1e6b4d6mr334301351cf.26.1777211116441; Sun, 26 Apr 2026 06:45:16 -0700 (PDT) X-Received: by 2002:a05:622a:18a0:b0:50f:b1e6:a8f6 with SMTP id d75a77b69052e-50fb1e6b4d6mr334300091cf.26.1777211115528; Sun, 26 Apr 2026 06:45:15 -0700 (PDT) Received: from [192.168.2.15] (lnsm4-toronto63-142-116-28-118.internet.virginmobile.ca. [142.116.28.118]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-50e392e351esm233654281cf.7.2026.04.26.06.45.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 26 Apr 2026 06:45:15 -0700 (PDT) Message-ID: <6b108478-260d-4df6-abfd-cc66c279b693@redhat.com> Date: Sun, 26 Apr 2026 09:45:14 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 12/18] pesto: Expose list of pifs to pesto and optionally display To: passt-dev@passt.top, David Gibson , Stefano Brivio References: <20260421062516.2601204-1-david@gibson.dropbear.id.au> <20260421062516.2601204-13-david@gibson.dropbear.id.au> From: Jon Maloy In-Reply-To: <20260421062516.2601204-13-david@gibson.dropbear.id.au> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: N6wT4CqOEqNLw9nnKhn7kpJD9RyF6RYZcaMUroXz5DM_1777211117 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-MailFrom: jmaloy@redhat.com X-Mailman-Rule-Hits: emergency X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved Message-ID-Hash: QYTIL5NEQT4FA4I6CBXAVPRXBUOSBUKL X-Message-ID-Hash: QYTIL5NEQT4FA4I6CBXAVPRXBUOSBUKL X-Mailman-Approved-At: Mon, 27 Apr 2026 09:47:04 +0200 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 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. > + * @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. As fara as I can see this one is never used. If it is important that PIF_NONE is zero and PIF_HOST is 1, you could just do: enum pif_type { PIF_HOST = 1, PIF_TAP, PIF_SPLICE, PIF_NUM_TYPES, }; or #define PESTO_PIF_END 0 in pesto.h and leave this one as is. /jon [...] item) - (array) < ARRAY_SIZE(array); (item)++) >