File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -79,10 +79,14 @@ int xdp_vlan_02(struct xdp_md *ctx)
7979 struct collect_vlans vlans ;
8080
8181 struct ethhdr * eth ;
82- eth_type = parse_ethhdr_vlan (& nh , data_end , & eth , & vlans );
8382
83+ eth_type = parse_ethhdr_vlan (& nh , data_end , & eth , & vlans );
8484 if (eth_type < 0 )
8585 return XDP_ABORTED ;
86+ /* The eth_type have skipped VLAN-types, but collected VLAN ids. The
87+ * eth ptr still points to Ethernet header, thus to check if this is a
88+ * VLAN packet do proto_is_vlan(eth->h_proto).
89+ */
8690
8791 /* The LLVM compiler is very clever, it sees that program only access
8892 * 2nd "inner" vlan (array index 1), and only does loop unroll of 2, and
@@ -117,7 +121,7 @@ int xdp_vlan_02(struct xdp_md *ctx)
117121 }
118122#endif
119123 /* Hint: to inspect BPF byte-code run:
120- * llvm-objdump -S xdp_vlan02_kern.o
124+ * llvm-objdump --no-show-raw-insn - S xdp_vlan02_kern.o
121125 */
122126 return XDP_PASS ;
123127}
You can’t perform that action at this time.
0 commit comments