History log of /external/linux-kselftest/tools/testing/selftests/net/psock_fanout.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
472ecf084a7687347f79720c83881c07407bfd8b 25-Apr-2017 Mike Maloney <maloney@google.com> selftests/net: Fix broken test case in psock_fanout

The error return falue form sock_fanout_open is -1, not zero. One test
case was checking for 0 instead of -1.

Tested: Built and tested in clean client.
Signed-off-by: Mike Maloney <maloney@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
/external/linux-kselftest/tools/testing/selftests/net/psock_fanout.c
28be04f5c1c95bdf5614af19f7faf7d4fb781fa6 21-Apr-2017 Mike Maloney <maloney@google.com> selftests/net: add tests for PACKET_FANOUT_FLAG_UNIQUEID

Create two groups with PACKET_FANOUT_FLAG_UNIQUEID, add a socket to one.
Ensure that the groups can only be joined if all options are consistent
with the original except for this flag.

Signed-off-by: Mike Maloney <maloney@google.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
/external/linux-kselftest/tools/testing/selftests/net/psock_fanout.c
2e7a721714b9cdca539da78a0eb1f59dbe4020ac 21-Apr-2017 Mike Maloney <maloney@google.com> selftests/net: cleanup unused parameter in psock_fanout

sock_fanout_open no longer sets the size of packet_socket ring, so stop
passing the parameter.

Signed-off-by: Mike Maloney <maloney@google.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
/external/linux-kselftest/tools/testing/selftests/net/psock_fanout.c
c1f8d0f98c3bc12393821c1bf00d8eaa0bd58bd8 18-Apr-2017 Mike Maloney <maloney@google.com> selftests/net: Fixes psock_fanout CBPF test case

'psock_fanout' has been failing since commit 4d7b9dc1f36a9 ("tools:
psock_lib: harden socket filter used by psock tests"). That commit
changed the CBPF filter to examine the full ethernet frame, and was
tested on 'psock_tpacket' which uses SOCK_RAW. But 'psock_fanout' was
also using this same CBPF in two places, for filtering and fanout, on a
SOCK_DGRAM socket.

Change 'psock_fanout' to use SOCK_RAW so that the CBPF program used with
SO_ATTACH_FILTER can examine the entire frame. Create a new CBPF
program for use with PACKET_FANOUT_DATA which ignores the header, as it
cannot see the ethernet header.

Tested: Ran tools/testing/selftests/net/psock_{fanout,tpacket} 10 times,
and they all passed.

Fixes: 4d7b9dc1f36a9 ("tools: psock_lib: harden socket filter used by psock tests")
Signed-off-by: 'Mike Maloney <maloneykernel@gmail.com>'
Signed-off-by: David S. Miller <davem@davemloft.net>
/external/linux-kselftest/tools/testing/selftests/net/psock_fanout.c
30da679e679dbe7bb103c5d9c137ec5a070b7150 15-Aug-2015 Willem de Bruijn <willemb@google.com> selftests/net: test extended BPF fanout mode

Test PACKET_FANOUT_EBPF by inserting a program into the the kernel
with bpf(), then attaching it to the fanout group. Observe the same
payload-based distribution as in the PACKET_FANOUT_CBPF test.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
/external/linux-kselftest/tools/testing/selftests/net/psock_fanout.c
95e22792fa5460e579a69171777ff79d8725be29 15-Aug-2015 Willem de Bruijn <willemb@google.com> selftests/net: test classic bpf fanout mode

Test PACKET_FANOUT_CBPF by inserting a cBPF program that selects a
socket by payload. Requires modifying the test program to send
packets with multiple payloads.

Also fix a bug in testing the return value of mmap()

Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
/external/linux-kselftest/tools/testing/selftests/net/psock_fanout.c
a2ad5d2ad96e8d5b3b8f33583a82eae78dce4d49 18-May-2015 Willem de Bruijn <willemb@google.com> selftests/net: expect headroom in psock_fanout rollover

psock_fanout tests the various fanout modes. Change the test for
rollover mode to expect early rollover due to socket pressure
as implemented in 2ccdbaa6d55b ("packet: rollover lock contention
avoidance").

Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
/external/linux-kselftest/tools/testing/selftests/net/psock_fanout.c
fbf8e7211ac7858d3df4a4203c18da7a58560784 11-Nov-2014 Shuah Khan <shuahkh@osg.samsung.com> selftests/net: psock_fanout seg faults in sock_fanout_read_ring()

The while loop in sock_fanout_read_ring() checks mmap region
bounds after access, causing it to segfault. Fix it to check
count before accessing header->tp_status. This problem can be
reproduced consistently when the test in run as follows:

make -C tools/testing/selftests TARGETS=net run_tests
or
make run_tests from tools/testing/selftests
or
make run_test from tools/testing/selftests/net

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
/external/linux-kselftest/tools/testing/selftests/net/psock_fanout.c
23a9544206dd91dfe048fcf67abec3f3104c42b9 02-Apr-2013 Daniel Borkmann <dborkman@redhat.com> selftests: net: add PF_PACKET TPACKET v1/v2/v3 selftests

This patch adds a simple test case that probes the packet socket's
TPACKET_V1, TPACKET_V2 and TPACKET_V3 behavior regarding mmap(2)'ed
I/O for a small burst of 100 packets. The test currently runs for ...

TPACKET_V1: RX_RING, TX_RING
TPACKET_V2: RX_RING, TX_RING
TPACKET_V3: RX_RING

... and will output on success:

test: TPACKET_V1 with PACKET_RX_RING .................... 100 pkts (9600 bytes)
test: TPACKET_V1 with PACKET_TX_RING .................... 100 pkts (9600 bytes)
test: TPACKET_V2 with PACKET_RX_RING .................... 100 pkts (9600 bytes)
test: TPACKET_V2 with PACKET_TX_RING .................... 100 pkts (9600 bytes)
test: TPACKET_V3 with PACKET_RX_RING .................... 100 pkts (9600 bytes)
OK. All tests passed

Reusable parts of psock_fanout.c have been put into a psock_lib.h
file for common usage. Test case successfully tested on x86_64.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
/external/linux-kselftest/tools/testing/selftests/net/psock_fanout.c
98e821a2a927b6dc0f7adc4b64ad29bec1b6ff89 21-Mar-2013 Willem de Bruijn <willemb@google.com> net: fix psock_fanout on sparc64

The packetsocket fanout test uses a packet ring. Use TPACKET_V2
instead of TPACKET_V1 to work around a known 32/64 bit issue in
the older ring that manifests on sparc64.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
/external/linux-kselftest/tools/testing/selftests/net/psock_fanout.c
a6f68034de8a5784dfeabb337506254c80b4c8c6 20-Mar-2013 David S. Miller <davem@davemloft.net> net: Move selftests to common net/ subdirectory.

Suggested-by: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
/external/linux-kselftest/tools/testing/selftests/net/psock_fanout.c