From: "Ziyang Xuan (William)" <william.xuanziyang@huawei.com>
To: <yonghong.song@linux.dev>, <martin.lau@linux.dev>,
<daniel@iogearbox.net>, <john.fastabend@gmail.com>,
<ast@kernel.org>, <andrii@kernel.org>, <song@kernel.org>,
<kpsingh@kernel.org>, <sdf@google.com>, <haoluo@google.com>,
<jolsa@kernel.org>, <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next 0/2] bpf: Update h_proto of ethhdr when the outer protocol changed
Date: Fri, 11 Aug 2023 17:44:37 +0800 [thread overview]
Message-ID: <7b5ec0f4-dff0-a2bf-a996-98cea7d8f843@huawei.com> (raw)
In-Reply-To: <148a0235-04c9-6983-4d2a-7030bd91fc4e@linux.dev>
> On 8/9/23 11:25 PM, Ziyang Xuan wrote:
>> When use bpf_skb_adjust_room() to encapsulate or decapsulate packet,
>> and outer protocol changed, we can update h_proto of ethhdr directly.
>
> My mailbox somehow lost patch 1/2.
>
> Looks like current bpf_skb_adjust_room() only changes skb meta data and
> tries not to modify the packet. Probably there is a reason for this.
>
I found that this could reduce updating h_proto of ethhdr by bpf_skb_store_bytes()
in bpf program when I used bpf_skb_adjust_room(). I thought it should be a small
optimization. So I did it. No other problems.
Thank you!
William Xuan
>>
>> $./test_tc_tunnel.sh
>> ipip
>> encap 192.168.1.1 to 192.168.1.2, type ipip, mac none len 100
>> test basic connectivity
>> 0
>> test bpf encap without decap (expect failure)
>> Ncat: TIMEOUT.
>> 1
>> test bpf encap with tunnel device decap
>> 0
>> test bpf encap with bpf decap
>> 0
>> OK
>> ipip6
> [...]
>
> .
prev parent reply other threads:[~2023-08-11 9:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-10 6:25 [PATCH bpf-next 0/2] bpf: Update h_proto of ethhdr when the outer protocol changed Ziyang Xuan
2023-08-10 6:25 ` [PATCH bpf-next 1/2] " Ziyang Xuan
2023-08-10 18:27 ` Martin KaFai Lau
2023-08-11 10:22 ` Ziyang Xuan (William)
2023-08-10 6:25 ` [PATCH bpf-next 2/2] selftests/bpf: Remove unnecessary codes for updating h_proto of ethhdr Ziyang Xuan
2023-08-10 15:54 ` [PATCH bpf-next 0/2] bpf: Update h_proto of ethhdr when the outer protocol changed Yonghong Song
2023-08-11 9:44 ` Ziyang Xuan (William) [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7b5ec0f4-dff0-a2bf-a996-98cea7d8f843@huawei.com \
--to=william.xuanziyang@huawei.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=martin.lau@linux.dev \
--cc=sdf@google.com \
--cc=song@kernel.org \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox