]> git.ipfire.org Git - thirdparty/iproute2.git/commit
seg6: add counters support for SRv6 Behaviors
authorPaolo Lungaroni <paolo.lungaroni@uniroma2.it>
Sat, 8 May 2021 15:44:58 +0000 (17:44 +0200)
committerDavid Ahern <dsahern@kernel.org>
Sun, 9 May 2021 22:20:59 +0000 (22:20 +0000)
commit02ca3aabe923799f570017ff764bce938f09308c
tree66cc3a04a94640e06846ee39a974bf17c5a4a556
parente44786b26934e4fbf337b0af73a9e6f53d458a25
seg6: add counters support for SRv6 Behaviors

We introduce the "count" optional attribute for supporting counters in SRv6
Behaviors as defined in [1], section 6. For each SRv6 Behavior instance,
counters defined in [1] are:

 - the total number of packets that have been correctly processed;
 - the total amount of traffic in bytes of all packets that have been
   correctly processed;

In addition, we introduce a new counter that counts the number of packets
that have NOT been properly processed (i.e. errors) by an SRv6 Behavior
instance.

Each SRv6 Behavior instance can be configured, at the time of its creation,
to make use of counters specifing the "count" attribute as follows:

 $ ip -6 route add 2001:db8::1 encap seg6local action End count dev eth0

per-behavior counters can be shown by adding "-s" to the iproute2 command
line, i.e.:

 $ ip -s -6 route show 2001:db8::1
 2001:db8::1 encap seg6local action End packets 0 bytes 0 errors 0 dev eth0

[1] https://www.rfc-editor.org/rfc/rfc8986.html#name-counters

v2:
 - add help and route.8 man page updates

Signed-off-by: Andrea Mayer <andrea.mayer@uniroma2.it>
Signed-off-by: Paolo Lungaroni <paolo.lungaroni@uniroma2.it>
Signed-off-by: David Ahern <dsahern@kernel.org>
ip/iproute.c
ip/iproute_lwtunnel.c
man/man8/ip-route.8.in