Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 709f6c58 authored by Alexei Starovoitov's avatar Alexei Starovoitov Committed by David S. Miller
Browse files

sparc: bpf_jit: add SKF_AD_PKTTYPE support to JIT



commit 233577a2 ("net: filter: constify detection of pkt_type_offset")
allows us to implement simple PKTTYPE support in sparc JIT

Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bf3c228d
Loading
Loading
Loading
Loading
+2 −7
Original line number Original line Diff line number Diff line
@@ -579,16 +579,11 @@ void bpf_jit_compile(struct bpf_prog *fp)
			case BPF_ANC | SKF_AD_PROTOCOL:
			case BPF_ANC | SKF_AD_PROTOCOL:
				emit_skb_load16(protocol, r_A);
				emit_skb_load16(protocol, r_A);
				break;
				break;
#if 0
				/* GCC won't let us take the address of
				 * a bit field even though we very much
				 * know what we are doing here.
				 */
			case BPF_ANC | SKF_AD_PKTTYPE:
			case BPF_ANC | SKF_AD_PKTTYPE:
				__emit_skb_load8(pkt_type, r_A);
				__emit_skb_load8(__pkt_type_offset, r_A);
				emit_andi(r_A, PKT_TYPE_MAX, r_A);
				emit_alu_K(SRL, 5);
				emit_alu_K(SRL, 5);
				break;
				break;
#endif
			case BPF_ANC | SKF_AD_IFINDEX:
			case BPF_ANC | SKF_AD_IFINDEX:
				emit_skb_loadptr(dev, r_A);
				emit_skb_loadptr(dev, r_A);
				emit_cmpi(r_A, 0);
				emit_cmpi(r_A, 0);