From: Andrea Mayer <andrea.mayer@uniroma2.it>
To: Jakub Kicinski <kuba@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
David Ahern <dsahern@kernel.org>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
Stefano Salsano <stefano.salsano@uniroma2.it>,
Paolo Lungaroni <paolo.lungaroni@uniroma2.it>,
Ahmed Abdelsalam <ahabdels.dev@gmail.com>,
Andrea Mayer <andrea.mayer@uniroma2.it>
Subject: Re: [RFC net-next 1/1] seg6: add counters support for SRv6 Behaviors
Date: Fri, 9 Apr 2021 14:43:14 +0200 [thread overview]
Message-ID: <20210409144314.bfdc37b91cee99d1761a84a4@uniroma2.it> (raw)
In-Reply-To: <20210407132404.59c95127@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
On Wed, 7 Apr 2021 13:24:04 -0700
Jakub Kicinski <kuba@kernel.org> wrote:
> On Wed, 7 Apr 2021 20:03:32 +0200 Andrea Mayer wrote:
> > This patch provides counters for SRv6 Behaviors as defined in [1], section
> > 6. For each SRv6 Behavior instance, the 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 introduces 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.
> > This is done through iproute2 which allows the user to create an SRv6
> > Behavior instance specifying the optional "count" attribute as shown in the
> > following example:
> >
> > $ 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
> >
> > Signed-off-by: Andrea Mayer <andrea.mayer@uniroma2.it>
>
> > +static int put_nla_counters(struct sk_buff *skb, struct seg6_local_lwt *slwt)
> > +{
> > + struct seg6_local_counters counters = { 0, 0, 0 };
> > + struct nlattr *nla;
> > + int i;
> > +
> > + nla = nla_reserve(skb, SEG6_LOCAL_COUNTERS, sizeof(counters));
> > + if (!nla)
> > + return -EMSGSIZE;
>
> nla_reserve_64bit(), IIUC netlink guarantees alignment of 64 bit values.
Hi Jakub, thanks for your review!
Yes, we should guarantee alignment of 64 bit values.
I will definitely follow your advice.
Andrea
next prev parent reply other threads:[~2021-04-09 12:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-07 18:03 [RFC net-next 0/1] seg6: Counters for SRv6 Behaviors Andrea Mayer
2021-04-07 18:03 ` [RFC net-next 1/1] seg6: add counters support " Andrea Mayer
2021-04-07 20:24 ` Jakub Kicinski
2021-04-09 12:43 ` Andrea Mayer [this message]
2021-04-07 22:55 ` David Ahern
2021-04-09 17:55 ` Andrea Mayer
2021-04-07 22:56 ` [RFC net-next 0/1] seg6: Counters " David Ahern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210409144314.bfdc37b91cee99d1761a84a4@uniroma2.it \
--to=andrea.mayer@uniroma2.it \
--cc=ahabdels.dev@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=paolo.lungaroni@uniroma2.it \
--cc=stefano.salsano@uniroma2.it \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).