samples: bpf: add an explict comment to handle nested vlan tagging.
Subsystems (4)
PATCH 1/1 samples: bpf: add an explict comment to handle nested vlan tagging.
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 <[email protected]>
--- samples/bpf/xdp1_kern.c | 2 ++ samples/bpf/xdp2_kern.c | 2 ++ 2 files changed, 4 insertions(+)
samples/bpf/xdp1_kern.c +2 -0
@@ -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;
samples/bpf/xdp2_kern.c +2 -0
@@ -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;
Signature · 1 line
2.17.1
This patch was applied to bpf/bpf-next.git (refs/heads/master):
Hello:
This patch was applied to bpf/bpf-next.git (refs/heads/master):
Quoted 8 lines · 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 <[email protected]>--- 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