From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=fail (p=none dis=none) header.from=gmail.com Received: from [10.157.41.19] (unknown [105.199.60.18]) by passt.top (Postfix) with ESMTP id 8B0345A0265 for ; Fri, 16 Oct 2026 22:55:45 +0200 (CEST) X-FEAS-Client-IP: 10.157.41.19 Received: by Ammars-Air.localdomain (Postfix, from userid 501) id F23BB1564EF5; Fri, 16 Oct 2026 23:49:40 +0300 (EEST) From: aerosouund To: aerosound161@gmail.com, passt-dev@passt.top Subject: [PATCH v2 1/7] tap: Move the tap_hdr file to a separate file Date: Fri, 16 Oct 2026 23:49:34 +0300 Message-Id: <20261016204940.33190-2-aerosound161@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20261016204940.33190-1-aerosound161@gmail.com> References: <20261016204940.33190-1-aerosound161@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: UUAU4EZURYMGK4KFUCXAAAQLMBUSPO7O X-Message-ID-Hash: UUAU4EZURYMGK4KFUCXAAAQLMBUSPO7O X-MailFrom: ammaryasser@Ammars-Air.localdomain 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 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: From: Ammar Yasser It was defined in tap.h, put it on its own so that future callers won't need to depend on all definitions in tap.h. Also turn it into a union of a vnet_len and virtio_net_mrg_rxbuf because for vhost acceleration the frames will have this virtio net header prepended to them. Signed-off-by: Ammar Yasser --- tap.h | 9 +-------- tap_hdr.h | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 tap_hdr.h diff --git a/tap.h b/tap.h index b335933..1625975 100644 --- a/tap.h +++ b/tap.h @@ -10,6 +10,7 @@ #include #include "passt.h" +#include "tap_hdr.h" /** L2_MAX_LEN_PASTA - Maximum frame length for pasta mode (with L2 header) * @@ -38,14 +39,6 @@ struct udphdr; -/** - * struct tap_hdr - tap backend specific headers - * @vnet_len: Frame length (for qemu socket transport) - */ -struct tap_hdr { - uint32_t vnet_len; -} __attribute__((packed)); - /** * tap_hdr_iov() - struct iovec for a tap header * @c: Execution context diff --git a/tap_hdr.h b/tap_hdr.h new file mode 100644 index 0000000..4156f44 --- /dev/null +++ b/tap_hdr.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later + * Copyright (c) 2021 Red Hat GmbH + * Author: David Gibson + */ + +#ifndef TAP_HDR_H +#define TAP_HDR_H + +#include +#include + +/** + * struct tap_hdr - tap backend specific headers + * @vnet_len: Frame length (for qemu socket transport) + */ +struct tap_hdr { + union { + uint32_t vnet_len; + struct virtio_net_hdr_mrg_rxbuf hdr; + }; +}; + +#endif /* TAP_HDR_H */ -- 2.39.5 (Apple Git-154)