On Tue, Jun 30, 2020 at 4:24 PM Martin KaFai Lau <kafai@xxxxxx> wrote: > Interesting idea. I don't have an immediate use case in the mac header of > the SYN but I think it may be useful going forward. > > Although bpf_hdr_opt_off may be no longer needed in v2, > it will still be convenient for the bpf prog to be able to get the TCP header > only instead of reparsing from the mac/ip[46] and also save some stack space > of the bpf prog. Thus, storing the length of each hdr would still be nice > so that the bpf helper can directly offset to the start of the required > header. > > Do you prefer to incorporate this "save_syn:2" idea in this set > so that mac hdrlen can be stored in the "struct saved_syn"? Sure, please go ahead. > > This "unused:2" bits have already been used by "fastopen_client_fail:2". Oh that is possible, I have sent the patch as it was when we merged it years ago. > May be get 2 bits from repair_queue? Hmm... this repair_queue is used in fast path, I would rather keep it as u8 for better code generation.