]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: forwarding: lib: Avoid trapping soft devices
authorPetr Machata <petrm@mellanox.com>
Thu, 28 Jun 2018 16:56:28 +0000 (18:56 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 30 Jun 2018 11:34:09 +0000 (20:34 +0900)
commit70f081b5e92c4870e71bea6ba64eef1f795e9ddf
tree99f108fd14c6a97daf0b93d466f8ae92150da6c8
parentf400162a1599e5a5d3b3bd5f8741da400d659af1
selftests: forwarding: lib: Avoid trapping soft devices

There are several cases where traffic that would normally be forwarded
in silicon needs to be observed in slow path. That's achieved by
trapping such traffic, and the functions trap_install() and
trap_uninstall() realize that. However, such treatment is obviously
wrong if the device in question is actually a soft device not backed by
an ASIC.

Therefore try to trap if possible, but fall back to inserting a continue
if not.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/forwarding/lib.sh