From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id 29FC25A02C8 for ; Tue, 30 Apr 2024 20:47:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714502877; 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=lhe7VgjTez79ndictr3YcdJI5w7gOGVcl7sTYlAoyCw=; b=fU+AaZF3GGRCz9PmK0mTZqmp7D3HjIIJS1hQhP4KC7CDK2G7vZBPL1oUJw3YKGkruXrh/F HnkMxA2FE3zF/ue6EOTRpl6VL2Qe+803Z1Ij2C1DJRWU/8hmgWpebfGNqvkirPN5LpMjWb xow5wy0+768kcNDFYby1NS5qrr294OA= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-26-cpJJaJzOP4mzv1n9_6fnwA-1; Tue, 30 Apr 2024 14:47:55 -0400 X-MC-Unique: cpJJaJzOP4mzv1n9_6fnwA-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a526a77445bso401139566b.2 for ; Tue, 30 Apr 2024 11:47:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714502874; x=1715107674; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=lhe7VgjTez79ndictr3YcdJI5w7gOGVcl7sTYlAoyCw=; b=nT+4vy4G8DUQ+SaBMwo39FP8uJ4viWV0Ve1QuMyJBfYE8VlGV/rAtAsSHkpP2fNrCM c5imhldt6LtwcYduyJlArMj4jDsMgGXMLktK8pCj7sGtOBONEx+cYaAj1ynJBXsTGV2v 0PxlGhb2s9hGmYrhNMEztzkXDCqxXnf16ifIEopt3eS9jiiSeTqJF07c10jYAVt/vasl Mm/9qHFpG6BgABfftNaWAJ5xaI2ZAnvLn2E37gJm4qYZZLwcCCPq3uMPX6gDqm1TPeym QZ2S36L+BDspRtUU9bjzF6JphH2qZ6uWvvyu7LvLFJLri/zibSZDUSW/HTUFMqmXmzPK 2KOg== X-Gm-Message-State: AOJu0YyoAHd89OHVhAPgH3WDWj2gB4EHI0Tv3qXtNK6JvPYTUloS2H8R fXChRipTjLlbbetwpm/mfXvW8EEWFjZAvIjCD0Ndhlzpiw7dLaXMvAVCrSxCjlT5Bm6tKZYw5oc zD5hYP0bRAN/ThAm5OKCGp96ScPAjnuKyu1m6sn8d05usQSR5M0rDjE8hNj2v X-Received: by 2002:a17:906:4ed4:b0:a58:83ab:dca5 with SMTP id i20-20020a1709064ed400b00a5883abdca5mr423232ejv.62.1714502873807; Tue, 30 Apr 2024 11:47:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHRPDyhG+V7QX04lrGkUdylr/J96F1yROCchd1vReNxQkibHokAlzac2fMLApv3zles2cq0+A== X-Received: by 2002:a17:906:4ed4:b0:a58:83ab:dca5 with SMTP id i20-20020a1709064ed400b00a5883abdca5mr423214ejv.62.1714502873299; Tue, 30 Apr 2024 11:47:53 -0700 (PDT) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id wg7-20020a17090705c700b00a55b17418ebsm11332187ejb.89.2024.04.30.11.47.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Apr 2024 11:47:52 -0700 (PDT) Date: Tue, 30 Apr 2024 20:47:18 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 5/7] tap, tcp: (Re-)abstract TAP specific header handling Message-ID: <20240430204718.520f3b5b@elisabeth> In-Reply-To: <20240429070933.1366881-6-david@gibson.dropbear.id.au> References: <20240429070933.1366881-1-david@gibson.dropbear.id.au> <20240429070933.1366881-6-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.36; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 6WNZRDTCNVQXVKGJAIDF4RX7H6JFHPM5 X-Message-ID-Hash: 6WNZRDTCNVQXVKGJAIDF4RX7H6JFHPM5 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: passt-dev@passt.top, Laurent Vivier 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 Mon, 29 Apr 2024 17:09:31 +1000 David Gibson wrote: > Recent changes to the TCP code (reworking of the buffer handling) have > meant that it now (again) deals explicitly with the MODE_PASST specific > vnet_len field, instead of using the (partial) abstractions provided by the > tap layer. > > The abstractions we had don't work for the new TCP structure, so make some > new ones that do: tap_hdr_iov() which constructs an iovec suitable for > containing (just) the TAP specific header and tap_hdr_update() which > updates it as necessary per-packet. > > Signed-off-by: David Gibson > --- > tap.h | 27 +++++++++++++++++++++++++++ > tcp.c | 40 +++++++++++++++------------------------- > 2 files changed, 42 insertions(+), 25 deletions(-) > > diff --git a/tap.h b/tap.h > index dbc23b31..75aa3f03 100644 > --- a/tap.h > +++ b/tap.h > @@ -16,6 +16,33 @@ struct tap_hdr { > uint32_t vnet_len; > } __attribute__((packed)); > > +/** > + * tap_hdr_iov() - struct iovec for a tap header > + * @c: Execution context > + * @taph: Pointer to tap specific header buffer > + * > + * Returns: A struct iovec covering the correct portion of @taph to use as the > + * TAP specific header in the current configuration. Nit: s/TAP/tap/ (not an acronym). -- Stefano