netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: bpf@vger.kernel.org, pablo@netfilter.org, kadlec@netfilter.org,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, netfilter-devel@vger.kernel.org,
	netdev@vger.kernel.org, ast@kernel.org, andrii@kernel.org,
	martin.lau@linux.dev, eddyz87@gmail.com,
	lorenzo.bianconi@redhat.com, toke@redhat.com, fw@strlen.de,
	hawk@kernel.org, horms@kernel.org, donhunte@redhat.com,
	memxor@gmail.com
Subject: Re: [PATCH v5 bpf-next 3/3] selftests/bpf: Add selftest for bpf_xdp_flow_lookup kfunc
Date: Sat, 29 Jun 2024 22:11:54 +0200	[thread overview]
Message-ID: <ZoBqijOJi2JVcHDB@lore-desk> (raw)
In-Reply-To: <89bd0cd7-ed01-a343-d873-dc0c6d2810f2@iogearbox.net>

[-- Attachment #1: Type: text/plain, Size: 2226 bytes --]

> On 6/14/24 5:40 PM, Lorenzo Bianconi wrote:
> [...]
> > +void test_xdp_flowtable(void)
> > +{
> > +	struct xdp_flowtable *skel = NULL;
> > +	struct nstoken *tok = NULL;
> > +	int iifindex, stats_fd;
> > +	__u32 value, key = 0;
> > +	struct bpf_link *link;
> > +
> > +	if (SYS_NOFAIL("nft -v")) {
> > +		fprintf(stdout, "Missing required nft tool\n");
> > +		test__skip();
> > +		return;
> 
> Bit unfortunate that upstream CI skips the test case at the moment:

yep, we are missing nft utility there.

> 
>   #542/2   xdp_devmap_attach/DEVMAP with frags programs in entries:OK
>   #542/3   xdp_devmap_attach/Verifier check of DEVMAP programs:OK
>   #542     xdp_devmap_attach:OK
>   #543     xdp_do_redirect:OK
>   #544     xdp_flowtable:SKIP
> [...]
> 
> > +out:
> > +	xdp_flowtable__destroy(skel);
> > +	if (tok)
> > +		close_netns(tok);
> > +	SYS_NOFAIL("ip netns del " TX_NETNS_NAME);
> > +	SYS_NOFAIL("ip netns del " RX_NETNS_NAME);
> > +}
> > diff --git a/tools/testing/selftests/bpf/progs/xdp_flowtable.c b/tools/testing/selftests/bpf/progs/xdp_flowtable.c
> > new file mode 100644
> > index 0000000000000..8297b30b0764b
> > --- /dev/null
> > +++ b/tools/testing/selftests/bpf/progs/xdp_flowtable.c
> > @@ -0,0 +1,146 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +#define BPF_NO_KFUNC_PROTOTYPES
> > +#include <vmlinux.h>
> > +#include <bpf/bpf_helpers.h>
> > +#include <bpf/bpf_endian.h>
> > +
> > +#define MAX_ERRNO	4095
> 
> nit: unused?

ack, I will remove it in v6.

Regards,
Lorenzo

> 
> > +#define ETH_P_IP	0x0800
> > +#define ETH_P_IPV6	0x86dd
> > +#define IP_MF		0x2000	/* "More Fragments" */
> > +#define IP_OFFSET	0x1fff	/* "Fragment Offset" */
> > +#define AF_INET		2
> > +#define AF_INET6	10
> > +
> > +struct bpf_flowtable_opts___local {
> > +	s32 error;
> > +};
> > +
> > +struct flow_offload_tuple_rhash *
> > +bpf_xdp_flow_lookup(struct xdp_md *, struct bpf_fib_lookup *,
> > +		    struct bpf_flowtable_opts___local *, u32) __ksym;
> > +
> > +struct {
> > +	__uint(type, BPF_MAP_TYPE_ARRAY);
> > +	__type(key, __u32);
> > +	__type(value, __u32);
> > +	__uint(max_entries, 1);
> > +} stats SEC(".maps");
> > +
> [...]

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2024-06-29 20:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-14 15:40 [PATCH v5 bpf-next 0/3] netfilter: Add the capability to offload flowtable in XDP layer Lorenzo Bianconi
2024-06-14 15:40 ` [PATCH v5 bpf-next 1/3] netfilter: nf_tables: add flowtable map for xdp offload Lorenzo Bianconi
2024-06-28 21:19   ` Daniel Borkmann
2024-06-29 22:06     ` Lorenzo Bianconi
2024-06-14 15:40 ` [PATCH v5 bpf-next 2/3] netfilter: add bpf_xdp_flow_lookup kfunc Lorenzo Bianconi
2024-06-28 21:21   ` Daniel Borkmann
2024-06-29 19:57     ` Lorenzo Bianconi
2024-06-14 15:40 ` [PATCH v5 bpf-next 3/3] selftests/bpf: Add selftest for " Lorenzo Bianconi
2024-06-28 21:29   ` Daniel Borkmann
2024-06-29 20:11     ` Lorenzo Bianconi [this message]
2024-07-01  8:07       ` Daniel Borkmann
2024-06-28 19:56 ` [PATCH v5 bpf-next 0/3] netfilter: Add the capability to offload flowtable in XDP layer Lorenzo Bianconi

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=ZoBqijOJi2JVcHDB@lore-desk \
    --to=lorenzo@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=donhunte@redhat.com \
    --cc=eddyz87@gmail.com \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=kadlec@netfilter.org \
    --cc=kuba@kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=martin.lau@linux.dev \
    --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 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).