Re: [patch net-next v4 6/6] selftests: virtio_net: add initial tests

2024-04-18 Thread Petr Machata
$ make -C tools/testing/selftests/ TARGETS=drivers/net/virtio_net/ run_tests > > Run it on a system with 2 virtio_net devices connected back-to-back > on the hypervisor. > > Signed-off-by: Jiri Pirko Reviewed-by: Petr Machata

Re: [patch net-next v4 5/6] selftests: forwarding: add wait_for_dev() helper

2024-04-18 Thread Petr Machata
i Pirko Reviewed-by: Petr Machata

Re: [patch net-next v4 3/6] selftests: forwarding: add ability to assemble NETIFS array by driver name

2024-04-18 Thread Petr Machata
> > Note that user overrides this either by passing netdevice names on the > command line or by declaring NETIFS array in custom forwarding.config > configuration file. > > Signed-off-by: Jiri Pirko Reviewed-by: Petr Machata

Re: [patch net-next v4 2/6] selftests: forwarding: move initial root check to the beginning

2024-04-18 Thread Petr Machata
Jiri Pirko writes: > From: Jiri Pirko > > This check can be done at the very beginning of the script. > As the follow up patch needs to add early code that needs to be executed > after the check, move it. > > Signed-off-by: Jiri Pirko Reviewed-by: Petr Machata

Re: [patch net-next v3 6/6] selftests: virtio_net: add initial tests

2024-04-18 Thread Petr Machata
gt; + > +initial_ping_test() > +{ > + cleanup All these cleanup() calls will end up possibly triggering PAUSE_ON_CLEANUP. Not sure that's intended. > + setup_prepare > + ping_test $h1 $H2_IPV4 " simple" > +} Other than this nit, LGTM. Reviewed-by: Petr Machata

Re: [patch net-next v3 3/6] selftests: forwarding: add ability to assemble NETIFS array by driver name

2024-04-18 Thread Petr Machata
Petr Machata writes: > Jiri Pirko writes: > >> +# Whether to find netdevice according to the specified driver. >> +: "${NETIF_FIND_DRIVER:=}" > > This would be better placed up there in the Topology description > section. Together with NETIFS and NETIF_NO_

Re: [patch net-next v3 5/6] selftests: forwarding: add wait_for_dev() helper

2024-04-18 Thread Petr Machata
Jiri Pirko writes: > From: Jiri Pirko > > The existing setup_wait*() helper family check the status of the > interface to be up. Introduce wait_for_dev() to wait for the netdevice > to appear, for example after test script does manual device bind. > > Signed-off-by: Jiri Pirko > --- > v1->v2:

Re: [patch net-next v3 4/6] selftests: forwarding: add check_driver() helper

2024-04-18 Thread Petr Machata
Jiri Pirko writes: > From: Jiri Pirko > > Add a helper to be used to check if the netdevice is backed by specified > driver. > > Signed-off-by: Jiri Pirko Reviewed-by: Petr Machata

Re: [patch net-next v3 3/6] selftests: forwarding: add ability to assemble NETIFS array by driver name

2024-04-18 Thread Petr Machata
Jiri Pirko writes: > From: Jiri Pirko > > Allow driver tests to work without specifying the netdevice names. > Introduce a possibility to search for available netdevices according to > set driver name. Allow test to specify the name by setting > NETIF_FIND_DRIVER variable. > > Note that user o

[PATCH net-next 08/10] mlxsw: spectrum_qdisc: Allocate child qdiscs dynamically

2021-04-20 Thread Petr Machata
to two cases: a new qdisc allocation and a change of existing qdisc. (Note that the change also includes what TC formally calls replace, if the qdisc kind is the same.) Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- .../ethernet/mellanox/mlxsw/spectrum_qdisc.c | 115

[PATCH net-next 10/10] selftests: mlxsw: sch_red_ets: Test proper counter cleaning in ETS

2021-04-20 Thread Petr Machata
There was a bug introduced during the rework which cause non-zero backlog being stuck at ETS. Introduce a selftest that would have caught the issue earlier. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- tools/testing/selftests/drivers/net/mlxsw/sch_red_ets.sh | 7 +++ 1 file

[PATCH net-next 09/10] mlxsw: spectrum_qdisc: Index future FIFOs by band number

2021-04-20 Thread Petr Machata
mlxsw used to hold an array of qdiscs indexed by the TC number. In the previous patch, it was changed to allocate child qdiscs dynamically, and they are now indexed by band number. Follow suit with the array of future FIFOs. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- .../net

[PATCH net-next 07/10] mlxsw: spectrum_qdisc: Guard all qdisc accesses with a lock

2021-04-20 Thread Petr Machata
will guard accesses to the qdisc state. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- .../ethernet/mellanox/mlxsw/spectrum_qdisc.c | 89 +++ 1 file changed, 73 insertions(+), 16 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c b/drivers

[PATCH net-next 06/10] mlxsw: spectrum_qdisc: Track children per qdisc

2021-04-20 Thread Petr Machata
qdisc, and just point root_qdiscs's children to this array. Following patches will make the allocation dynamic. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- .../ethernet/mellanox/mlxsw/spectrum_qdisc.c | 164 +- 1 file changed, 118 insertions(+), 46 deletion

[PATCH net-next 04/10] mlxsw: spectrum_qdisc: Track tclass_num as int, not u8

2021-04-20 Thread Petr Machata
tclass_num is just a number, a value that would be ordinarily passed around as an int. (Which is unlike a u8 prio_bitmap.) In several places, tclass_num already is an int. Convert the remaining instances. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- drivers/net/ethernet/mellanox

[PATCH net-next 05/10] mlxsw: spectrum_qdisc: Promote backlog reduction to mlxsw_sp_qdisc_destroy()

2021-04-20 Thread Petr Machata
-by: Petr Machata Reviewed-by: Ido Schimmel --- .../ethernet/mellanox/mlxsw/spectrum_qdisc.c | 48 +++ 1 file changed, 18 insertions(+), 30 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c index

[PATCH net-next 02/10] mlxsw: spectrum_qdisc: Simplify mlxsw_sp_qdisc_compare()

2021-04-20 Thread Petr Machata
have different types. Even when replacing one qdisc with another in the same class, Linux will not permit handle reuse unless the qdisc type also matches. Simplify the function by omitting these two unnecessary conditions. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel

[PATCH net-next 03/10] mlxsw: spectrum_qdisc: Drop an always-true condition

2021-04-20 Thread Petr Machata
The function mlxsw_sp_qdisc_compare() is invoked a couple lines above this check, which will bounce any requests where this condition does not hold. Therefore drop it. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c | 5 + 1

[PATCH net-next 01/10] mlxsw: spectrum_qdisc: Drop one argument from check_params callback

2021-04-20 Thread Petr Machata
The mlxsw_sp_qdisc argument is not used in any of the actual callbacks. Drop it. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/net/ethernet

[PATCH net-next 00/10] mlxsw: Refactor qdisc offload

2021-04-20 Thread Petr Machata
management assumes only one qdisc is created at a time. In FIFO handlers, this condition was enforced simply by asserting RTNL lock. But instead of furthering this RTNL dependence, patch #7 converts the whole qdisc offload logic to a per-port mutex. - Patch #10 adds a selftest. Petr Machata (10

Re: [PATCH net-next 1/7] net: sched: Add a trap-and-forward action

2021-04-09 Thread Petr Machata
Jamal Hadi Salim writes: > On 2021-04-09 7:03 a.m., Petr Machata wrote: >> Jamal Hadi Salim writes: >> >>> I am concerned about adding new opcodes which only make sense if you >>> offload (or make sense only if you are running in s/w). >>> &g

Re: [PATCH net-next 1/7] net: sched: Add a trap-and-forward action

2021-04-09 Thread Petr Machata
Jamal Hadi Salim writes: > I am concerned about adding new opcodes which only make sense if you > offload (or make sense only if you are running in s/w). > > Those opcodes are intended to be generic abstractions so the dispatcher > can decide what to do next. Adding things that are specific onl

[PATCH net-next 7/7] selftests: mlxsw: Add a trap_fwd test to devlink_trap_control

2021-04-08 Thread Petr Machata
Test that trap_fwd'd packets show up under the correct trap. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- .../drivers/net/mlxsw/devlink_trap_control.sh | 23 --- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/driver

[PATCH net-next 6/7] selftests: forwarding: Add a test for TC trapping behavior

2021-04-08 Thread Petr Machata
Test that trapped packets are forwarded through the SW datapath, whereas trap_fwd'd ones are not (but are forwarded through HW datapath). For completeness' sake, also test that "pass" (i.e. lack of trapping) simply forwards the packets in the HW datapath. Signed-off-by: Petr

[PATCH net-next 1/7] net: sched: Add a trap-and-forward action

2021-04-08 Thread Petr Machata
add a new generic action, trap_fwd. In the software pipeline, it is equivalent to an OK. When offloading, it should forward the packet to the host, but unlike trap it should not drop the packet. Signed-off-by: Petr Machata Reviewed-by: Jiri Pirko Reviewed-by: Ido Schimmel --- include/uapi/linux

[PATCH net-next 5/7] mlxsw: Offload trap_fwd

2021-04-08 Thread Petr Machata
with offload_fwd_mark and offload_l3_fwd_mark to prevent second forwarding in the SW datapath. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- .../mellanox/mlxsw/core_acl_flex_actions.c| 23 +++ .../net/ethernet/mellanox/mlxsw/spectrum.h| 1 + .../ethernet/mellanox/mlx

[PATCH net-next 4/7] mlxsw: Propagate extack to mlxsw_afa_block_commit()

2021-04-08 Thread Petr Machata
In the following patch, attempts to change the next/goto of a flexible action set from goto to next will be rejected for action sets that contain a trap_fwd action. Propagate extack to make it possible to communicate the issue to the user. Signed-off-by: Petr Machata Reviewed-by: Jiri Pirko

[PATCH net-next 0/7] tc: Introduce a trap-and-forward action

2021-04-08 Thread Petr Machata
and #7 add selftests. Petr Machata (7): net: sched: Add a trap-and-forward action net: sched: Make the action trap_fwd offloadable devlink: Add a new trap for the trap_fwd action mlxsw: Propagate extack to mlxsw_afa_block_commit() mlxsw: Offload trap_fwd selftests: forwarding: Add a

[PATCH net-next 3/7] devlink: Add a new trap for the trap_fwd action

2021-04-08 Thread Petr Machata
Add a new trap so that drivers can report packets forwarded due to the trap_fwd action correctly. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- Documentation/networking/devlink/devlink-trap.rst | 4 include/net/devlink.h | 3 +++ net/core/devlink.c

[PATCH net-next 2/7] net: sched: Make the action trap_fwd offloadable

2021-04-08 Thread Petr Machata
Add the new flow action and related support so that drivers can offload the trap_fwd action. Signed-off-by: Petr Machata Reviewed-by: Jiri Pirko Reviewed-by: Ido Schimmel --- include/net/flow_offload.h | 1 + include/net/tc_act/tc_gact.h | 5 + net/sched/cls_api.c | 2 ++ 3

[PATCH net-next] Documentation: net: Document resilient next-hop groups

2021-03-29 Thread Petr Machata
Add a document describing the principles behind resilient next-hop groups, and some notes about how to configure and offload them. Suggested-by: David Ahern Signed-off-by: Petr Machata Reviewed-by: David Ahern --- Notes: v1 (from an RFC shared privately): - Dropped a reference to a

[PATCH net-next] nexthop: Rename artifacts related to legacy multipath nexthop groups

2021-03-26 Thread Petr Machata
. - The flag for resilient groups is nh_grp_entry::resilient. Functions that assume this have "res" in the name. Besides the above, struct nh_grp_entry::mpath was renamed to ::hthr as well. UAPI artifacts were obviously left intact. Suggested-by: David Ahern Signed-off-by:

[PATCH iproute2-next v4 5/6] nexthop: Add support for resilient nexthop groups

2021-03-17 Thread Petr Machata
ets": 8, "idle_timer": 120, "unbalanced_timer": 0 }, "flags": [ ] } ] Signed-off-by: Ido Schimmel Signed-off-by: Petr Machata --- ip/ipnexthop.c| 144 +- man/man8/ip-nex

[PATCH iproute2-next v4 6/6] nexthop: Add support for nexthop buckets

2021-03-17 Thread Petr Machata
id 10 index 5 idle_time 81 nhid 1 # ip -j -p nexthop bucket get id 10 index 5 [ { "id": 10, "bucket": { "index": 5, "idle_time": 104.89, "nhid": 1 }, "flags": [

[PATCH iproute2-next v4 3/6] nexthop: Extract a helper to parse a NH ID

2021-03-17 Thread Petr Machata
NH ID extraction is a common operation, and will become more common still with the resilient NH groups support. Add a helper that does what it usually done and returns the parsed NH ID. Signed-off-by: Petr Machata --- ip/ipnexthop.c | 25 + 1 file changed, 13 insertions

[PATCH iproute2-next v4 4/6] nexthop: Add ability to specify group type

2021-03-17 Thread Petr Machata
nexthop add id 10 group 1/2/3 type mpath Signed-off-by: Ido Schimmel Signed-off-by: Petr Machata --- Notes: v2: - Add a missing example command to commit message - Mention in the man page that mpath is the default ip/ipnexthop.c| 32 ++

[PATCH iproute2-next v4 2/6] json_print: Add print_tv()

2021-03-17 Thread Petr Machata
Add a helper to dump a timeval. Print by first converting to double and then dispatching to print_color_float(). Signed-off-by: Petr Machata --- Notes: v4: - Make print_tv() take a const*. include/json_print.h | 1 + lib/json_print.c | 13 + 2 files changed, 14

[PATCH iproute2-next v4 0/6] ip: nexthop: Support resilient groups

2021-03-17 Thread Petr Machata
ntion in the man page that mpath is the default Ido Schimmel (3): nexthop: Add ability to specify group type nexthop: Add support for resilient nexthop groups nexthop: Add support for nexthop buckets Petr Machata (3): nexthop: Synchronize uAPI files json_print: Add print_tv() ne

[PATCH iproute2-next v4 1/6] nexthop: Synchronize uAPI files

2021-03-17 Thread Petr Machata
Signed-off-by: Petr Machata --- include/uapi/linux/nexthop.h | 47 +- include/uapi/linux/rtnetlink.h | 7 + 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/nexthop.h b/include/uapi/linux/nexthop.h index b0a5613905ef

Re: [PATCH iproute2-next v3 2/6] json_print: Add print_tv()

2021-03-17 Thread Petr Machata
Stephen Hemminger writes: >> +_PRINT_FUNC(tv, struct timeval *) > > This > > Make it const please? OK

[PATCH iproute2] ip: Fix batch processing

2021-03-17 Thread Petr Machata
: Tim Rice Signed-off-by: Petr Machata --- ip/ip.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ip/ip.c b/ip/ip.c index 40d2998ae60b..2d7d0d327734 100644 --- a/ip/ip.c +++ b/ip/ip.c @@ -155,6 +155,7 @@ static int batch(const char *name) return EXIT_FAILURE; } +

Re: [BUG] Iproute2 batch-mode fails to bring up veth

2021-03-16 Thread Petr Machata
David Ahern writes: >> Git bisect pinpoints this commit: >> https://github.com/shemminger/iproute2/commit/1d9a81b8c9f30f9f4abeb875998262f61bf10577 >> > > Petr, can you take a look at this regression? Yes, see elsewhere in the thread: https://marc.info/?l=linux-netdev&m=161589291608081&w=

Re: [BUG] Iproute2 batch-mode fails to bring up veth

2021-03-16 Thread Petr Machata
Thanks for the report. Would you be able to test with the following patch? https://github.com/pmachata/iproute2/commit/a12eeca9caf90b3ebe24bc121819d506c9072a34.patch I believe it fixes the issue.

[PATCH iproute2-next v3 6/6] nexthop: Add support for nexthop buckets

2021-03-16 Thread Petr Machata
id 10 index 5 idle_time 81 nhid 1 # ip -j -p nexthop bucket get id 10 index 5 [ { "id": 10, "bucket": { "index": 5, "idle_time": 104.89, "nhid": 1 }, "flags": [

[PATCH iproute2-next v3 5/6] nexthop: Add support for resilient nexthop groups

2021-03-16 Thread Petr Machata
ets": 8, "idle_timer": 120, "unbalanced_timer": 0 }, "flags": [ ] } ] Signed-off-by: Ido Schimmel Signed-off-by: Petr Machata --- ip/ipnexthop.c| 144 +- man/man8/ip-nex

[PATCH iproute2-next v3 3/6] nexthop: Extract a helper to parse a NH ID

2021-03-16 Thread Petr Machata
NH ID extraction is a common operation, and will become more common still with the resilient NH groups support. Add a helper that does what it usually done and returns the parsed NH ID. Signed-off-by: Petr Machata --- ip/ipnexthop.c | 25 + 1 file changed, 13 insertions

[PATCH iproute2-next v3 4/6] nexthop: Add ability to specify group type

2021-03-16 Thread Petr Machata
nexthop add id 10 group 1/2/3 type mpath Signed-off-by: Ido Schimmel Signed-off-by: Petr Machata --- Notes: v2: - Add a missing example command to commit message - Mention in the man page that mpath is the default ip/ipnexthop.c| 32 ++

[PATCH iproute2-next v3 2/6] json_print: Add print_tv()

2021-03-16 Thread Petr Machata
Add a helper to dump a timeval. Print by first converting to double and then dispatching to print_color_float(). Signed-off-by: Petr Machata --- include/json_print.h | 1 + lib/json_print.c | 13 + 2 files changed, 14 insertions(+) diff --git a/include/json_print.h b/include

[PATCH iproute2-next v3 1/6] nexthop: Synchronize uAPI files

2021-03-16 Thread Petr Machata
Signed-off-by: Petr Machata --- include/uapi/linux/nexthop.h | 47 +- include/uapi/linux/rtnetlink.h | 7 + 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/nexthop.h b/include/uapi/linux/nexthop.h index b0a5613905ef

[PATCH iproute2-next v3 0/6] ip: nexthop: Support resilient groups

2021-03-16 Thread Petr Machata
Ido Schimmel (3): nexthop: Add ability to specify group type nexthop: Add support for resilient nexthop groups nexthop: Add support for nexthop buckets Petr Machata (3): nexthop: Synchronize uAPI files json_print: Add print_tv() nexthop: Extract a helper to parse a NH ID include/json_pr

Re: [PATCH iproute2-next v2 4/6] nexthop: Add ability to specify group type

2021-03-15 Thread Petr Machata
Petr Machata writes: > Signed-off-by: Ido Schimmel And I managed to forget my S-o-b :-/

[PATCH iproute2-next v2 6/6] nexthop: Add support for nexthop buckets

2021-03-15 Thread Petr Machata
From: Ido Schimmel Add ability to dump multiple nexthop buckets and get a specific one. Example: # ip nexthop add id 10 group 1/2 type resilient buckets 8 # ip nexthop id 1 via 192.0.2.2 dev dummy10 scope link id 2 via 192.0.2.19 dev dummy20 scope link id 10 group 1/2 type resilient buckets

[PATCH iproute2-next v2 5/6] nexthop: Add support for resilient nexthop groups

2021-03-15 Thread Petr Machata
From: Ido Schimmel Add ability to configure resilient nexthop groups and show their current configuration. Example: # ip nexthop add id 10 group 1/2 type resilient buckets 8 # ip nexthop show id 10 id 10 group 1/2 type resilient buckets 8 idle_timer 120 unbalanced_timer 0 # ip -j -p nexthop

[PATCH iproute2-next v2 4/6] nexthop: Add ability to specify group type

2021-03-15 Thread Petr Machata
From: Ido Schimmel Next patches are going to add a 'resilient' nexthop group type, so allow users to specify the type using the 'type' argument. Currently, only 'mpath' type is supported. These two commands are equivalent: # ip nexthop add id 10 group 1/2/3 # ip nexthop add id 10 group 1/2/3

[PATCH iproute2-next v2 3/6] nexthop: Extract a helper to parse a NH ID

2021-03-15 Thread Petr Machata
NH ID extraction is a common operation, and will become more common still with the resilient NH groups support. Add a helper that does what it usually done and returns the parsed NH ID. Signed-off-by: Petr Machata --- ip/ipnexthop.c | 25 + 1 file changed, 13 insertions

[PATCH iproute2-next v2 1/6] nexthop: Synchronize uAPI files

2021-03-15 Thread Petr Machata
Signed-off-by: Petr Machata --- include/uapi/linux/nexthop.h | 47 +- include/uapi/linux/rtnetlink.h | 7 + 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/nexthop.h b/include/uapi/linux/nexthop.h index b0a5613905ef

[PATCH iproute2-next v2 2/6] json_print: Add print_tv()

2021-03-15 Thread Petr Machata
Add a helper to dump a timeval. Print by first converting to double and then dispatching to print_color_float(). Signed-off-by: Petr Machata --- include/json_print.h | 1 + lib/json_print.c | 13 + 2 files changed, 14 insertions(+) diff --git a/include/json_print.h b/include

[PATCH iproute2-next v2 0/6] ip: nexthop: Support resilient groups

2021-03-15 Thread Petr Machata
ability to specify group type nexthop: Add support for resilient nexthop groups nexthop: Add support for nexthop buckets Petr Machata (3): nexthop: Synchronize uAPI files json_print: Add print_tv() nexthop: Extract a helper to parse a NH ID include/json_print.h | 1 + include

Re: [PATCH iproute2-next v2] dcb: Fix compilation warning about reallocarray

2021-03-15 Thread Petr Machata
Petr Machata writes: > Roi Dayan writes: > >> --- a/dcb/dcb_app.c >> +++ b/dcb/dcb_app.c >> @@ -65,8 +65,7 @@ static void dcb_app_table_fini(struct dcb_app_table *tab) >> >> static int dcb_app_table_push(struct dcb_app_table *tab, struct dcb_app >>

Re: [PATCH iproute2-next 4/6] nexthop: Add ability to specify group type

2021-03-15 Thread Petr Machata
David Ahern writes: > On 3/12/21 10:23 AM, Petr Machata wrote: >> From: Petr Machata >> >> From: Ido Schimmel > > All of the patches have the above. If Ido is the author and you are > sending, AIUI you add your Signed-off-by below his. Sorry about that, tha

[PATCH iproute2-next 3/6] nexthop: Extract a helper to parse a NH ID

2021-03-12 Thread Petr Machata
From: Petr Machata From: Petr Machata NH ID extraction is a common operation, and will become more common still with the resilient NH groups support. Add a helper that does what it usually done and returns the parsed NH ID. Signed-off-by: Petr Machata --- ip/ipnexthop.c | 25

[PATCH iproute2-next 6/6] nexthop: Add support for nexthop buckets

2021-03-12 Thread Petr Machata
From: Petr Machata From: Ido Schimmel Add ability to dump multiple nexthop buckets and get a specific one. Example: # ip nexthop add id 10 group 1/2 type resilient buckets 8 # ip nexthop id 1 via 192.0.2.2 dev dummy10 scope link id 2 via 192.0.2.19 dev dummy20 scope link id 10 group 1/2

[PATCH iproute2-next 5/6] nexthop: Add support for resilient nexthop groups

2021-03-12 Thread Petr Machata
From: Petr Machata From: Ido Schimmel Add ability to configure resilient nexthop groups and show their current configuration. Example: # ip nexthop add id 10 group 1/2 type resilient buckets 8 # ip nexthop show id 10 id 10 group 1/2 type resilient buckets 8 idle_timer 120 unbalanced_timer

[PATCH iproute2-next 1/6] nexthop: Synchronize uAPI files

2021-03-12 Thread Petr Machata
From: Petr Machata From: Ido Schimmel Signed-off-by: Petr Machata --- include/uapi/linux/nexthop.h | 47 +- include/uapi/linux/rtnetlink.h | 7 + 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/nexthop.h b/include/uapi

[PATCH iproute2-next 4/6] nexthop: Add ability to specify group type

2021-03-12 Thread Petr Machata
From: Petr Machata From: Ido Schimmel Next patches are going to add a 'resilient' nexthop group type, so allow users to specify the type using the 'type' argument. Currently, only 'mpath' type is supported. These two command are equivalent: Signed-off-by: Ido

[PATCH iproute2-next 0/6] ip: nexthop: Support resilient groups

2021-03-12 Thread Petr Machata
support for nexthop buckets Petr Machata (2): json_print: Add print_tv() nexthop: Extract a helper to parse a NH ID include/json_print.h | 1 + include/libnetlink.h | 3 + include/uapi/linux/nexthop.h | 47 +++- include/uapi/linux/rtnetlink.h | 7 + ip/ip_common.h

[PATCH iproute2-next 2/6] json_print: Add print_tv()

2021-03-12 Thread Petr Machata
From: Petr Machata From: Petr Machata Add a helper to dump a timeval. Print by first converting to double and then dispatching to print_color_float(). Signed-off-by: Petr Machata --- include/json_print.h | 1 + lib/json_print.c | 13 + 2 files changed, 14 insertions

[PATCH net-next 10/10] selftests: netdevsim: Add test for resilient nexthop groups offload API

2021-03-12 Thread Petr Machata
From: Ido Schimmel Test various aspects of the resilient nexthop group offload API on top of the netdevsim implementation. Both good and bad flows are tested. Signed-off-by: Ido Schimmel Co-developed-by: Petr Machata Signed-off-by: Petr Machata --- .../drivers/net/netdevsim/nexthop.sh

[PATCH net-next 09/10] selftests: forwarding: Add resilient multipath tunneling nexthop test

2021-03-12 Thread Petr Machata
From: Ido Schimmel Add a resilient nexthop objects version of gre_multipath_nh.sh. Test that both IPv4 and IPv6 overlays work with resilient nexthop groups where the nexthops are two GRE tunnels. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: Petr Machata --- .../net

[PATCH net-next 07/10] selftests: fib_nexthops: Test resilient nexthop groups

2021-03-12 Thread Petr Machata
TEST: Nexthop group updated after replace - nECMP [ OK ] TEST: Nexthop buckets updated after replace - nECMP [ OK ] Tests passed: 8 Tests failed: 0 Signed-off-by: Ido Schimmel Co-developed-by: Petr Machata Signed-off-by: Petr Machata --- tools/testing/selftests

[PATCH net-next 08/10] selftests: forwarding: Add resilient hashing test

2021-03-12 Thread Petr Machata
weights (1:1) are used. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: Petr Machata --- .../net/forwarding/router_mpath_nh_res.sh | 400 ++ 1 file changed, 400 insertions(+) create mode 100755 tools/testing/selftests/net/forwarding

[PATCH net-next 03/10] netdevsim: Add support for resilient nexthop groups

2021-03-12 Thread Petr Machata
/netdevsim10/fib/fail_res_nexthop_group_replace Y This enables testing of various error paths. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: Petr Machata --- drivers/net/netdevsim/fib.c | 55 + 1 file changed, 55 insertions(+) diff --git a/drive

[PATCH net-next 06/10] selftests: fib_nexthops: List each test case in a different line

2021-03-12 Thread Petr Machata
Machata Signed-off-by: Petr Machata --- tools/testing/selftests/net/fib_nexthops.sh | 30 ++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/net/fib_nexthops.sh b/tools/testing/selftests/net/fib_nexthops.sh index 91226ac50112..c840aa88ff18

[PATCH net-next 02/10] netdevsim: Create a helper for setting nexthop hardware flags

2021-03-12 Thread Petr Machata
From: Ido Schimmel Instead of calling nexthop_set_hw_flags(), call a helper. It will be used to also set nexthop bucket flags in a subsequent patch. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: Petr Machata --- drivers/net/netdevsim/fib.c | 13 ++--- 1 file

[PATCH net-next 01/10] netdevsim: fib: Introduce a lock to guard nexthop hashtable

2021-03-12 Thread Petr Machata
Currently netdevsim relies on RTNL to maintain exclusivity in accessing the nexthop hash table. However, bucket notification may be called without RTNL having been held. Instead, introduce a custom lock to guard the table. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- drivers/net

[PATCH net-next 04/10] netdevsim: Allow reporting activity on nexthop buckets

2021-03-12 Thread Petr Machata
nexthop group 10 as active. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: Petr Machata --- drivers/net/netdevsim/fib.c | 61 + 1 file changed, 61 insertions(+) diff --git a/drivers/net/netdevsim/fib.c b/drivers/net/netdevsim/fib

[PATCH net-next 00/10] net: Resilient NH groups: netdevsim, selftests

2021-03-12 Thread Petr Machata
offload API Petr Machata (1): netdevsim: fib: Introduce a lock to guard nexthop hashtable drivers/net/netdevsim/fib.c | 139 +++- .../drivers/net/netdevsim/nexthop.sh | 620 ++ tools/testing/selftests/net/fib_nexthops.sh | 549

[PATCH net-next 05/10] selftests: fib_nexthops: Declutter test output

2021-03-12 Thread Petr Machata
[ OK ] Tests passed: 1 Tests failed: 0 # ./fib_nexthops.sh -t ipv6_torture IPv6 runtime torture TEST: IPv6 torture test [ OK ] Tests passed: 1 Tests failed: 0 Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata S

[PATCH net-next v2 14/14] nexthop: Enable resilient next-hop groups

2021-03-11 Thread Petr Machata
Now that all the code is in place, stop rejecting requests to create resilient next-hop groups. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Reviewed-by: David Ahern --- net/ipv4/nexthop.c | 4 1 file changed, 4 deletions(-) diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c

[PATCH net-next v2 13/14] nexthop: Notify userspace about bucket migrations

2021-03-11 Thread Petr Machata
Nexthop replacements et.al. are notified through netlink, but if a delayed work migrates buckets on the background, userspace will stay oblivious. Notify these as RTM_NEWNEXTHOPBUCKET events. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Reviewed-by: David Ahern --- Notes: v1

[PATCH net-next v2 12/14] nexthop: Add netlink handlers for bucket get

2021-03-11 Thread Petr Machata
Allow getting (but not setting) individual buckets to inspect the next hop mapped therein, idle time, and flags. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Reviewed-by: David Ahern --- Notes: v1 (changes since RFC): - u32 -> u16 for bucket counts / indices net/i

[PATCH net-next v2 10/14] nexthop: Add netlink handlers for resilient nexthop groups

2021-03-11 Thread Petr Machata
Implement the netlink messages that allow creation and dumping of resilient nexthop groups. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Reviewed-by: David Ahern --- Notes: v1 (changes since RFC): - u32 -> u16 for bucket counts / indices net/ipv4/nexthop.c |

[PATCH net-next v2 09/14] nexthop: Allow reporting activity of nexthop buckets

2021-03-11 Thread Petr Machata
hardware. Add a function that can be periodically called by device drivers to report activity on nexthop buckets after querying it from the underlying device. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Reviewed-by: David Ahern Signed-off-by: Petr Machata --- Notes: v1 (changes

[PATCH net-next v2 11/14] nexthop: Add netlink handlers for bucket dump

2021-03-11 Thread Petr Machata
Add a dump handler for resilient next hop buckets. When next-hop group ID is given, it walks buckets of that group, otherwise it walks buckets of all groups. It then dumps the buckets whose next hops match the given filtering criteria. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel

[PATCH net-next v2 06/14] nexthop: Add data structures for resilient group notifications

2021-03-11 Thread Petr Machata
From: Ido Schimmel Add data structures that will be used for in-kernel notifications about addition / deletion of a resilient nexthop group and about changes to a hash bucket within a resilient group. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Reviewed-by: David Ahern Signed-off

[PATCH net-next v2 04/14] nexthop: Add netlink defines and enumerators for resilient NH groups

2021-03-11 Thread Petr Machata
type for now. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Reviewed-by: David Ahern Signed-off-by: Petr Machata --- Notes: v2: - Comment at NEXTHOP_GRP_TYPE_MPATH that it's for the hash-threshold groups. v1 (changes since RFC): - u32 -> u16 for bucke

[PATCH net-next v2 07/14] nexthop: Implement notifiers for resilient nexthop groups

2021-03-11 Thread Petr Machata
the transaction back. This notification allows the driver to take a look and veto the new proposed group up front, before anything is committed. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Reviewed-by: David Ahern --- Notes: v1 (changes since RFC): - u32 -> u16 for buc

[PATCH net-next v2 05/14] nexthop: Add implementation of resilient next-hop groups

2021-03-11 Thread Petr Machata
es not handle notifications towards drivers, which are kept as if the group were an mpath one. It does not handle netlink either. The only bit currently exposed to user space is the new next-hop group type, and that is currently bounced. There is therefore no way to actually access this code. Sign

[PATCH net-next v2 08/14] nexthop: Allow setting "offload" and "trap" indication of nexthop buckets

2021-03-11 Thread Petr Machata
From: Ido Schimmel Add a function that can be called by device drivers to set "offload" or "trap" indication on nexthop buckets following nexthop notifications and other changes such as a neighbour becoming invalid. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata

[PATCH net-next v2 03/14] nexthop: Add a dedicated flag for multipath next-hop groups

2021-03-11 Thread Petr Machata
Therefore, introduce a new flag, that should be set for next-hop groups that have more than one nexthop, and should be considered multipath. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Reviewed-by: David Ahern --- Notes: v1 (changes since RFC): - This patch is new include/net

[PATCH net-next v2 02/14] nexthop: __nh_notifier_single_info_init(): Make nh_info an argument

2021-03-11 Thread Petr Machata
function to its callers to make it possible to use a different synchronization guarantee. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Reviewed-by: David Ahern --- net/ipv4/nexthop.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/net/ipv4/nexthop.c b

[PATCH net-next v2 01/14] nexthop: Pass nh_config to replace_nexthop()

2021-03-11 Thread Petr Machata
replacement, propagate `cfg' to replace_nexthop() and further to replace_nexthop_grp(). Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Reviewed-by: David Ahern --- net/ipv4/nexthop.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/net/ipv4/nexthop.c b/net

[PATCH net-next v2 00/14] nexthop: Resilient next-hop groups

2021-03-11 Thread Petr Machata
for resilient NH groups nexthop: Add data structures for resilient group notifications nexthop: Allow setting "offload" and "trap" indication of nexthop buckets nexthop: Allow reporting activity of nexthop buckets Petr Machata (10): nexthop: Pass nh_config to replace_n

Re: [PATCH net-next 00/14] nexthop: Resilient next-hop groups

2021-03-11 Thread Petr Machata
David Ahern writes: > When you get to the end of the sets, it would be good to submit > documentation for resilient multipath under Documentation/networking All right.

Re: [PATCH net-next 03/14] nexthop: Add a dedicated flag for multipath next-hop groups

2021-03-11 Thread Petr Machata
David Ahern writes: > On 3/11/21 8:39 AM, Petr Machata wrote: >> >> David Ahern writes: >> >>>> diff --git a/include/net/nexthop.h b/include/net/nexthop.h >>>> index 7bc057aee40b..5062c2c08e2b 100644 >>>> --- a/include/net/nexth

Re: [PATCH net-next 04/14] nexthop: Add netlink defines and enumerators for resilient NH groups

2021-03-11 Thread Petr Machata
David Ahern writes: > On 3/11/21 8:45 AM, Petr Machata wrote: >> >> David Ahern writes: >> >>> On 3/10/21 8:02 AM, Petr Machata wrote: >>>> diff --git a/include/uapi/linux/nexthop.h b/include/uapi/linux/nexthop.h >>>> index 2d4a1e784

Re: [PATCH net-next 04/14] nexthop: Add netlink defines and enumerators for resilient NH groups

2021-03-11 Thread Petr Machata
David Ahern writes: > On 3/10/21 8:02 AM, Petr Machata wrote: >> diff --git a/include/uapi/linux/nexthop.h b/include/uapi/linux/nexthop.h >> index 2d4a1e784cf0..8efebf3cb9c7 100644 >> --- a/include/uapi/linux/nexthop.h >> +++ b/include/uapi/linux/nexthop.h

Re: [PATCH net-next 03/14] nexthop: Add a dedicated flag for multipath next-hop groups

2021-03-11 Thread Petr Machata
David Ahern writes: >> diff --git a/include/net/nexthop.h b/include/net/nexthop.h >> index 7bc057aee40b..5062c2c08e2b 100644 >> --- a/include/net/nexthop.h >> +++ b/include/net/nexthop.h >> @@ -80,6 +80,7 @@ struct nh_grp_entry { >> struct nh_group { >> struct nh_group *spare; /*

[PATCH net-next 14/14] nexthop: Enable resilient next-hop groups

2021-03-10 Thread Petr Machata
Now that all the code is in place, stop rejecting requests to create resilient next-hop groups. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- net/ipv4/nexthop.c | 4 1 file changed, 4 deletions(-) diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c index 015a47e8163a

[PATCH net-next 10/14] nexthop: Add netlink handlers for resilient nexthop groups

2021-03-10 Thread Petr Machata
Implement the netlink messages that allow creation and dumping of resilient nexthop groups. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- Notes: v1 (changes since RFC): - u32 -> u16 for bucket counts / indices net/ipv4/nexthop.c |

  1   2   3   4   5   6   7   8   >