All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: bpf <bpf@vger.kernel.org>,
	"Network Development" <netdev@vger.kernel.org>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Andrii Nakryiko" <andrii@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Eric Dumazet" <edumazet@google.com>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Pablo Neira Ayuso" <pablo@netfilter.org>,
	"Florian Westphal" <fw@strlen.de>,
	netfilter-devel <netfilter-devel@vger.kernel.org>,
	"Lorenzo Bianconi" <lorenzo.bianconi@redhat.com>,
	"Jesper Dangaard Brouer" <brouer@redhat.com>,
	"Toke Høiland-Jørgensen" <toke@redhat.com>,
	"Kumar Kartikeya Dwivedi" <memxor@gmail.com>
Subject: Re: [PATCH v3 bpf-next 1/3] bpf: Tweak definition of KF_TRUSTED_ARGS
Date: Wed, 21 Sep 2022 19:39:43 -0700	[thread overview]
Message-ID: <CAADnVQJY4pibr5PkoTFhpYDj8pBJ1mTPuR9VSeKQXuJqeh6d3Q@mail.gmail.com> (raw)
In-Reply-To: <cdede0043c47ed7a357f0a915d16f9ce06a1d589.1663778601.git.lorenzo@kernel.org>

On Wed, Sep 21, 2022 at 9:49 AM Lorenzo Bianconi <lorenzo@kernel.org> wrote:
>
> +               /* These register types have special constraints wrt ref_obj_id
> +                * and offset checks. The rest of trusted args don't.
> +                */
> +               obj_ptr = reg->type == PTR_TO_CTX || reg->type == PTR_TO_BTF_ID ||
> +                         reg2btf_ids[base_type(reg->type)];
> +

..

>                 /* Check if argument must be a referenced pointer, args + i has
>                  * been verified to be a pointer (after skipping modifiers).
> +                * PTR_TO_CTX is ok without having non-zero ref_obj_id.
>                  */

Kumar,

Looking forward to your subsequent patch to split this function.
It's definitely getting unwieldy.

The comment above is double confusing.
1. I think you meant to say "PTR_TO_CTX is ok with zero ref_obj_id",
right? That double negate is not easy to parse.

2.
PTR_TO_CTX cannot have ref_obj_id != 0.
At least I don't think it's possible, but the comment implies
that such a case may exist.

I applied anyway, since big refactoring is coming shortly, right?

  reply	other threads:[~2022-09-22  2:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-21 16:48 [PATCH v3 bpf-next 0/3] Introduce bpf_ct_set_nat_info kfunc helper Lorenzo Bianconi
2022-09-21 16:48 ` [PATCH v3 bpf-next 1/3] bpf: Tweak definition of KF_TRUSTED_ARGS Lorenzo Bianconi
2022-09-22  2:39   ` Alexei Starovoitov [this message]
2022-09-22  8:00     ` Kumar Kartikeya Dwivedi
2022-09-21 16:48 ` [PATCH v3 bpf-next 2/3] net: netfilter: add bpf_ct_set_nat_info kfunc helper Lorenzo Bianconi
2022-09-23 21:34   ` Nathan Chancellor
2022-09-23 22:20     ` Lorenzo Bianconi
2022-09-24 11:10       ` Lorenzo Bianconi
2022-09-24 14:51         ` Nathan Chancellor
2022-09-21 16:48 ` [PATCH v3 bpf-next 3/3] selftests/bpf: add tests for bpf_ct_set_nat_info kfunc Lorenzo Bianconi
2022-09-22  2:40 ` [PATCH v3 bpf-next 0/3] Introduce bpf_ct_set_nat_info kfunc helper 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=CAADnVQJY4pibr5PkoTFhpYDj8pBJ1mTPuR9VSeKQXuJqeh6d3Q@mail.gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=kuba@kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=lorenzo@kernel.org \
    --cc=memxor@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.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.