Hi Linus,
Please pull the following Kselftest update for Linux 4.19-rc1
This Kselftest update for 4.19-rc1:
- adds cgroup core selftests
- fixes compile warnings in android ion test
- fixes to bugs in exclude and skip paths in vDSO test
- removes obsolete config options
- adds missing .gitignore file
diff is attached.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit 1e4b044d22517cae7047c99038abb444423243ca:
Linux 4.18-rc4 (2018-07-08 16:34:02 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux-kselftest-4.19-rc1
for you to fetch changes up to 01675e9503c4e20c5ce9aebdfe6a9cf2ae4991e0:
selftests/ftrace: Fix kprobe string testcase to not probe notrace function (2018-08-09 11:26:33 -0600)
----------------------------------------------------------------
linux-kselftest-4.19-rc1
This Kselftest update for 4.19-rc1:
- adds cgroup core selftests
- fixes compile warnings in android ion test
- fixes to bugs in exclude and skip paths in vDSO test
- removes obsolete config options
- adds missing .gitignore file
----------------------------------------------------------------
Anders Roxell (2):
selftests: cgroup: add gitignore file
selftests: mount: remove no longer needed config option
Claudio (1):
Add cgroup core selftests
Li Zhijian (1):
selftests/android: initialize heap_type to avoid compiling warning
Masami Hiramatsu (1):
selftests/ftrace: Fix kprobe string testcase to not probe notrace function
Shuah Khan (Samsung OSG) (2):
selftests: vDSO - fix to exclude x86 test on non-x86 platforms
selftests: vDSO - fix to return KSFT_SKIP when test couldn't be run
.../testing/selftests/android/ion/ionapp_export.c | 1 +
tools/testing/selftests/cgroup/.gitignore | 1 +
tools/testing/selftests/cgroup/Makefile | 2 +
tools/testing/selftests/cgroup/cgroup_util.c | 8 +
tools/testing/selftests/cgroup/cgroup_util.h | 1 +
tools/testing/selftests/cgroup/test_core.c | 395 +++++++++++++++++++++
.../ftrace/test.d/kprobe/kprobe_args_string.tc | 30 +-
.../selftests/ftrace/test.d/kprobe/probepoint.tc | 2 +-
tools/testing/selftests/mount/config | 1 -
tools/testing/selftests/vDSO/Makefile | 13 +-
tools/testing/selftests/vDSO/vdso_test.c | 7 +-
11 files changed, 435 insertions(+), 26 deletions(-)
create mode 100644 tools/testing/selftests/cgroup/.gitignore
create mode 100644 tools/testing/selftests/cgroup/test_core.c
----------------------------------------------------------------
Hi,
I have a question about the config files in tools/testing/selftests/ .
The kselftest-merge target in the root Makefile assumes that the
config files are placed in
tools/testing/selftests/*/config and selftests/android/ion/config and
selftests/net/forwarding/config doesn't follow that. So either we move
those files up a level or do something like below in the top Makefile.
diff --git a/Makefile b/Makefile
index c88d56de7fda..06aeeca16917 100644
--- a/Makefile
+++ b/Makefile
@@ -1188,12 +1188,13 @@ PHONY += kselftest-clean
kselftest-clean:
$(Q)$(MAKE) -C $(srctree)/tools/testing/selftests clean
+KSFT_CONFIGS=$(shell find $(srctree)/tools/testing/selftests/ -type f
-name config)
PHONY += kselftest-merge
kselftest-merge:
$(if $(wildcard $(objtree)/.config),, $(error No .config exists,
config your kernel first!))
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \
-m $(objtree)/.config \
- $(srctree)/tools/testing/selftests/*/config
+ $(KSFT_CONFIGS)
+$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
# ---------------------------------------------------------------------------
or do you have another way to solve this?
Cheers,
Anders
While implementing rseq selftest for s390 a glibc problem with tls
variables alignment has been discovered. It turned out to be a general
problem affecting several architectures. The bug opened for this problem:
https://sourceware.org/bugzilla/show_bug.cgi?id=23403
There is no fix yet. On s390 __rseq_abi ends up aligned to 0x10 instead
of 0x20 which makes rseq selftest fail every time.
The change proposed adds __rseq_abi misalignment check, produces user
friendly message and skips the test.
Vasily Gorbik (1):
rseq/selftests: add __rseq_abi misalignment check
tools/testing/selftests/rseq/rseq.c | 19 +++++++++++++++++++
.../testing/selftests/rseq/run_param_test.sh | 4 ++--
2 files changed, 21 insertions(+), 2 deletions(-)
--
2.18.0.13.gd42ae10
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
arm64 has a feature called Top Byte Ignore, which allows to embed pointer
tags into the top byte of each pointer. Userspace programs (such as
HWASan, a memory debugging tool [1]) might use this feature and pass
tagged user pointers to the kernel through syscalls or other interfaces.
This patch makes a few of the kernel interfaces accept tagged user
pointers. The kernel is already able to handle user faults with tagged
pointers and has the untagged_addr macro, which this patchset reuses.
We're not trying to cover all possible ways the kernel accepts user
pointers in one patchset, so this one should be considered as a start.
Thanks!
[1] http://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html
Changes in v4:
- Added a selftest for checking that passing tagged pointers to the
kernel succeeds.
- Rebased onto 81e97f013 (4.18-rc1+).
Changes in v3:
- Rebased onto e5c51f30 (4.17-rc6+).
- Added linux-arch@ to the list of recipients.
Changes in v2:
- Rebased onto 2d618bdf (4.17-rc3+).
- Removed excessive untagging in gup.c.
- Removed untagging pointers returned from __uaccess_mask_ptr.
Changes in v1:
- Rebased onto 4.17-rc1.
Changes in RFC v2:
- Added "#ifndef untagged_addr..." fallback in linux/uaccess.h instead of
defining it for each arch individually.
- Updated Documentation/arm64/tagged-pointers.txt.
- Dropped “mm, arm64: untag user addresses in memory syscalls”.
- Rebased onto 3eb2ce82 (4.16-rc7).
Andrey Konovalov (7):
arm64: add type casts to untagged_addr macro
uaccess: add untagged_addr definition for other arches
arm64: untag user addresses in access_ok and __uaccess_mask_ptr
mm, arm64: untag user addresses in mm/gup.c
lib, arm64: untag addrs passed to strncpy_from_user and strnlen_user
arm64: update Documentation/arm64/tagged-pointers.txt
selftests, arm64: add a selftest for passing tagged pointers to kernel
Documentation/arm64/tagged-pointers.txt | 5 +++--
arch/arm64/include/asm/uaccess.h | 14 +++++++++-----
include/linux/uaccess.h | 4 ++++
lib/strncpy_from_user.c | 2 ++
lib/strnlen_user.c | 2 ++
mm/gup.c | 4 ++++
tools/testing/selftests/arm64/.gitignore | 1 +
tools/testing/selftests/arm64/Makefile | 11 +++++++++++
.../testing/selftests/arm64/run_tags_test.sh | 12 ++++++++++++
tools/testing/selftests/arm64/tags_test.c | 19 +++++++++++++++++++
10 files changed, 67 insertions(+), 7 deletions(-)
create mode 100644 tools/testing/selftests/arm64/.gitignore
create mode 100644 tools/testing/selftests/arm64/Makefile
create mode 100755 tools/testing/selftests/arm64/run_tags_test.sh
create mode 100644 tools/testing/selftests/arm64/tags_test.c
--
2.18.0.rc1.244.gcf134e6275-goog
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
arm64 has a feature called Top Byte Ignore, which allows to embed pointer
tags into the top byte of each pointer. Userspace programs (such as
HWASan, a memory debugging tool [1]) might use this feature and pass
tagged user pointers to the kernel through syscalls or other interfaces.
This patch makes a few of the kernel interfaces accept tagged user
pointers. The kernel is already able to handle user faults with tagged
pointers and has the untagged_addr macro, which this patchset reuses.
Thanks!
[1] http://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html
Changes in v5:
- Added 3 new patches that add untagging to places found with static
analysis.
- Rebased onto 44c929e1 (4.18-rc8).
Changes in v4:
- Added a selftest for checking that passing tagged pointers to the
kernel succeeds.
- Rebased onto 81e97f013 (4.18-rc1+).
Changes in v3:
- Rebased onto e5c51f30 (4.17-rc6+).
- Added linux-arch@ to the list of recipients.
Changes in v2:
- Rebased onto 2d618bdf (4.17-rc3+).
- Removed excessive untagging in gup.c.
- Removed untagging pointers returned from __uaccess_mask_ptr.
Changes in v1:
- Rebased onto 4.17-rc1.
Changes in RFC v2:
- Added "#ifndef untagged_addr..." fallback in linux/uaccess.h instead of
defining it for each arch individually.
- Updated Documentation/arm64/tagged-pointers.txt.
- Dropped "mm, arm64: untag user addresses in memory syscalls".
- Rebased onto 3eb2ce82 (4.16-rc7).
Andrey Konovalov (10):
arm64: add type casts to untagged_addr macro
uaccess: add untagged_addr definition for other arches
arm64: untag user addresses in access_ok and __uaccess_mask_ptr
mm, arm64: untag user addresses in mm/gup.c
lib, arm64: untag addrs passed to strncpy_from_user and strnlen_user
arm64: untag user address in __do_user_fault
fs, arm64: untag user address in copy_mount_options
usb, arm64: untag user addresses in devio
arm64: update Documentation/arm64/tagged-pointers.txt
selftests, arm64: add a selftest for passing tagged pointers to kernel
Documentation/arm64/tagged-pointers.txt | 5 +++--
arch/arm64/include/asm/uaccess.h | 14 +++++++++-----
arch/arm64/mm/fault.c | 2 +-
drivers/usb/core/devio.c | 8 +++++---
fs/namespace.c | 2 +-
include/linux/uaccess.h | 4 ++++
lib/strncpy_from_user.c | 2 ++
lib/strnlen_user.c | 2 ++
mm/gup.c | 4 ++++
tools/testing/selftests/arm64/.gitignore | 1 +
tools/testing/selftests/arm64/Makefile | 11 +++++++++++
.../testing/selftests/arm64/run_tags_test.sh | 12 ++++++++++++
tools/testing/selftests/arm64/tags_test.c | 19 +++++++++++++++++++
13 files changed, 74 insertions(+), 12 deletions(-)
create mode 100644 tools/testing/selftests/arm64/.gitignore
create mode 100644 tools/testing/selftests/arm64/Makefile
create mode 100755 tools/testing/selftests/arm64/run_tags_test.sh
create mode 100644 tools/testing/selftests/arm64/tags_test.c
--
2.18.0.597.ga71716f1ad-goog
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
This series goal is to avoid drivers from having ad-hoc code
to call .device_run in non-atomic context. Currently, .device_run
can be called via v4l2_m2m_job_finish(), potentially running
in interrupt context.
This series will be useful for the upcoming Request API, where drivers
typically require .device_run to be called in non-atomic context for
v4l2_ctrl_request_setup() calls.
The solution is to add a per-device worker that is scheduled
by v4l2_m2m_job_finish, which replaces drivers having a threaded interrupt
or similar.
This change allows v4l2_m2m_job_finish() to be called in interrupt
context, separating .device_run and v4l2_m2m_job_finish() contexts.
It's worth mentioning that v4l2_m2m_cancel_job() doesn't need
to flush or cancel the new worker, because the job_spinlock
synchronizes both and also because the core prevents simultaneous
jobs. Either v4l2_m2m_cancel_job() will wait for the worker, or the
worker will be unable to run a new job.
Testing
-------
In order to test the change, and make sure no regressions are
introduced, a kselftest test is added to stress the mem2mem framework.
Note that this series rework the kselftest media_tests target.
Those tests that need hardware and human intervention are now
marked as _EXTENDED, and a frontend script is added to run those
tests that can run without hardware or human intervention.
This will allow the media_tests target to be included in
automatic regression testing setups.
Hopefully, we will be able to introduce more and more automatic
regression tests. Currently, our self-test run looks like:
$ make TARGETS=media_tests kselftest
make[1]: Entering directory '/home/zeta/repos/builds/virtme-x86_64'
make[3]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
make[3]: Nothing to be done for 'all'.
make[3]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
TAP version 13
selftests: media_tests: m2m_job_test.sh
========================================
-------------------
running media tests
-------------------
media_device : no video4linux drivers loaded, vim2m is needed
not ok 1..1 selftests: media_tests: m2m_job_test.sh [SKIP]
make[1]: Leaving directory '/home/zeta/repos/builds/virtme-x86_64'
Ezequiel Garcia (3):
v4l2-mem2mem: Avoid v4l2_m2m_prepare_buf from scheduling a job
v4l2-mem2mem: Avoid calling .device_run in v4l2_m2m_job_finish
selftests: media_tests: Add a memory-to-memory concurrent stress test
Sakari Ailus (1):
v4l2-mem2mem: Simplify exiting the function in __v4l2_m2m_try_schedule
drivers/media/v4l2-core/v4l2-mem2mem.c | 72 +++--
.../testing/selftests/media_tests/.gitignore | 1 +
tools/testing/selftests/media_tests/Makefile | 5 +-
.../selftests/media_tests/m2m_job_test.c | 287 ++++++++++++++++++
.../selftests/media_tests/m2m_job_test.sh | 32 ++
5 files changed, 371 insertions(+), 26 deletions(-)
create mode 100644 tools/testing/selftests/media_tests/m2m_job_test.c
create mode 100755 tools/testing/selftests/media_tests/m2m_job_test.sh
--
2.18.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hello,
Here is a series of patches for improving ftracetest testcase
using gcov/lcov. It is still in progress, and I have got good
improvement of line/function coverage under kernel/trace with
this series. (Note that this kernel enables ftrace startup
tests)
Without this series
Lines: 10156 17200 59.0 %
Functions: 1069 1772 60.3 %
With this series
Lines: 11130 17200 64.7 %
Functions: 1185 1772 66.9 %
Of course we don't need to make it 100%, because ftracetest
is a function/specification test, and there are functions and
lines which never be called (like critical error detection :) ).
Also, ftrace has some amount of code for perf and bpf subsystem
which should be tested by perf/bpf tests.
However, GCOV(LCOV) gives us a good insight into which
functions are covered or not covered by the test cases.
This series has some ftracetest framework improvements too,
which are for debugging ftracetest itself.
Tracing/Gcov-kernel:
- Add CONFIG_GCOV_PROFILE_FRACE, which enables gcov profiling
only on tracing subsystem (under kernel/trace/). This may not
needed for everyone (like a debugging feature).
So it can be dropped anyway.
Ftracetest framework improvements:
- Add --stop-fail for detecting failure soon.
- Add --console for interactively debugging a testcase by shell.
- Add testcase-number prefix to logfile for finding log easier.
- Improve general init function
- Call general init function after all testcases.
- Remove init/cleanup code from all testcase (since general init
function will fixed it up)
Testcase fixes:
- Fix to check $comm availability.
- Make checkbashisms clean
Testcase improvements:
- Use loopback address instead of localhost
- Improve kprobe on module testcase to load/unload module
- Improve kprobe testcase to check log data
- Improve kretprobe testcase to check log data
- Test kprobe-event argument with various bitsize
- Check set_event_pid result
Adding testcases:
- Add kprobe event with $comm argument testcase
- Add kprobe profile testcase
- Add kprobe-event with symbol argument test
- Add nop tracer testcase
- Add trace_printk sample module testcase
- Add ringbuffer size changing testcase
- Add function profiling statistics testcase
- Add max stack tracer testcase
- Add function filter on module testcase
- Add trace_pipe testcase
TBD:
Following testcase improvements are remaining.
- Checking of various supported types (like u8, u64 etc.)
testcases
- Filter actions for ftrace testcases
Thank you,
---
Masami Hiramatsu (25):
tracing: Allow gcov profiling on only ftrace subsystem
selftests/ftrace: Add --stop-fail hidden option for debug
selftests/ftrace: Add --console hidden option
selftests/ftrace: Add case number prefix to logfile
selftests/ftrace: More initialize features in initialize_ftrace
selftests/ftrace: Cleanup ftrace after running test
selftests/ftrace: Remove unneeded per-test init/cleanup ftrace
selftests/ftrace: Fix to test kprobe $comm arg only if available
selftests/ftrace: Fix checkbashisms errors
selftests/ftrace: Use loopback address instead of localhost
selftests/ftrace: Improve kprobe on module testcase to load/unload module
selftests/ftrace: Improve kprobe testcase to check log data
selftests/ftrace: Improve kretprobe testcase to check log data
selftests/ftrace: Test kprobe-event argument with various bitsize
selftests/ftrace: Check set_event_pid result
selftests/ftrace: Add kprobe event with $comm argument testcase
selftests/ftrace: Add kprobe profile testcase
selftests/ftrace: Add a testcase for nop tracer
selftests/ftrace: Add kprobe-event with symbol argument test
selftests/ftrace: Add trace_printk sample module test
selftests/ftrace: Add ringbuffer size changing testcase
selftests/ftrace: Add function profiling stat testcase
selftests/ftrace: Add max stack tracer testcase
selftests/ftrace: Add function filter on module testcase
selftests/ftrace: Add trace_pipe testcase
kernel/trace/Kconfig | 13 +++++
kernel/trace/Makefile | 5 ++
tools/testing/selftests/ftrace/config | 5 ++
tools/testing/selftests/ftrace/ftracetest | 32 +++++++++++-
.../ftrace/test.d/00basic/ringbuffer_size.tc | 21 ++++++++
.../selftests/ftrace/test.d/00basic/trace_pipe.tc | 15 ++++++
.../selftests/ftrace/test.d/event/event-enable.tc | 8 ---
.../selftests/ftrace/test.d/event/event-pid.tc | 6 +-
.../ftrace/test.d/event/subsystem-enable.tc | 8 ---
.../ftrace/test.d/event/toplevel-enable.tc | 8 ---
.../selftests/ftrace/test.d/event/trace_printk.tc | 27 ++++++++++
.../ftrace/test.d/ftrace/fgraph-filter-stack.tc | 4 --
.../ftrace/test.d/ftrace/fgraph-filter.tc | 9 ---
.../ftrace/test.d/ftrace/func-filter-pid.tc | 8 ---
.../ftrace/test.d/ftrace/func_event_triggers.tc | 3 -
.../ftrace/test.d/ftrace/func_mod_trace.tc | 24 +++++++++
.../ftrace/test.d/ftrace/func_profile_stat.tc | 23 +++++++++
.../ftrace/test.d/ftrace/func_profiler.tc | 4 --
.../ftrace/test.d/ftrace/func_set_ftrace_file.tc | 13 -----
.../ftrace/test.d/ftrace/func_stack_tracer.tc | 39 +++++++++++++++
.../test.d/ftrace/func_traceonoff_triggers.tc | 11 ----
tools/testing/selftests/ftrace/test.d/functions | 4 ++
.../ftrace/test.d/kprobe/add_and_remove.tc | 3 -
.../selftests/ftrace/test.d/kprobe/busy_check.tc | 3 -
.../selftests/ftrace/test.d/kprobe/kprobe_args.tc | 8 ++-
.../ftrace/test.d/kprobe/kprobe_args_comm.tc | 17 +++++++
.../ftrace/test.d/kprobe/kprobe_args_string.tc | 5 --
.../ftrace/test.d/kprobe/kprobe_args_symbol.tc | 39 +++++++++++++++
.../ftrace/test.d/kprobe/kprobe_args_syntax.tc | 8 +--
.../ftrace/test.d/kprobe/kprobe_args_type.tc | 52 ++++++++++++--------
.../ftrace/test.d/kprobe/kprobe_eventname.tc | 5 --
.../ftrace/test.d/kprobe/kprobe_ftrace.tc | 9 ---
.../ftrace/test.d/kprobe/kprobe_module.tc | 36 ++++++++++++--
.../ftrace/test.d/kprobe/kretprobe_args.tc | 9 ++-
.../ftrace/test.d/kprobe/kretprobe_maxactive.tc | 4 --
.../ftrace/test.d/kprobe/multiple_kprobes.tc | 5 --
.../selftests/ftrace/test.d/kprobe/probepoint.tc | 4 --
.../selftests/ftrace/test.d/kprobe/profile.tc | 15 ++++++
.../testing/selftests/ftrace/test.d/tracer/nop.tc | 22 ++++++++
.../inter-event/trigger-extended-error-support.tc | 12 -----
.../inter-event/trigger-field-variable-support.tc | 15 ------
.../trigger-inter-event-combined-hist.tc | 15 ------
.../inter-event/trigger-multi-actions-accept.tc | 14 -----
.../inter-event/trigger-onmatch-action-hist.tc | 15 ------
.../trigger-onmatch-onmax-action-hist.tc | 15 ------
.../inter-event/trigger-onmax-action-hist.tc | 15 ------
.../trigger-synthetic-event-createremove.tc | 12 -----
.../ftrace/test.d/trigger/trigger-eventonoff.tc | 12 -----
.../ftrace/test.d/trigger/trigger-filter.tc | 14 -----
.../ftrace/test.d/trigger/trigger-hist-mod.tc | 12 -----
.../ftrace/test.d/trigger/trigger-hist.tc | 12 -----
.../ftrace/test.d/trigger/trigger-multihist.tc | 16 ------
.../ftrace/test.d/trigger/trigger-snapshot.tc | 12 -----
.../ftrace/test.d/trigger/trigger-stacktrace.tc | 12 -----
.../test.d/trigger/trigger-trace-marker-hist.tc | 11 ----
.../trigger/trigger-trace-marker-snapshot.tc | 16 +-----
.../trigger-trace-marker-synthetic-kernel.tc | 12 -----
.../trigger/trigger-trace-marker-synthetic.tc | 12 -----
.../ftrace/test.d/trigger/trigger-traceonoff.tc | 12 -----
59 files changed, 388 insertions(+), 412 deletions(-)
create mode 100644 tools/testing/selftests/ftrace/test.d/00basic/ringbuffer_size.tc
create mode 100644 tools/testing/selftests/ftrace/test.d/00basic/trace_pipe.tc
create mode 100644 tools/testing/selftests/ftrace/test.d/event/trace_printk.tc
create mode 100644 tools/testing/selftests/ftrace/test.d/ftrace/func_mod_trace.tc
create mode 100644 tools/testing/selftests/ftrace/test.d/ftrace/func_profile_stat.tc
create mode 100644 tools/testing/selftests/ftrace/test.d/ftrace/func_stack_tracer.tc
create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_comm.tc
create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_symbol.tc
create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/profile.tc
create mode 100644 tools/testing/selftests/ftrace/test.d/tracer/nop.tc
--
Masami Hiramatsu (Linaro)
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
After IPv4 packets are forwarded, the priority of the corresponding SKB
is updated according to the TOS field of IPv4 header. This overrides any
prioritization done earlier by e.g. an skbedit action or ingress-qos-map
defined at a vlan device.
Such overriding may not always be desirable. Even if the packet ends up
being routed, which implies this is an L3 network node, an administrator
may wish to preserve whatever prioritization was done earlier on in the
pipeline.
Therefore this patch set introduces a sysctl that controls this
behavior, net.ipv4.ip_forward_update_priority. It's value is 1 by
default to preserve the current behavior.
All of the above is implemented in patch #1.
Value changes prompt a new NETEVENT_IPV4_FWD_UPDATE_PRIORITY_UPDATE
notification, so that the drivers can hook up whatever logic may depend
on this value. That is implemented in patch #2.
In patches #3 and #4, mlxsw is adapted to recognize the sysctl. On
initialization, the RGCR register that handles router configuration is
set in accordance with the sysctl. The new notification is listened to
and RGCR is reconfigured as necessary.
In patches #5 to #7, a selftest is added to verify that mlxsw reflects
the sysctl value as necessary. The test is expressed in terms of the
recently-introduced ieee_setapp support, and works by observing how DSCP
value gets rewritten depending on packet priority. For this reason, the
test is added to the subdirectory drivers/net/mlxsw. Even though it's
not particularly specific to mlxsw, it's not suitable for running on
soft devices (which don't support the ieee_setapp et.al.).
Changes from v1 to v2:
- In patch #1, init sysctl_ip_fwd_update_priority to 1 instead of true.
Changes from RFC to v1:
- Fix wrong sysctl name in ip-sysctl.txt
- Add notifications
- Add mlxsw support
- Add self test
Petr Machata (7):
net: ipv4: Control SKB reprioritization after forwarding
net: ipv4: Notify about changes to ip_forward_update_priority
mlxsw: spectrum: Extract work-scheduling into a new function
mlxsw: spectrum_router: Handle sysctl_ip_fwd_update_priority
selftests: forwarding: Move lldpad waiting to lib.sh
selftests: forwarding: Move DSCP capture to lib.sh
selftests: mlxsw: Add test for ip_forward_update_priority
Documentation/networking/ip-sysctl.txt | 9 +
.../net/ethernet/mellanox/mlxsw/spectrum_router.c | 56 +++--
include/net/netevent.h | 1 +
include/net/netns/ipv4.h | 1 +
net/ipv4/af_inet.c | 1 +
net/ipv4/ip_forward.c | 3 +-
net/ipv4/sysctl_net_ipv4.c | 26 +++
.../selftests/drivers/net/mlxsw/qos_dscp_bridge.sh | 65 +-----
.../selftests/drivers/net/mlxsw/qos_dscp_router.sh | 233 +++++++++++++++++++++
tools/testing/selftests/net/forwarding/lib.sh | 63 ++++++
10 files changed, 379 insertions(+), 79 deletions(-)
create mode 100755 tools/testing/selftests/drivers/net/mlxsw/qos_dscp_router.sh
--
2.4.11
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html