netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] sparc: bpf_jit: add support for BPF_LD(X) | BPF_LEN instructions
@ 2014-09-23 21:36 Alexei Starovoitov
  2014-09-26 20:52 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Alexei Starovoitov @ 2014-09-23 21:36 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

BPF_LD | BPF_W | BPF_LEN instruction is occasionally used by tcpdump
and present in 11 tests in lib/test_bpf.c
Teach sparc JIT compiler to emit it.

Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
---

coupled with pending net fix test_bpf still comes out clean on sparc64.
compile tested only on sparc32

Though both patches touch the same file, there should be no conflicts
between net and net-next.

 arch/sparc/net/bpf_jit_comp.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/sparc/net/bpf_jit_comp.c b/arch/sparc/net/bpf_jit_comp.c
index 7c06f18150ab..86bad49d6604 100644
--- a/arch/sparc/net/bpf_jit_comp.c
+++ b/arch/sparc/net/bpf_jit_comp.c
@@ -624,7 +624,12 @@ void bpf_jit_compile(struct bpf_prog *fp)
 					emit_and(r_A, r_TMP, r_A);
 				}
 				break;
-
+			case BPF_LD | BPF_W | BPF_LEN:
+				emit_skb_load32(len, r_A);
+				break;
+			case BPF_LDX | BPF_W | BPF_LEN:
+				emit_skb_load32(len, r_X);
+				break;
 			case BPF_LD | BPF_IMM:
 				emit_loadimm(K, r_A);
 				break;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] sparc: bpf_jit: add support for BPF_LD(X) | BPF_LEN instructions
  2014-09-23 21:36 [PATCH net-next] sparc: bpf_jit: add support for BPF_LD(X) | BPF_LEN instructions Alexei Starovoitov
@ 2014-09-26 20:52 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-09-26 20:52 UTC (permalink / raw)
  To: ast; +Cc: netdev

From: Alexei Starovoitov <ast@plumgrid.com>
Date: Tue, 23 Sep 2014 14:36:11 -0700

> BPF_LD | BPF_W | BPF_LEN instruction is occasionally used by tcpdump
> and present in 11 tests in lib/test_bpf.c
> Teach sparc JIT compiler to emit it.
> 
> Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>

Applied, thanks Alexei.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-26 20:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-23 21:36 [PATCH net-next] sparc: bpf_jit: add support for BPF_LD(X) | BPF_LEN instructions Alexei Starovoitov
2014-09-26 20:52 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).