public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] bpf: Update h_proto of ethhdr when the outer protocol changed
@ 2023-08-10  6:25 Ziyang Xuan
  2023-08-10  6:25 ` [PATCH bpf-next 1/2] " Ziyang Xuan
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ziyang Xuan @ 2023-08-10  6:25 UTC (permalink / raw)
  To: martin.lau, daniel, john.fastabend, ast, andrii, song,
	yonghong.song, kpsingh, sdf, haoluo, jolsa, bpf

When use bpf_skb_adjust_room() to encapsulate or decapsulate packet,
and outer protocol changed, we can update h_proto of ethhdr directly.

$./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
encap 192.168.1.1 to 192.168.1.2, type ipip6, 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
ip6ip6
encap fd::1 to fd::2, type ip6tnl, 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
sit
encap fd::1 to fd::2, type sit, 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
...
OK. All tests passed

Ziyang Xuan (2):
  bpf: Update h_proto of ethhdr when the outer protocol changed
  selftests/bpf: Remove unnecessary codes for updating h_proto of ethhdr

 net/core/filter.c                             | 20 +++++++++++++------
 .../selftests/bpf/progs/test_tc_tunnel.c      | 18 -----------------
 2 files changed, 14 insertions(+), 24 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-08-11 10:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox