netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Andrea Mayer <andrea.mayer@uniroma2.it>
Cc: "David S. Miller" <davem@davemloft.net>,
	Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
	David Lebrun <dav.lebrun@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>, Andrii Nakryiko <andriin@fb.com>,
	bpf@vger.kernel.org, Paolo Lungaroni <paolo.lungaroni@cnit.it>
Subject: Re: [net-next] seg6: add support for optional attributes during behavior construction
Date: Mon, 3 Feb 2020 17:08:00 +0200	[thread overview]
Message-ID: <20200203150800.GQ414821@unreal> (raw)
In-Reply-To: <20200203143658.1561-1-andrea.mayer@uniroma2.it>

On Mon, Feb 03, 2020 at 03:36:58PM +0100, Andrea Mayer wrote:
> before this patch, each SRv6 behavior specifies a set of required
> attributes that must be provided by the userspace application when the
> behavior is created. If an attribute is not supplied, the creation
> operation fails.
> As a workaround, if an attribute is not needed by a behavior, it requires
> to be set by the userspace application to a conventional skip-value. The
> kernel side, that processes the creation request of a behavior, reads the
> supplied attribute values and checks if it has been set to the
> conventional skip-value or not. Hence, each optional attribute must have a
> conventional skip-value which is known a priori and shared between
> userspace applications and kernel.
>
> Messy code and complicated tricks may arise from this approach.
> On the other hand, this patch explicitly differentiates the required
> mandatory attributes from the optional ones. Now, each behavior can declare
> a set of required attributes and a set of optional ones. The behavior
> creation fails in case a required attribute is missing, while it goes on
> without generating any issue if an optional attribute is not supplied by
> the userspace application.
>
> To properly combine the required and optional attributes, a new callback
> function called destroy() is used for releasing resources that have been
> acquired, during the parse() operation, by a given attribute.
> However, the destroy() function is optional and if an attribute does not
> require resources that have to be later released, the callback can be
> omitted.
>
> Signed-off-by: Andrea Mayer <andrea.mayer@uniroma2.it>
> ---
>  net/ipv6/seg6_local.c | 226 ++++++++++++++++++++++++++++++++++++------
>  1 file changed, 198 insertions(+), 28 deletions(-)
>
> diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c
> index 85a5447a3e8d..480f1ab35221 100644
> --- a/net/ipv6/seg6_local.c
> +++ b/net/ipv6/seg6_local.c
> @@ -7,6 +7,13 @@
>   *  eBPF support: Mathieu Xhonneux <m.xhonneux@gmail.com>
>   */
>
> +/* Changes:
> + *
> + * Andrea Mayer <andrea.mayer@uniroma2.it>
> + *	add support for optional attributes during behavior construction
> + *
> + */

The lines above look strange in 2020 when all of us are using git.

Thanks

  reply	other threads:[~2020-02-03 15:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-03 14:36 [net-next] seg6: add support for optional attributes during behavior construction Andrea Mayer
2020-02-03 15:08 ` Leon Romanovsky [this message]
2020-02-05 16:37   ` Andrea Mayer
  -- strict thread matches above, loose matches on Subject: below --
2020-03-19 18:36 Andrea Mayer
2020-03-26  2:30 ` David Miller
2020-03-30 23:23   ` Stefano Salsano
2020-03-31  0:49     ` David Miller
2020-03-31  1:32       ` Stefano Salsano
2020-01-27 19:04 Andrea Mayer
2020-01-29 10:13 ` David Miller

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=20200203150800.GQ414821@unreal \
    --to=leon@kernel.org \
    --cc=andrea.mayer@uniroma2.it \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dav.lebrun@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kafai@fb.com \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paolo.lungaroni@cnit.it \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    --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).