Thread (36 messages) 36 messages, 4 authors, 2021-12-19

Re: [PATCH bpf-next v4 00/10] Introduce unstable CT lookup helpers

From: Andrii Nakryiko <hidden>
Date: 2021-12-17 16:40:51
Also in: bpf, netfilter-devel

On Fri, Dec 17, 2021 at 1:36 AM Kumar Kartikeya Dwivedi
[off-list ref] wrote:
On Fri, Dec 17, 2021 at 07:20:21AM IST, Kumar Kartikeya Dwivedi wrote:
quoted
This series adds unstable conntrack lookup helpers using BPF kfunc support.  The
patch adding the lookup helper is based off of Maxim's recent patch to aid in
rebasing their series on top of this, all adjusted to work with module kfuncs [0].

  [0]: https://lore.kernel.org/bpf/20211019144655.3483197-8-maximmi@nvidia.com (local)

To enable returning a reference to struct nf_conn, the verifier is extended to
support reference tracking for PTR_TO_BTF_ID, and kfunc is extended with support
for working as acquire/release functions, similar to existing BPF helpers. kfunc
returning pointer (limited to PTR_TO_BTF_ID in the kernel) can also return a
PTR_TO_BTF_ID_OR_NULL now, typically needed when acquiring a resource can fail.
kfunc can also receive PTR_TO_CTX and PTR_TO_MEM (with some limitations) as
arguments now. There is also support for passing a mem, len pair as argument
to kfunc now. In such cases, passing pointer to unsized type (void) is also
permitted.

Please see individual commits for details.

Note: BPF CI needs to add the following to config to test the set. I did update
the selftests config in patch 8, but not sure if that is enough.

      CONFIG_NETFILTER=y
      CONFIG_NF_DEFRAG_IPV4=y
      CONFIG_NF_DEFRAG_IPV6=y
      CONFIG_NF_CONNTRACK=y
Hm, so this is not showing up in BPF CI, is it some mistake from my side? The
last couple of versions produced build time warnings in Patchwork, that I fixed,
which I suspected was the main cause.
Not a mistake, for BPF CI there are separate configs that need to be
updated manually:
  - https://github.com/kernel-patches/vmtest/blob/master/.github/actions/vmtest/latest.config
for kernel patches CI
  - https://github.com/libbpf/libbpf/tree/master/travis-ci/vmtest/configs
(there is x86-64 and s390x configs) for libbpf CI
There's still one coming from the last patch, but based on [0], I am not sure
whether I should be doing things any differently (and if I do fix it, it also
needs to be done for the functions added before). The warnings are from the 11
new kfuncs I added in net/bpf/test_run.c, for their missing declarations.

Comments?

[0]: https://lore.kernel.org/bpf/20200326235426.ei6ae2z5ek6uq3tt@ast-mbp (local)
quoted
[...]
--
Kartikeya
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help