[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5f28b1bf96cad_62272b02d7c945b4c8@john-XPS-13-9370.notmuch>
Date: Mon, 03 Aug 2020 17:54:23 -0700
From: John Fastabend <john.fastabend@...il.com>
To: Martin KaFai Lau <kafai@...com>, bpf@...r.kernel.org
Cc: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Eric Dumazet <edumazet@...gle.com>, kernel-team@...com,
Lawrence Brakmo <brakmo@...com>,
Neal Cardwell <ncardwell@...gle.com>, netdev@...r.kernel.org,
Yuchung Cheng <ycheng@...gle.com>
Subject: RE: [RFC PATCH v4 bpf-next 01/12] tcp: Use a struct to represent a
saved_syn
Martin KaFai Lau wrote:
> The TCP_SAVE_SYN has both the network header and tcp header.
> The total length of the saved syn packet is currently stored in
> the first 4 bytes (u32) of an array and the actual packet data is
> stored after that.
>
> A later patch will add a bpf helper that allows to get the tcp header
> alone from the saved syn without the network header. It will be more
> convenient to have a direct offset to a specific header instead of
> re-parsing it. This requires to separately store the network hdrlen.
> The total header length (i.e. network + tcp) is still needed for the
> current usage in getsockopt. Although this total length can be obtained
> by looking into the tcphdr and then get the (th->doff << 2), this patch
> chooses to directly store the tcp hdrlen in the second four bytes of
> this newly created "struct saved_syn". By using a new struct, it can
> give a readable name to each individual header length.
>
> Signed-off-by: Martin KaFai Lau <kafai@...com>
> ---
Acked-by: John Fastabend <john.fastabend@...il.com>
Powered by blists - more mailing lists