Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] samples: bpf: add an explict comment to handle nested vlan tagging.
@ 2021-08-09 7:00 Muhammad Falak R Wani
2021-08-10 9:20 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Muhammad Falak R Wani @ 2021-08-09 7:00 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
Cc: bpf, netdev, KP Singh, Yonghong Song, Song Liu, Martin KaFai Lau,
John Fastabend, Jesper Dangaard Brouer, Jakub Kicinski,
David S . Miller, linux-kernel, Muhammad Falak R Wani
A codeblock for handling nested vlan trips newbies into thinking it as
duplicate code. Explicitly add a comment to clarify.
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
---
samples/bpf/xdp1_kern.c | 2 ++
samples/bpf/xdp2_kern.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/samples/bpf/xdp1_kern.c b/samples/bpf/xdp1_kern.c
index 34b64394ed9c..f0c5d95084de 100644
--- a/samples/bpf/xdp1_kern.c
+++ b/samples/bpf/xdp1_kern.c
@@ -57,6 +57,7 @@ int xdp_prog1(struct xdp_md *ctx)
h_proto = eth->h_proto;
+ /* Handle VLAN tagged packet */
if (h_proto == htons(ETH_P_8021Q) || h_proto == htons(ETH_P_8021AD)) {
struct vlan_hdr *vhdr;
@@ -66,6 +67,7 @@ int xdp_prog1(struct xdp_md *ctx)
return rc;
h_proto = vhdr->h_vlan_encapsulated_proto;
}
+ /* Handle double VLAN tagged packet */
if (h_proto == htons(ETH_P_8021Q) || h_proto == htons(ETH_P_8021AD)) {
struct vlan_hdr *vhdr;
diff --git a/samples/bpf/xdp2_kern.c b/samples/bpf/xdp2_kern.c
index c787f4b49646..d8a64ab077b0 100644
--- a/samples/bpf/xdp2_kern.c
+++ b/samples/bpf/xdp2_kern.c
@@ -73,6 +73,7 @@ int xdp_prog1(struct xdp_md *ctx)
h_proto = eth->h_proto;
+ /* Handle VLAN tagged packet */
if (h_proto == htons(ETH_P_8021Q) || h_proto == htons(ETH_P_8021AD)) {
struct vlan_hdr *vhdr;
@@ -82,6 +83,7 @@ int xdp_prog1(struct xdp_md *ctx)
return rc;
h_proto = vhdr->h_vlan_encapsulated_proto;
}
+ /* Handle double VLAN tagged packet */
if (h_proto == htons(ETH_P_8021Q) || h_proto == htons(ETH_P_8021AD)) {
struct vlan_hdr *vhdr;
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] samples: bpf: add an explict comment to handle nested vlan tagging.
2021-08-09 7:00 [PATCH] samples: bpf: add an explict comment to handle nested vlan tagging Muhammad Falak R Wani
@ 2021-08-10 9:20 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-08-10 9:20 UTC (permalink / raw)
To: Muhammad Falak R Wani
Cc: ast, daniel, andrii, bpf, netdev, kpsingh, yhs, songliubraving,
kafai, john.fastabend, hawk, kuba, davem, linux-kernel
Hello:
This patch was applied to bpf/bpf-next.git (refs/heads/master):
On Mon, 9 Aug 2021 12:30:46 +0530 you wrote:
> A codeblock for handling nested vlan trips newbies into thinking it as
> duplicate code. Explicitly add a comment to clarify.
>
> Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
> ---
> samples/bpf/xdp1_kern.c | 2 ++
> samples/bpf/xdp2_kern.c | 2 ++
> 2 files changed, 4 insertions(+)
Here is the summary with links:
- samples: bpf: add an explict comment to handle nested vlan tagging.
https://git.kernel.org/bpf/bpf-next/c/d692a637b4c5
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-10 9:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-09 7:00 [PATCH] samples: bpf: add an explict comment to handle nested vlan tagging Muhammad Falak R Wani
2021-08-10 9:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).