netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin KaFai Lau <martin.lau@linux.dev>
To: Daniel Xu <dxu@dxuuu.xyz>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	bpf@vger.kernel.org, devel@linux-ipsec.org, daniel@iogearbox.net,
	davem@davemloft.net, edumazet@google.com,
	Herbert Xu <herbert@gondor.apana.org.au>,
	ast@kernel.org, john.fastabend@gmail.com, kuba@kernel.org,
	steffen.klassert@secunet.com, pabeni@redhat.com, hawk@kernel.org,
	antony.antony@secunet.com, alexei.starovoitov@gmail.com,
	yonghong.song@linux.dev, eddyz87@gmail.com,
	eyal.birger@gmail.com
Subject: Re: [PATCH bpf-next v5 1/9] bpf: xfrm: Add bpf_xdp_get_xfrm_state() kfunc
Date: Wed, 13 Dec 2023 16:02:24 -0800	[thread overview]
Message-ID: <36f7f017-ecea-4715-b352-2ce1d43c8cab@linux.dev> (raw)
In-Reply-To: <e8029421b1a0d045fadb214ba919cc25efab4952.1702325874.git.dxu@dxuuu.xyz>

On 12/11/23 12:20 PM, Daniel Xu wrote:
> +/* bpf_xfrm_state_opts - Options for XFRM state lookup helpers
> + *
> + * Members:
> + * @error      - Out parameter, set for any errors encountered
> + *		 Values:
> + *		   -EINVAL - netns_id is less than -1
> + *		   -EINVAL - opts__sz isn't BPF_XFRM_STATE_OPTS_SZ
> + *		   -ENONET - No network namespace found for netns_id
> + * @netns_id	- Specify the network namespace for lookup
> + *		 Values:
> + *		   BPF_F_CURRENT_NETNS (-1)
> + *		     Use namespace associated with ctx
> + *		   [0, S32_MAX]
> + *		     Network Namespace ID
> + * @mark	- XFRM mark to match on
> + * @daddr	- Destination address to match on
> + * @spi		- Security parameter index to match on
> + * @proto	- L3 protocol to match on
> + * @family	- L3 protocol family to match on
> + */
> +struct bpf_xfrm_state_opts {
> +	s32 error;
> +	s32 netns_id;
> +	u32 mark;
> +	xfrm_address_t daddr;
> +	__be32 spi;
> +	u8 proto;
> +	u16 family;
> +};
> +
> +enum {
> +	BPF_XFRM_STATE_OPTS_SZ = sizeof(struct bpf_xfrm_state_opts),

The bpf prog can use the bpf_core_type_size() to figure out the size also.

  parent reply	other threads:[~2023-12-14  0:11 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-11 20:20 [PATCH bpf-next v5 0/9] Add bpf_xdp_get_xfrm_state() kfunc Daniel Xu
2023-12-11 20:20 ` [PATCH bpf-next v5 1/9] bpf: xfrm: " Daniel Xu
2023-12-11 21:39   ` Eyal Birger
2023-12-11 22:26     ` Daniel Xu
2023-12-14  0:02   ` Martin KaFai Lau [this message]
2023-12-11 20:20 ` [PATCH bpf-next v5 2/9] bpf: xfrm: Add bpf_xdp_xfrm_state_release() kfunc Daniel Xu
2023-12-11 20:20 ` [PATCH bpf-next v5 3/9] libbpf: Add BPF_CORE_WRITE_BITFIELD() macro Daniel Xu
2023-12-11 20:20 ` [PATCH bpf-next v5 4/9] bpf: selftests: test_loader: Support __btf_path() annotation Daniel Xu
2023-12-11 20:20 ` [PATCH bpf-next v5 5/9] bpf: selftests: Add verifier tests for CO-RE bitfield writes Daniel Xu
2023-12-13 23:58   ` Martin KaFai Lau
2023-12-14  0:20     ` Daniel Xu
2023-12-11 20:20 ` [PATCH bpf-next v5 6/9] bpf: selftests: test_tunnel: Setup fresh topology for each subtest Daniel Xu
2023-12-11 20:20 ` [PATCH bpf-next v5 7/9] bpf: selftests: test_tunnel: Use vmlinux.h declarations Daniel Xu
2023-12-11 20:20 ` [PATCH bpf-next v5 8/9] bpf: selftests: Move xfrm tunnel test to test_progs Daniel Xu
2023-12-11 20:20 ` [PATCH bpf-next v5 9/9] bpf: xfrm: Add selftest for bpf_xdp_get_xfrm_state() Daniel Xu
2023-12-11 21:39   ` Eyal Birger
2023-12-11 22:31     ` Daniel Xu
2023-12-11 23:13       ` Eyal Birger
2023-12-11 23:49         ` Daniel Xu
2023-12-12  0:25           ` Eyal Birger
2023-12-12 16:17             ` Daniel Xu
2023-12-12 16:44               ` Alexei Starovoitov
2023-12-12 19:00                 ` Daniel Xu
2023-12-12 19:52               ` Daniel Xu
2023-12-12 23:13                 ` Kumar Kartikeya Dwivedi
2023-12-13 23:15                   ` Daniel Xu
2023-12-13 23:49                     ` Eyal Birger
2023-12-14 16:08                       ` Kumar Kartikeya Dwivedi
2023-12-14 16:16                         ` Kumar Kartikeya Dwivedi
2023-12-14 18:23                           ` Daniel Xu
2023-12-14 20:24                             ` Daniel Xu
2023-12-14 20:53                               ` Alexei Starovoitov

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=36f7f017-ecea-4715-b352-2ce1d43c8cab@linux.dev \
    --to=martin.lau@linux.dev \
    --cc=alexei.starovoitov@gmail.com \
    --cc=antony.antony@secunet.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=devel@linux-ipsec.org \
    --cc=dxu@dxuuu.xyz \
    --cc=eddyz87@gmail.com \
    --cc=edumazet@google.com \
    --cc=eyal.birger@gmail.com \
    --cc=hawk@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=steffen.klassert@secunet.com \
    --cc=yonghong.song@linux.dev \
    /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).