All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Nikolay Aleksandrov <razor@blackwall.org>, bpf@vger.kernel.org
Cc: jiri@resnulli.us, netdev@vger.kernel.org, martin.lau@linux.dev,
	ast@kernel.org, andrii@kernel.org, john.fastabend@gmail.com,
	kuba@kernel.org, andrew@lunn.ch, toke@kernel.org,
	toke@redhat.com, sdf@google.com
Subject: Re: [PATCH bpf-next 2/2] netkit: use netlink policy for mode and policy attributes validation
Date: Thu, 26 Oct 2023 14:13:15 +0200	[thread overview]
Message-ID: <f14eda0f-b045-6563-7b18-bbc5bfb009ca@iogearbox.net> (raw)
In-Reply-To: <20231026094106.1505892-3-razor@blackwall.org>

On 10/26/23 11:41 AM, Nikolay Aleksandrov wrote:
> Use netlink's NLA_POLICY_VALIDATE_FN() type for mode and primary/peer
> policy with custom validation functions to return better errors. This
> simplifies the logic a bit and relies on netlink's policy validation.
> We don't have to specify len because the type is NLA_U32 and attribute
> length is enforced by netlink.
> 
> Suggested-by: Jiri Pirko <jiri@resnulli.us>
> Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>

Acked-by: Daniel Borkmann <daniel@iogearbox.net>

> ---
>   drivers/net/netkit.c | 66 +++++++++++++++-----------------------------
>   1 file changed, 22 insertions(+), 44 deletions(-)

Looks better indeed, shrinks code a bit, and passes the selftests, thanks
for the suggestion!

Thanks,
Daniel

  reply	other threads:[~2023-10-26 12:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-26  9:41 [PATCH bpf-next 0/2] netkit: two minor cleanups Nikolay Aleksandrov
2023-10-26  9:41 ` [PATCH bpf-next 1/2] netkit: remove explicit active/peer ptr initialization Nikolay Aleksandrov
2023-10-26 12:12   ` Daniel Borkmann
2023-10-26 13:21   ` Jiri Pirko
2023-10-26  9:41 ` [PATCH bpf-next 2/2] netkit: use netlink policy for mode and policy attributes validation Nikolay Aleksandrov
2023-10-26 12:13   ` Daniel Borkmann [this message]
2023-10-26 13:23   ` Jiri Pirko
2023-10-26 14:11   ` Ido Schimmel
2023-10-26 14:23     ` Nikolay Aleksandrov
2023-10-26 14:25       ` Daniel Borkmann
2023-10-26 14:34       ` Nikolay Aleksandrov
2023-10-26 14:10 ` [PATCH bpf-next 0/2] netkit: two minor cleanups patchwork-bot+netdevbpf

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=f14eda0f-b045-6563-7b18-bbc5bfb009ca@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=andrew@lunn.ch \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=jiri@resnulli.us \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=razor@blackwall.org \
    --cc=sdf@google.com \
    --cc=toke@kernel.org \
    --cc=toke@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.