--- zzzz-none-000/linux-5.15.111/net/core/filter.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-atom-6670-761/linux-5.15.111/net/core/filter.c 2024-02-07 10:23:30.000000000 +0000 @@ -16,6 +16,11 @@ * Andi Kleen - Fix a few bad bugs and races. * Kris Katterjohn - Added many additional checks in bpf_check_classic() */ +/* + Includes MaxLinear's changes dated: 2022. + Changed portions - Copyright 2022, MaxLinear, Inc. +*/ + #include #include @@ -8659,6 +8664,45 @@ bpf_target_off(struct sk_buff, mark, 4, target_size)); break; +#ifdef CONFIG_TI_META_DATA + case offsetof(struct __sk_buff, ti_meta_info): + if (type == BPF_WRITE) + *insn++ = BPF_STX_MEM(BPF_W, si->dst_reg, si->src_reg, + offsetof(struct sk_buff, ti_meta_info)); + else + *insn++ = BPF_LDX_MEM(BPF_W, si->dst_reg, si->src_reg, + offsetof(struct sk_buff, ti_meta_info)); + break; + + case offsetof(struct __sk_buff, ti_meta_info2): + if (type == BPF_WRITE) + *insn++ = BPF_STX_MEM(BPF_W, si->dst_reg, si->src_reg, + offsetof(struct sk_buff, ti_meta_info2)); + else + *insn++ = BPF_LDX_MEM(BPF_W, si->dst_reg, si->src_reg, + offsetof(struct sk_buff, ti_meta_info2)); + break; +#endif + +#ifdef CONFIG_TI_PACKET_PROCESSOR + #ifdef CONFIG_INTEL_KERNEL_SKB_COOKIE + case offsetof(struct __sk_buff, of_mark1): + *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct sk_buff, intel_cookie), + si->dst_reg, si->src_reg, offsetof(struct sk_buff, intel_cookie)); + *insn++ = BPF_JMP_IMM(BPF_JEQ, si->dst_reg, 0, 1); + *insn++ = BPF_LDX_MEM(BPF_W, si->dst_reg, si->dst_reg, + offsetof(SKB_INTEL_COOKIE, s.pp_packet_info.pp_session.of_mark1)); + break; + + case offsetof(struct __sk_buff, of_mark2): + *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct sk_buff, intel_cookie), + si->dst_reg, si->src_reg, offsetof(struct sk_buff, intel_cookie)); + *insn++ = BPF_JMP_IMM(BPF_JEQ, si->dst_reg, 0, 1); + *insn++ = BPF_LDX_MEM(BPF_W, si->dst_reg, si->dst_reg, + offsetof(SKB_INTEL_COOKIE, s.pp_packet_info.pp_session.of_mark2)); + break; + #endif +#endif case offsetof(struct __sk_buff, pkt_type): *target_size = 1;