[PATCH net-next v2 8/8] selftests: mlxsw: Add a new test extack.sh

2018-12-06 Thread Petr Machata
Add a testsuite dedicated to testing extack propagation and related functionality. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel --- .../testing/selftests/drivers/net/mlxsw/extack.sh | 84 ++ 1 file changed, 84 insertions(+) create mode

[PATCH net-next v2 6/8] net: core: dev: Add call_netdevice_notifiers_extack()

2018-12-06 Thread Petr Machata
In order to propagate extack through NETDEV_PRE_UP, add a new function call_netdevice_notifiers_extack() that primes the extack field of the notifier info. Convert call_netdevice_notifiers() to a simple wrapper around the new function that passes NULL for extack. Signed-off-by: Petr Machata

[PATCH net-next v2 7/8] net: core: dev: Attach extack to NETDEV_PRE_UP

2018-12-06 Thread Petr Machata
__dev_change_flags() and dev_open(), where it was propagated in the previous patches. Change __dev_open() to call call_netdevice_notifiers_extack() so that the passed-in extack is attached to the NETDEV_PRE_UP notifier. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Reviewed

[PATCH net-next v2 5/8] net: core: dev: Add extack argument to __dev_change_flags()

2018-12-06 Thread Petr Machata
existing users. Since the function declaration line is changed anyway, name the struct net_device argument to placate checkpatch. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Reviewed-by: David Ahern --- include/linux/netdevice.h | 3 ++- net/core/dev.c

[PATCH net-next v2 4/8] net: core: dev: Add extack argument to dev_change_flags()

2018-12-06 Thread Petr Machata
extack argument and update all users. Most of the calls end up just encoding NULL, but several sites (VLAN, ipvlan, VRF, rtnetlink) do have extack available. Since the function declaration line is changed anyway, name the other function arguments to placate checkpatch. Signed-off-by: Petr Machata

[PATCH net-next v2 3/8] net: ipvlan: ipvlan_set_port_mode(): Add an extack argument

2018-12-06 Thread Petr Machata
A follow-up patch will extend dev_change_flags() with an extack argument. Extend ipvlan_set_port_mode() to have that argument available for the conversion. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel --- drivers/net/ipvlan/ipvlan_main.c | 7 --- 1 file

[PATCH net-next v2 2/8] net: vrf: cycle_netdev(): Add an extack argument

2018-12-06 Thread Petr Machata
A follow-up patch will extend dev_change_flags() with an extack argument. Extend cycle_netdev() to have that argument available for the conversion. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Reviewed-by: David Ahern --- drivers/net/vrf.c | 7 --- 1 file

[PATCH net-next v2 1/8] net: core: dev: Add extack argument to dev_open()

2018-12-06 Thread Petr Machata
and update all users. Most of the calls end up just encoding NULL, but bond and team drivers have the extack readily available. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Reviewed-by: David Ahern --- drivers/net/bonding/bond_main.c | 2

[PATCH net-next v2 0/8] Pass extack to NETDEV_PRE_UP

2018-12-06 Thread Petr Machata
ttl 200 # ip link set dev vx2 up Error: mlxsw_spectrum: Conflicting NVE tunnels configuration. v2: - Add David Ahern's tags. Petr Machata (8): net: core: dev: Add extack argument to dev_open() net: vrf: cycle_netdev(): Add an extack argument net: ipvlan: ipvlan_set_port_mode(): Add

Re: [PATCH net-next 0/8] Pass extack to NETDEV_PRE_UP

2018-12-05 Thread Petr Machata
David Miller writes: > Your CC list is so huge that vger.kernel.org dropped all of your postings. > > That CC list is not reasonable at all, trim it down to the most minimum > set. Probably 2 or 3 mailing lists, primarily netdev, and maybe a small > handful of specific developers. > > Nothing

[PATCH iproute2 2/2] testsuite: Add a test for batch processing

2018-12-04 Thread Petr Machata
Test that when a second or following command in a batch fails, tc reports it correctly. This is a test for the previous patch. Signed-off-by: Petr Machata --- testsuite/tests/tc/batch.t | 23 +++ 1 file changed, 23 insertions(+) create mode 100755 testsuite/tests/tc/batch.t

[PATCH iproute2 1/2] libnetlink: Process further iovs on no error

2018-12-04 Thread Petr Machata
When no error is reported in the first iov, do not prematurely return, but process further iovs. This fixes batch processing. Fixes: c60389e4f9ea ("libnetlink: fix leak and using unused memory on error") Signed-off-by: Petr Machata --- lib/libnetlink.c | 3 +++ 1 file changed, 3

Re: [PATCH net-next 00/12] switchdev: Convert switchdev_port_obj_{add,del}() to notifiers

2018-11-22 Thread Petr Machata
Petr Machata writes: > An offloading driver may need to have access to switchdev events on > ports that aren't directly under its control. An example is a VXLAN port > attached to a bridge offloaded by a driver. The driver needs to know > about VLANs configured on the VXLAN dev

[PATCH net-next 12/12] rocker, dsa, ethsw: Don't filter VLAN events on bridge itself

2018-11-22 Thread Petr Machata
Due to an explicit check in rocker_world_port_obj_vlan_add(), dsa_slave_switchdev_event() resp. port_switchdev_event(), VLAN objects that are added to a device that is not a front-panel port device are ignored. Therefore this check is immaterial. Signed-off-by: Petr Machata Acked-by: Jiri Pirko

[PATCH net-next 11/12] switchdev: Replace port obj add/del SDO with a notification

2018-11-22 Thread Petr Machata
. Update switchdev_port_obj_del_now() to dispatch to this new function. Drop __switchdev_port_obj_add() and update switchdev_port_obj_add() likewise. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- .../ethernet/mellanox/mlxsw/spectrum_switchdev.c | 2 - drivers/net/ethernet/mscc/ocelot.c

[PATCH net-next 10/12] ocelot: Handle SWITCHDEV_PORT_OBJ_ADD/_DEL

2018-11-22 Thread Petr Machata
through switchdev_handle_port_obj_add() / _del() to handle the recursive descend, because Ocelot supports LAG uppers. Register to the new switchdev blocking notifier chain to get the new events when they start getting distributed. Signed-off-by: Petr Machata Acked-by: Jiri Pirko --- drivers/net

[PATCH net-next 09/12] mlxsw: spectrum_switchdev: Handle SWITCHDEV_PORT_OBJ_ADD/_DEL

2018-11-22 Thread Petr Machata
the behavior that the switchdev operation based code currently has. Defer to switchdev_handle_port_obj_add() / _del() to handle the recursive descend, because mlxsw supports a number of upper types. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- .../ethernet/mellanox/mlxsw/spectrum_switchdev.c

[PATCH net-next 08/12] switchdev: Add helpers to aid traversal through lower devices

2018-11-22 Thread Petr Machata
shed under one master, a scenario that switchdev currently happily supports. Therefore tolerate any and all unknown netdevices, whether they are backed by a switchdev driver or not. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- include/net/switchdev.h | 33 +++ net

[PATCH net-next 07/12] staging: fsl-dpaa2: ethsw: Handle SWITCHDEV_PORT_OBJ_ADD/_DEL

2018-11-22 Thread Petr Machata
case is that the notification is on a front-panel port netdevice. To handle SWITCHDEV_PORT_OBJ_ADD and _DEL, subscribe to the blocking notifier chain. Dispatch to swdev_port_obj_add() resp. _del() to maintain the behavior that the switchdev operation based code currently has. Signed-off-by: Petr

[PATCH net-next 04/12] rocker: Handle SWITCHDEV_PORT_OBJ_ADD/_DEL

2018-11-22 Thread Petr Machata
to the blocking notifier chain. In the handler, filter out notifications on any foreign netdevices. Dispatch the new notifiers to rocker_port_obj_add() resp. _del() to maintain the behavior that the switchdev operation based code currently has. Signed-off-by: Petr Machata Acked-by: Jiri Pirko

[PATCH net-next 06/12] staging: fsl-dpaa2: ethsw: Introduce ethsw_port_dev_check()

2018-11-22 Thread Petr Machata
ethsw currently uses an open-coded comparison of netdev_ops to determine whether whether a device represents a front panel port. Wrap this into a named function to simplify reuse. Signed-off-by: Petr Machata Acked-by: Jiri Pirko --- drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 7 ++- 1 file

[PATCH net-next 05/12] net: dsa: slave: Handle SWITCHDEV_PORT_OBJ_ADD/_DEL

2018-11-22 Thread Petr Machata
that the switchdev operation based code currently has. Signed-off-by: Petr Machata Acked-by: Jiri Pirko --- net/dsa/slave.c | 56 1 file changed, 56 insertions(+) diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 7d0c19e7edcf..d00a0b6d4ce0 100644

[PATCH net-next 02/12] switchdev: Add a blocking notifier chain

2018-11-22 Thread Petr Machata
the notifications for which a blocking context can be assumed. Signed-off-by: Petr Machata Reviewed-by: Jiri Pirko Reviewed-by: Ido Schimmel --- include/net/switchdev.h | 27 +++ net/switchdev/switchdev.c | 26 ++ 2 files changed, 53 insertions(+) diff --git

[PATCH net-next 01/12] switchdev: SWITCHDEV_OBJ_PORT_{VLAN, MDB}(): Sanitize

2018-11-22 Thread Petr Machata
ides with the member name) to "OBJ". Additionally, instead of passing "OBJ" to container_of() verbatim, parenthesize it, so that a comma in the passed-in expression doesn't pollute the container_of() invocation. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Sc

[PATCH net-next 03/12] switchdev: Add SWITCHDEV_PORT_OBJ_ADD, SWITCHDEV_PORT_OBJ_DEL

2018-11-22 Thread Petr Machata
are kept in place. Following patches first convert individual clients to the notifier protocol, and only then are the operations removed. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel --- include/net/switchdev.h | 10 ++ 1 file changed, 10 insertions(+) diff

[PATCH net-next 00/12] switchdev: Convert switchdev_port_obj_{add,del}() to notifiers

2018-11-22 Thread Petr Machata
Therefore remove it in patch #12. Petr Machata (12): switchdev: SWITCHDEV_OBJ_PORT_{VLAN, MDB}(): Sanitize switchdev: Add a blocking notifier chain switchdev: Add SWITCHDEV_PORT_OBJ_ADD, SWITCHDEV_PORT_OBJ_DEL rocker: Handle SWITCHDEV_PORT_OBJ_ADD/_DEL net: dsa: slave: Handle SWITCHDEV_PO

[PATCH net] net: skb_scrub_packet(): Scrub offload_fwd_mark

2018-11-20 Thread Petr Machata
uot;skbuff: Add the offload_mr_fwd_mark field") Signed-off-by: Petr Machata Suggested-by: Ido Schimmel --- net/core/skbuff.c | 5 + 1 file changed, 5 insertions(+) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index b4ee5c8b928f..a8217e221e19 100644 --- a/net/core/skbuff.c +++

Re: [PATCH net-next 01/18] net: skb_scrub_packet(): Scrub offload_fwd_mark

2018-11-19 Thread Petr Machata
David Miller writes: > From: Ido Schimmel > Date: Mon, 19 Nov 2018 16:11:07 + > >> From: Petr Machata >> >> When a packet is trapped and the corresponding SKB marked as >> already-forwarded, it retains this marking even after it is forwarded >>

Re: [PATCH net-next 18/18] selftests: mlxsw: Add a test for VxLAN flooding

2018-11-19 Thread Petr Machata
t; > Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata

Re: [PATCH net-next 17/18] selftests: mlxsw: Add a test for VxLAN configuration

2018-11-19 Thread Petr Machata
Ido Schimmel writes: > Test various aspects of VxLAN offloading which are specific to mlxsw, > such as sanitization of invalid configurations and offload indication. > > Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata

Re: [PATCH net-next] mlxsw: Make MLXSW_SP1_FWREV_MINOR a hard requirement

2018-09-24 Thread Petr Machata
Ido Schimmel writes: > On Mon, Sep 24, 2018 at 12:04:17AM +0200, Andrew Lunn wrote: >> But doesn't that mean you reflash the device with the minimum version, >> when in fact there could be a much newer version in /lib/firmware? > > No, because we always enforce the latest version we post to >

[PATCH net] mlxsw: spectrum_buffers: Set up a dedicated pool for BUM traffic

2018-09-05 Thread Petr Machata
s admitted to the egress buffer. Fix the configuration by directing the MC TCs into pool 15, which is dedicated to MC traffic and recognized as such by the silicon. Fixes: 7b8195306694 ("mlxsw: spectrum: Configure MC-aware mode on mlxsw ports") Signed-off-by: Petr Machata Acked-by: Jiri Pir

Re: [pull request][net-next 00/10] Mellanox, mlx5 and devlink updates 2018-07-31

2018-08-02 Thread Petr Machata
David Miller writes: > From: Jakub Kicinski > Date: Thu, 2 Aug 2018 10:11:12 -0700 > >> On Thu, 02 Aug 2018 11:29:12 +0300, Petr Machata wrote: >>> Could you please clarify your remark? >> >> Oh, I think David meant the patches I was objecting to a w

Re: [pull request][net-next 00/10] Mellanox, mlx5 and devlink updates 2018-07-31

2018-08-02 Thread Petr Machata
David Miller writes: > From: Jakub Kicinski > Date: Wed, 1 Aug 2018 17:00:47 -0700 > >> On Wed, 1 Aug 2018 14:52:45 -0700, Saeed Mahameed wrote: >>> - According to the discussion outcome, we are keeping the congestion control >>> setting as mlx5 device specific for the current HW generation.

[PATCH net-next 0/5] A test for mirror-to-gretap with team in UL packet path

2018-07-30 Thread Petr Machata
eam device is on egress path of a mirrored packet in a mirror-to-gretap scenario. In the first one, the team device is in loadbalance mode, in the second one it's in lacp mode. (The difference in modes necessitates a different testing strategy, hence two test cases instead of just parameterizing one.) Petr

[PATCH net-next 3/5] selftests: forwarding: Introduce $ARPING

2018-07-30 Thread Petr Machata
Instead of relying on "arping" being installed everywhere under that name, introduce a variable $ARPING like the other tools do. Convert an existing test, mirror_gre_vlan_bridge_1q.sh to require_command $ARPING and then invoke arping through the variable. Signed-off-by: Petr Machata

[PATCH net-next 5/5] selftests: forwarding: Test mirror-to-gretap w/ UL team LACP

2018-07-30 Thread Petr Machata
of a device. Signed-off-by: Petr Machata --- .../net/forwarding/mirror_gre_lag_lacp.sh | 285 + 1 file changed, 285 insertions(+) create mode 100755 tools/testing/selftests/net/forwarding/mirror_gre_lag_lacp.sh diff --git a/tools/testing/selftests/net/forwarding

[PATCH net-next 4/5] selftests: forwarding: Test mirror-to-gretap w/ UL team

2018-07-30 Thread Petr Machata
Signed-off-by: Petr Machata --- .../net/forwarding/mirror_gre_bridge_1q_lag.sh | 283 + 1 file changed, 283 insertions(+) create mode 100755 tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q_lag.sh diff --git a/tools/testing/selftests/net/

[PATCH net-next 2/5] selftests: forwarding: lib: Support team devices

2018-07-30 Thread Petr Machata
Add team_create() and team_destroy() to manage team netdevices. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 23 +++ 1 file changed, 23 insertions(+) diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net

[PATCH net-next 1/5] selftests: forwarding: lib: Add require_command()

2018-07-30 Thread Petr Machata
any test that wishes to declare dependence on some command. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing

[PATCH net-next] selftests: mlxsw: qos_dscp_bridge: Fix

2018-07-27 Thread Petr Machata
value). In combination these two bugs conspire to make the test just work, except it doesn't really test anything and always passes. Fix the above two problems in obvious manner. Signed-off-by: Petr Machata --- tools/testing/selftests/drivers/net/mlxsw/qos_dscp_bridge.sh | 4 ++-- 1 file changed

Re: [PATCH net-next] net: dcb: add DSCP to comment about priority selector types

2018-07-27 Thread Petr Machata
y: Jakub Kicinski Reviewed-by: Petr Machata

[PATCH net-next] selftests: forwarding: gre_multipath: Drop IPv6 tests

2018-07-23 Thread Petr Machata
hop like that yield an explicit diagnostic. Correspondingly, drop the IPv6 parts of GRE multipath test that are supposed to test that code. Signed-off-by: Petr Machata --- .../selftests/net/forwarding/gre_multipath.sh | 113 ++--- 1 file changed, 6 insertions(+), 107 deletions(-)

[PATCH net-next] selftests: forwarding: mirror_gre_nh: Unset rp_filter on host VRF

2018-07-10 Thread Petr Machata
on the VRF rejects it. Therefore turn off the VRF's RP filter. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/mirror_gre_nh.sh | 4 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_nh.sh b/tools/testing/selftests/net/forwarding

[PATCH net-next] selftests: forwarding: mirror_lib: Tighten up VLAN capture

2018-07-08 Thread Petr Machata
test_gretap_untagged_egress. Decreasing ping cadence in mirror_test() makes the problem easily reproducible. Therefore tighten up the match criterion to only count those 802.1q packets where the next header is IP. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/mirror_lib.sh | 2 +- 1 file

[PATCH net-next 1/2] selftests: forwarding: Allow importing dependent libraries

2018-07-05 Thread Petr Machata
to source their deps through $relative_path. That variable is set up by lib.sh, which should be imported by the test in question in any case. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/mirror_gre_lib.sh | 2 +- tools/testing/selftests/net/forwarding

[PATCH net-next 2/2] selftests: mlxsw: Add mlxsw-specific test for mirror to gretap

2018-07-05 Thread Petr Machata
Test several aspects of offloading mirror to gretap and ip6gretap netdevices that are specific to mlxsw, such as requirements for TTL and TOS values. Signed-off-by: Petr Machata Reviewed-by: Jiri Pirko --- .../selftests/drivers/net/mlxsw/mirror_gre.sh | 217 + 1 file

[PATCH net-next 0/2] Add a mlxsw-specific test for mirror-to-gretap

2018-07-05 Thread Petr Machata
/. In patch #2, add a test to check handling of several scenarios that mlxsw is expected to fail to offload. Petr Machata (2): selftests: forwarding: Allow importing dependent libraries selftests: mlxsw: Add mlxsw-specific test for mirror to gretap .../selftests/drivers/net/mlxsw

[PATCH net-next 2/2] selftests: forwarding: Test mirror-to-gretap w/ UL 802.1q

2018-07-02 Thread Petr Machata
Test for "tc action mirred egress mirror" that mirrors to gretap when the underlay route points at a VLAN-aware bridge (802.1q). Signed-off-by: Petr Machata --- .../net/forwarding/mirror_gre_bridge_1q.sh | 126 + 1 file changed, 126 insertions(+) create m

[PATCH net-next 1/2] selftests: forwarding: Test mirror-to-gretap w/ UL 802.1d

2018-07-02 Thread Petr Machata
Test for "tc action mirred egress mirror" that mirrors to gretap when the underlay route points at a VLAN-unaware bridge (802.1d). Signed-off-by: Petr Machata --- .../net/forwarding/mirror_gre_bridge_1d.sh | 132 + 1 file changed, 132 insertions(+) c

[PATCH net-next 0/2] More mirror-to-gretap tests with bridge in UL

2018-07-02 Thread Petr Machata
This patchset adds two more tests where the mirror-to-gretap has a bridge in underlay packet path, without a VLAN above or below that bridge. In patch #1, a non-VLAN-filtering bridge is tested. In patch #2, a VLAN-filtering bridge is tested. Petr Machata (2): selftests: forwarding: Test

[PATCH net-next 13/13] selftests: mlxsw: Add scale test for resources

2018-06-29 Thread Petr Machata
-off-by: Yuval Mintz Signed-off-by: Petr Machata --- .../drivers/net/mlxsw/spectrum/resource_scale.sh | 55 ++ 1 file changed, 55 insertions(+) create mode 100755 tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh diff --git a/tools/testing/selftests

[PATCH net-next 12/13] selftests: mlxsw: Add target for mirror-to-gretap test on spectrum

2018-06-29 Thread Petr Machata
Add a wrapper around mlxsw/mirror_gre_scale.sh that parameterized number of offloadable mirrors on Spectrum machines. Signed-off-by: Petr Machata Reviewed-by: Jiri Pirko --- .../drivers/net/mlxsw/spectrum/mirror_gre_scale.sh | 13 + 1 file changed, 13 insertions(+) create

[PATCH net-next 11/13] selftests: mlxsw: Add scale test for mirror-to-gretap

2018-06-29 Thread Petr Machata
Test that it's possible to offload a given number of mirrors. Signed-off-by: Petr Machata Reviewed-by: Jiri Pirko --- .../drivers/net/mlxsw/mirror_gre_scale.sh | 197 + 1 file changed, 197 insertions(+) create mode 100644 tools/testing/selftests/drivers/net/mlxsw

[PATCH net-next 10/13] selftests: mlxsw: Add target for tc flower test on spectrum

2018-06-29 Thread Petr Machata
Add a wrapper around mlxsw/tc_flower_scale.sh that parameterizes the generic tc flower scale test template with Spectrum-specific target values. Signed-off-by: Petr Machata Reviewed-by: Yuval Mintz --- .../drivers/net/mlxsw/spectrum/tc_flower_scale.sh | 19 +++ 1 file

[PATCH net-next 09/13] selftests: mlxsw: Add tc flower scale test

2018-06-29 Thread Petr Machata
Add test of capacity to offload flower. This is a generic portion of the test that is meant to be called from a driver that supplies a particular number of rules to be tested with. Signed-off-by: Petr Machata Reviewed-by: Yuval Mintz --- .../selftests/drivers/net/mlxsw/tc_flower_scale.sh

[PATCH net-next 08/13] selftests: mlxsw: Add target for router test on spectrum

2018-06-29 Thread Petr Machata
From: Yuval Mintz IPv4 routes in Spectrum are based on the kvd single-hash, but as it's a hash we need to assume we cannot reach 100% of its capacity. Add a wrapper that provides us with good/bad target numbers for the Spectrum ASIC. Signed-off-by: Yuval Mintz Reviewed-by: Petr Machata [pe

[PATCH net-next 07/13] selftests: mlxsw: Add router test

2018-06-29 Thread Petr Machata
Reviewed-by: Petr Machata Signed-off-by: Petr Machata --- .../selftests/drivers/net/mlxsw/router_scale.sh| 167 + 1 file changed, 167 insertions(+) create mode 100644 tools/testing/selftests/drivers/net/mlxsw/router_scale.sh diff --git a/tools/testing/selftests/drivers/net

[PATCH net-next 06/13] selftests: mlxsw: Add devlink KVD resource test

2018-06-29 Thread Petr Machata
to be provided first. Signed-off-by: Yuval Mintz [pe...@mellanox.com: Extracted two patches out of this patch. Tweaked commit message.] Signed-off-by: Petr Machata --- .../net/mlxsw/spectrum/devlink_resources.sh| 117 + 1 file changed, 117 insertions(+) create mode 100755

[PATCH net-next 05/13] selftests: mlxsw: Add devlink_lib_spectrum.sh

2018-06-29 Thread Petr Machata
-by: Petr Machata --- MAINTAINERS| 1 + .../net/mlxsw/spectrum/devlink_lib_spectrum.sh | 119 + 2 files changed, 120 insertions(+) create mode 100644 tools/testing/selftests/drivers/net/mlxsw/spectrum/devlink_lib_spectrum.sh diff

[PATCH net-next 04/13] selftests: forwarding: Add devlink_lib.sh

2018-06-29 Thread Petr Machata
This helper library contains wrappers to devlink functionality agnostic to the underlying device. Signed-off-by: Yuval Mintz [pe...@mellanox.com: Split this out from another patch.] Signed-off-by: Petr Machata --- .../selftests/net/forwarding/devlink_lib.sh| 108

[PATCH net-next 03/13] selftests: forwarding: lib: Parameterize NUM_NETIFS in two functions

2018-06-29 Thread Petr Machata
() and tc_offload_check() an optional parameter with a number of interfaces to probe. Fall back to global NUM_NETIFS if the parameter is not given. Signed-off-by: Petr Machata Reviewed-by: Yuval Mintz --- tools/testing/selftests/net/forwarding/lib.sh | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff

[PATCH net-next 01/13] selftests: forwarding: Allow lib.sh sourcing from other directories

2018-06-29 Thread Petr Machata
Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index d1f14f83979e..59272824ef37 100644

[PATCH net-next 02/13] selftests: forwarding: lib: Add check_err_fail()

2018-06-29 Thread Petr Machata
of the first argument, should_fail. Signed-off-by: Petr Machata Reviewed-by: Yuval Mintz --- tools/testing/selftests/net/forwarding/lib.sh | 13 + 1 file changed, 13 insertions(+) diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh

[PATCH net-next 00/13] mlxsw: Add resource scale tests

2018-06-29 Thread Petr Machata
a Spectrum-specific wrapper. Patch #13 then introduces a scale test driver that runs (possibly a subset of) the tests introduced by patches from previous paragraph. Arkadi Sharshevsky (1): selftests: mlxsw: Add router test Petr Machata (8): selftests: forwarding: lib: Add check_err_fail()

[PATCH net-next 4/4] selftests: forwarding: mirror_gre_changes: Fix waiting for neighbor

2018-06-28 Thread Petr Machata
When running the test on soft devices, there's no mechanism to gratuitously start resolving the neighbor for remote tunnel endpoint. So instead of passively waiting, wait for the device to be up, and then probe the neighbor with a ping. Signed-off-by: Petr Machata --- tools/testing/selftests

[PATCH net-next 3/4] selftests: forwarding: Tweak tc filters for mirror-to-gretap tests

2018-06-28 Thread Petr Machata
out GRE packet. Drop the corresponding condition. - Because the above fixes the filters to match in slow path as well, they need to be made skip_hw so as not to double-count packets. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d_vlan.sh | 6

[PATCH net-next 2/4] selftests: forwarding: lib: Avoid trapping soft devices

2018-06-28 Thread Petr Machata
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 --- tools/testing/selftests/net/forwarding/lib.sh | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git

[PATCH net-next 0/4] Fixes for running mirror-to-gretap tests on veth

2018-06-28 Thread Petr Machata
, installing a trap is made optional. In patch #3, tc filters in several tests are tweaked to work with veth. In patch #4, the logic for waiting for neighbor is fixed for veth. Petr Machata (4): selftests: forwarding: lib: Split out setup_wait_dev() selftests: forwarding: lib: Avoid trapping soft

[PATCH net-next 1/4] selftests: forwarding: lib: Split out setup_wait_dev()

2018-06-28 Thread Petr Machata
Split out of setup_wait() a function setup_wait_dev() that waits for a single device. This gives tests the opportunity to wait for a selected device after they tinkered with its upness. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 25

[PATCH net-next 6/6] selftests: forwarding: README: Require diagrams

2018-06-25 Thread Petr Machata
the interconnects from the script itself proves to be difficult. Therefore state the requirement for topology ASCII art in README. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- tools/testing/selftests/net/forwarding/README | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing

[PATCH net-next 3/6] selftests: forwarding: tc_rule_stats_get: Parameterize direction

2018-06-25 Thread Petr Machata
The GRE multipath tests need stats on an egress counter. Change tc_rule_stats_get() to take direction as an optional argument, with default of ingress. Take the opportunity to change line continuation character from | to \. Move the | to the next line, which indent. Signed-off-by: Petr Machata

[PATCH net-next 5/6] selftests: forwarding: Test multipath tunneling

2018-06-25 Thread Petr Machata
Add a GRE-tunneling test such that there are two tunnels involved, with a multipath route listing both as next hops. Similarly to router_multipath.sh, test that the distribution of traffic to the tunnels honors the configured weights. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel

[PATCH net-next 4/6] selftests: forwarding: lib: Extract interface-init functions

2018-06-25 Thread Petr Machata
and address de/initialization logic to a new pair of helpers __simple_if_init() / __simple_if_fini(), and defer to these helpers from simple_if_init() and simple_if_fini(). Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- tools/testing/selftests/net/forwarding/lib.sh | 32

[PATCH net-next 1/6] selftests: forwarding: Move multipath_eval() to lib.sh

2018-06-25 Thread Petr Machata
This function will be useful for the GRE multipath test that is coming later. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- tools/testing/selftests/net/forwarding/lib.sh | 39 ++ .../selftests/net/forwarding/router_multipath.sh | 39

[PATCH net-next 2/6] selftests: forwarding: multipath_eval(): Improve style

2018-06-25 Thread Petr Machata
- Change the indentation of the function body from 7 spaces to one tab. - Move initialization of weights_ratio up so that it can be referenced from the error message about packet difference being zero. - Move |'s consistently to continuation line, which reindent. Signed-off-by: Petr Machata

[PATCH net-next 0/6] Multipath tests for tunnel devices

2018-06-25 Thread Petr Machata
, a requirement to add diagrams to selftests is documented. Petr Machata (6): selftests: forwarding: Move multipath_eval() to lib.sh selftests: forwarding: multipath_eval(): Improve style selftests: forwarding: tc_rule_stats_get: Parameterize direction selftests: forwarding: lib: Extract

[PATCH net-next] selftests: forwarding: mirror_gre_vlan_bridge_1q: Unset rp_filter

2018-06-25 Thread Petr Machata
. Fixes: 9c7c8a82442c ("selftests: forwarding: mirror_gre_vlan_bridge_1q: Add more tests") Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- .../selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh| 9 + 1 file changed, 9 insertions(+) diff --git a/tools/testing

[PATCH net-next v2] selftests: net: Test headroom handling of ip6_gre devices

2018-06-25 Thread Petr Machata
two patches included snippets that reproduced the issues. This patch elevates the snippets to a full-fledged test case. Suggested-by: David Miller Signed-off-by: Petr Machata --- Notes: Changes between v1 and v2: - Move tunnel construction to setup() and destruction to cleanup(). too

Re: [PATCH net-next] selftests: forwarding: Fix importing dependent libraries

2018-06-05 Thread Petr Machata
Petr Machata writes: > When libraries are sourced from elsewhere from the tree, such as the > testing/selftests/drivers/net/mlxsw subdirectory, sourcing their own Sorry, I didn't realize the mirror_bridge.sh is not upstream yet. This patch is thus immaterial, it will be sent to

[PATCH net-next] selftests: forwarding: Fix importing dependent libraries

2018-06-05 Thread Petr Machata
, and source the file using relative path appropriate for the subdirectory. Fixes: d5ea2bfc806a ("selftests: forwarding: mirror_gre_lib: Extract generic functions") Fixes: 74ed089d48a4 ("selftests: forwarding: Split mirror_gre_topo_lib.sh") Signed-off-by: Petr Machata --- too

[PATCH net-next 2/2] selftests: forwarding: mirror_vlan: Change test description

2018-05-31 Thread Petr Machata
The test description is displayed with the PASS/FAIL resolution after the test is ran. There however already is one other test described exactly like this, which makes it unclear which of the tests passed or failed. Make the description unique. Signed-off-by: Petr Machata --- tools/testing

[PATCH net-next 0/2] selftests: forwarding: mirror_vlan: Fixlets

2018-05-31 Thread Petr Machata
in suite is renamed to differentiate it from another test of the same name. Petr Machata (2): selftests: forwarding: mirror_vlan: Uninstall trap selftests: forwarding: mirror_vlan: Change test description tools/testing/selftests/net/forwarding/mirror_vlan.sh | 4 ++-- 1 file changed, 2 insert

[PATCH net-next 1/2] selftests: forwarding: mirror_vlan: Uninstall trap

2018-05-31 Thread Petr Machata
Instead of installing a trap before tests run and uninstalling it after they run, mirror_vlan.sh installs it twice due to a typo. Fix the typo. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/mirror_vlan.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH net-next 9/9] selftests: forwarding: mirror_gre_bridge_1d_vlan: Add STP test

2018-05-31 Thread Petr Machata
To test offloading of mirror-to-gretap in mlxsw for cases that a VLAN-unaware bridge is in underlay packet path, test that the STP status of bridge egress port is reflected. Signed-off-by: Petr Machata --- .../selftests/net/forwarding/mirror_gre_bridge_1d_vlan.sh| 12 1 file

[PATCH net-next 8/9] selftests: forwarding: mirror_gre_vlan_bridge_1q: Add more tests

2018-05-31 Thread Petr Machata
that similarly check "egress untagged" - fdb_roaming tests that check whether learning FDB on a different port is reflected - stp tests for handling port STP status of bridge egress port Signed-off-by: Petr Machata --- .../net/forwarding/mirror_gre_vlan_bridge_1q.sh| 129 +++

[PATCH net-next 7/9] selftests: forwarding: mirror_gre_vlan_bridge_1q: Rename two tests

2018-05-31 Thread Petr Machata
Rename test_gretap_forbidden() and test_ip6gretap_forbidden() to a more specific test_gretap_forbidden_cpu() and test_ip6gretap_forbidden_cpu(). This will make it clearer which is which when further down a patch is introduced that forbids a VLAN on regular bridge port. Signed-off-by: Petr Machata

[PATCH net-next 6/9] selftests: forwarding: mirror_gre_vlan_bridge_1q: Test final config

2018-05-31 Thread Petr Machata
After the final change reestablishes the original configuration, make sure the traffic flows again as it should. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools

[PATCH net-next 5/9] selftests: forwarding: mirror_gre_vlan_bridge_1q: Fix tunnel name

2018-05-31 Thread Petr Machata
The "ip6gretap" in the test name refers to the tunnel device type that the test is supposed to be testing. However test_ip6gretap_forbidden() tests, due to a typo, a gretap tunnel. Fix the typo. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/mirror_gre_vlan_br

[PATCH net-next 0/9] Test mirror-to-gretap with bridge in UL

2018-05-31 Thread Petr Machata
. Petr Machata (9): selftests: forwarding: lib: Move here vlan_capture_{,un}install() selftests: forwarding: mirror_lib: Move here do_test_span_vlan_dir_ips() selftests: forwarding: mirror_lib: skip_hw the VLAN capture selftests: forwarding: mirror_gre_lib: Add STP test selftests

[PATCH net-next 4/9] selftests: forwarding: mirror_gre_lib: Add STP test

2018-05-31 Thread Petr Machata
Add a reusable full test that toggles STP state of a given bridge port and checks that the mirroring reacts appropriately. The test will be used by bridge tests in follow-up patches. Signed-off-by: Petr Machata --- .../selftests/net/forwarding/mirror_gre_lib.sh | 32

[PATCH net-next 3/9] selftests: forwarding: mirror_lib: skip_hw the VLAN capture

2018-05-31 Thread Petr Machata
When the VLAN capture is installed on a front panel device and not a soft device, the packets are counted twice: once in fast path, and once after they are trapped to the kernel. Resolve the problem by passing skip_hw flag to vlan_capture_install(). Signed-off-by: Petr Machata --- tools/testing

[PATCH net-next 2/9] selftests: forwarding: mirror_lib: Move here do_test_span_vlan_dir_ips()

2018-05-31 Thread Petr Machata
Move the function do_test_span_vlan_dir_ips() from mirror_vlan.sh test to a library file mirror_lib.sh to allow reuse. Fill in other entry points similar to other testing functions in mirror_lib.sh, they will be useful in following patches. Signed-off-by: Petr Machata --- .../testing/selftests

[PATCH net-next 1/9] selftests: forwarding: lib: Move here vlan_capture_{,un}install()

2018-05-31 Thread Petr Machata
Move vlan_capture_install() and vlan_capture_uninstall() from mirror_vlan.sh test to lib.sh so that it can be reused in other tests. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 23 ++ .../selftests/net/forwarding/mirror_vlan.sh

Re: [PATCH net-next] net: bridge: Lock before br_fdb_find()

2018-05-28 Thread Petr Machata
Nikolay Aleksandrov writes: > Fixes: 4d4fd36126d6 ("net: bridge: Publish bridge accessor functions") Correct. Thanks, Petr

[PATCH net-next] net: bridge: Lock before br_fdb_find()

2018-05-28 Thread Petr Machata
Callers of br_fdb_find() need to hold the hash lock, which br_fdb_find_port() doesn't do. Add the missing lock/unlock pair. Signed-off-by: Petr Machata <pe...@mellanox.com> --- net/bridge/br_fdb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/bridge/br_fdb.c b/net/bridge/br

[PATCH net-next v3 5/7] staging: fsl-dpaa2: ethsw: Ignore bridge VLAN events

2018-05-28 Thread Petr Machata
Ignore VLAN events where the orig_dev is the bridge device itself. Signed-off-by: Petr Machata <pe...@mellanox.com> --- drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2

[PATCH net-next v3 2/7] mlxsw: spectrum_switchdev: Ignore bridge VLAN events

2018-05-28 Thread Petr Machata
Ignore VLAN events where the orig_dev is the bridge device itself. Signed-off-by: Petr Machata <pe...@mellanox.com> Reviewed-by: Ido Schimmel <ido...@mellanox.com> --- drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a

[PATCH net-next v3 6/7] net: bridge: Notify about bridge VLANs

2018-05-28 Thread Petr Machata
port or a bridge. Signed-off-by: Petr Machata <pe...@mellanox.com> Reviewed-by: Florian Fainelli <f.faine...@gmail.com> Reviewed-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> Reviewed-by: Nikolay Aleksandrov <niko...@cumulusnetworks.com> Tested-by: Florian Fainel

[PATCH net-next v3 3/7] rocker: rocker_main: Ignore bridge VLAN events

2018-05-28 Thread Petr Machata
Ignore VLAN events where the orig_dev is the bridge device itself. Signed-off-by: Petr Machata <pe...@mellanox.com> --- drivers/net/ethernet/rocker/rocker_main.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/drivers/net/ethernet/

  1   2   3   >