<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/lib/test_bpf.c, branch v4.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-05-16T17:49:32Z</updated>
<entry>
<title>bpf: prepare bpf_int_jit_compile/bpf_prog_select_runtime apis</title>
<updated>2016-05-16T17:49:32Z</updated>
<author>
<name>Daniel Borkmann</name>
<email>daniel@iogearbox.net</email>
</author>
<published>2016-05-13T17:08:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d1c55ab5e41fcd72cb0a8bef86d3f652ad9ad9f5'/>
<id>urn:sha1:d1c55ab5e41fcd72cb0a8bef86d3f652ad9ad9f5</id>
<content type='text'>
Since the blinding is strictly only called from inside eBPF JITs,
we need to change signatures for bpf_int_jit_compile() and
bpf_prog_select_runtime() first in order to prepare that the
eBPF program we're dealing with can change underneath. Hence,
for call sites, we need to return the latest prog. No functional
change in this patch.

Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>lib/test_bpf: Add additional BPF_ADD tests</title>
<updated>2016-04-06T20:47:51Z</updated>
<author>
<name>Naveen N. Rao</name>
<email>naveen.n.rao@linux.vnet.ibm.com</email>
</author>
<published>2016-04-05T10:02:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9c94f6c8e0d3d4b1e44eb7ad90849a1c964aabe7'/>
<id>urn:sha1:9c94f6c8e0d3d4b1e44eb7ad90849a1c964aabe7</id>
<content type='text'>
Some of these tests proved useful with the powerpc eBPF JIT port due to
sign-extended 16-bit immediate loads. Though some of these aspects get
covered in other tests, it is better to have explicit tests so as to
quickly tag the precise problem.

Cc: Alexei Starovoitov &lt;ast@fb.com&gt;
Cc: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Signed-off-by: Naveen N. Rao &lt;naveen.n.rao@linux.vnet.ibm.com&gt;
Acked-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>lib/test_bpf: Add test to check for result of 32-bit add that overflows</title>
<updated>2016-04-06T20:47:51Z</updated>
<author>
<name>Naveen N. Rao</name>
<email>naveen.n.rao@linux.vnet.ibm.com</email>
</author>
<published>2016-04-05T10:02:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b64b50eac47046f1ecd23adac650317ccadf400f'/>
<id>urn:sha1:b64b50eac47046f1ecd23adac650317ccadf400f</id>
<content type='text'>
BPF_ALU32 and BPF_ALU64 tests for adding two 32-bit values that results in
32-bit overflow.

Cc: Alexei Starovoitov &lt;ast@fb.com&gt;
Cc: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Signed-off-by: Naveen N. Rao &lt;naveen.n.rao@linux.vnet.ibm.com&gt;
Acked-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>lib/test_bpf: Add tests for unsigned BPF_JGT</title>
<updated>2016-04-06T20:47:51Z</updated>
<author>
<name>Naveen N. Rao</name>
<email>naveen.n.rao@linux.vnet.ibm.com</email>
</author>
<published>2016-04-05T10:02:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c7395d6bd7cc1ca6a47b733439c364f7a423a489'/>
<id>urn:sha1:c7395d6bd7cc1ca6a47b733439c364f7a423a489</id>
<content type='text'>
Unsigned Jump-if-Greater-Than.

Cc: Alexei Starovoitov &lt;ast@fb.com&gt;
Cc: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Signed-off-by: Naveen N. Rao &lt;naveen.n.rao@linux.vnet.ibm.com&gt;
Acked-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>lib/test_bpf: Fix JMP_JSET tests</title>
<updated>2016-04-06T20:47:50Z</updated>
<author>
<name>Naveen N. Rao</name>
<email>naveen.n.rao@linux.vnet.ibm.com</email>
</author>
<published>2016-04-05T10:02:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9f134c34fbce58d863f60995cc13728af28b741a'/>
<id>urn:sha1:9f134c34fbce58d863f60995cc13728af28b741a</id>
<content type='text'>
JMP_JSET tests incorrectly used BPF_JNE. Fix the same.

Cc: Alexei Starovoitov &lt;ast@fb.com&gt;
Cc: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Signed-off-by: Naveen N. Rao &lt;naveen.n.rao@linux.vnet.ibm.com&gt;
Acked-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bpf, test: add couple of test cases</title>
<updated>2015-12-18T21:04:51Z</updated>
<author>
<name>Daniel Borkmann</name>
<email>daniel@iogearbox.net</email>
</author>
<published>2015-12-17T22:51:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9dd2af834dea132fa47b9a168d6da566d2e445d3'/>
<id>urn:sha1:9dd2af834dea132fa47b9a168d6da566d2e445d3</id>
<content type='text'>
Add couple of test cases for interpreter but also JITs, f.e. to test that
when imm32 moves are being done, upper 32bits of the regs are being zero
extended.

Without JIT:

  [...]
  [ 1114.129301] test_bpf: #43 MOV REG64 jited:0 128 PASS
  [ 1114.130626] test_bpf: #44 MOV REG32 jited:0 139 PASS
  [ 1114.132055] test_bpf: #45 LD IMM64 jited:0 124 PASS
  [...]

With JIT (generated code can as usual be nicely verified with the help of
bpf_jit_disasm tool):

  [...]
  [ 1062.726782] test_bpf: #43 MOV REG64 jited:1 6 PASS
  [ 1062.726890] test_bpf: #44 MOV REG32 jited:1 6 PASS
  [ 1062.726993] test_bpf: #45 LD IMM64 jited:1 6 PASS
  [...]

Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bpf: add mod default A and X test cases</title>
<updated>2015-11-05T05:05:50Z</updated>
<author>
<name>Yang Shi</name>
<email>yang.shi@linaro.org</email>
</author>
<published>2015-11-04T19:36:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d4e4bc16102cb1338be9c75f797156718f8a806d'/>
<id>urn:sha1:d4e4bc16102cb1338be9c75f797156718f8a806d</id>
<content type='text'>
When running "mod X" operation, if X is 0 the filter has to be halt.
Add new test cases to cover A = A mod X if X is 0, and A = A mod 1.

CC: Xi Wang &lt;xi.wang@gmail.com&gt;
CC: Zi Shen Lim &lt;zlim.lnx@gmail.com&gt;
Signed-off-by: Yang Shi &lt;yang.shi@linaro.org&gt;
Acked-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Zi Shen Lim &lt;zlim.lnx@gmail.com&gt;
Acked-by: Xi Wang &lt;xi.wang@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>test_bpf: add tests checking that JIT/interpreter sets A and X to 0.</title>
<updated>2015-08-07T05:02:32Z</updated>
<author>
<name>Nicolas Schichan</name>
<email>nschichan@freebox.fr</email>
</author>
<published>2015-08-04T13:19:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=86bf1721b2263607588b23b22e78c971379972b5'/>
<id>urn:sha1:86bf1721b2263607588b23b22e78c971379972b5</id>
<content type='text'>
It is mandatory for the JIT or interpreter to reset the A and X
registers to 0 before running the filter. Check that it is the case on
various ALU and JMP instructions.

Signed-off-by: Nicolas Schichan &lt;nschichan@freebox.fr&gt;
Acked-by: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Acked-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>test_bpf: add more tests for LD_ABS and LD_IND.</title>
<updated>2015-08-07T05:02:32Z</updated>
<author>
<name>Nicolas Schichan</name>
<email>nschichan@freebox.fr</email>
</author>
<published>2015-08-04T13:19:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=08fcb08fc06758411d099bcd6a60d6cdee2d50a7'/>
<id>urn:sha1:08fcb08fc06758411d099bcd6a60d6cdee2d50a7</id>
<content type='text'>
This exerces the LD_ABS and LD_IND instructions for various sizes and
alignments. This also checks that X when used as an offset to a
BPF_IND instruction first in a filter is correctly set to 0.

Signed-off-by: Nicolas Schichan &lt;nschichan@freebox.fr&gt;
Acked-by: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Acked-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>test_bpf: add module parameters to filter the tests to run.</title>
<updated>2015-08-07T05:02:32Z</updated>
<author>
<name>Nicolas Schichan</name>
<email>nschichan@freebox.fr</email>
</author>
<published>2015-08-04T13:19:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d2648d4e268cee60c9c917a04c3fbc4e8c3bbc7e'/>
<id>urn:sha1:d2648d4e268cee60c9c917a04c3fbc4e8c3bbc7e</id>
<content type='text'>
When developping on the interpreter or a particular JIT, it can be
interesting to restrict the tests list to a specific test or a
particular range of tests.

This patch adds the following module parameters to the test_bpf module:

* test_name=&lt;string&gt;: only the specified named test will be run.

* test_id=&lt;number&gt;: only the test with the specified id will be run
  (see the output of test_bpf without parameters to get the test id).

* test_range=&lt;number&gt;,&lt;number&gt;: only the tests within IDs in the
  specified id range are run (see the output of test_bpf without
  parameters to get the test ids).

Any invalid range, test id or test name will result in -EINVAL being
returned and no tests being run.

Signed-off-by: Nicolas Schichan &lt;nschichan@freebox.fr&gt;
Acked-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
