diff options
author | 2022-11-09 09:57:58 +0000 | |
---|---|---|
committer | 2022-11-11 18:18:05 -0800 | |
commit | 354259fa73e2aac92ae5e19522adb69a92c15b49 (patch) | |
tree | 2b9067c141413e5f6755501a3be4004985bd7ec3 /arch/sparc | |
parent | Merge branch 'ptp-adjfreq-copnvert' (diff) | |
download | linux-354259fa73e2aac92ae5e19522adb69a92c15b49.tar.gz linux-354259fa73e2aac92ae5e19522adb69a92c15b49.tar.bz2 linux-354259fa73e2aac92ae5e19522adb69a92c15b49.zip |
net: remove skb->vlan_present
skb->vlan_present seems redundant.
We can instead derive it from this boolean expression:
vlan_present = skb->vlan_proto != 0 || skb->vlan_tci != 0
Add a new union, to access both fields in a single load/store
when possible.
union {
u32 vlan_all;
struct {
__be16 vlan_proto;
__u16 vlan_tci;
};
};
This allows following patch to remove a conditional test in GRO stack.
Note:
We move remcsum_offload to keep TC_AT_INGRESS_MASK
and SKB_MONO_DELIVERY_TIME_MASK unchanged.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/net/bpf_jit_comp_32.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/sparc/net/bpf_jit_comp_32.c b/arch/sparc/net/bpf_jit_comp_32.c index b1dbf2fa8c0a..a74e5004c6c8 100644 --- a/arch/sparc/net/bpf_jit_comp_32.c +++ b/arch/sparc/net/bpf_jit_comp_32.c @@ -555,11 +555,11 @@ void bpf_jit_compile(struct bpf_prog *fp) emit_skb_load16(vlan_tci, r_A); break; case BPF_ANC | SKF_AD_VLAN_TAG_PRESENT: - __emit_skb_load8(__pkt_vlan_present_offset, r_A); - if (PKT_VLAN_PRESENT_BIT) - emit_alu_K(SRL, PKT_VLAN_PRESENT_BIT); - if (PKT_VLAN_PRESENT_BIT < 7) - emit_andi(r_A, 1, r_A); + emit_skb_load32(vlan_all, r_A); + emit_cmpi(r_A, 0); + emit_branch_off(BE, 12); + emit_nop(); + emit_loadimm(1, r_A); break; case BPF_LD | BPF_W | BPF_LEN: emit_skb_load32(len, r_A); |