From: "Eva Kurchatova (Virtuozzo)" <eva.kurchatova@virtuozzo.com>
To: khorenko@virtuozzo.com
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH vz10 1/4] selftests/bpf: Use local type for bpf_fou_encap in test_tunnel_kern
Date: Tue, 1 Sep 2026 04:07:14 +0300 [thread overview]
Message-ID: <7bd8a651-98e7-4d90-983d-1a2bad364251@virtuozzo.com> (raw)
In-Reply-To: <20260821151016.794050-1-eva.kurchatova@virtuozzo.com>
On 8/21/26 18:09, Eva Kurchatova wrote:
> From: Gregory Bell <grbell@redhat.com>
>
> Replace the forward-declared struct bpf_fou_encap with the existing
> bpf_fou_encap___local type in the bpf_skb_set_fou_encap and
> bpf_skb_get_fou_encap declarations. This removes the need for
> the forward declaration and the explicit casts at each call.
>
> Fixes: d17f9b370df6 ("selftests/bpf: Fix compilation failure when CONFIG_NET_FOU!=y")
> Signed-off-by: Gregory Bell <grbell@redhat.com>
> Link: https://lore.kernel.org/r/20260417154122.2558890-3-grbell@redhat.com
> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
> (cherry picked from commit afb0450be061907a0f5d36bd8b010ca30eda3d3b)
>
> https://virtuozzo.atlassian.net/browse/VSTOR-139677
> Feature: fix selftests
> Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
> ---
> .../testing/selftests/bpf/progs/test_tunnel_kern.c | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/progs/test_tunnel_kern.c b/tools/testing/selftests/bpf/progs/test_tunnel_kern.c
> index 32127f1cd687..30f1de458669 100644
> --- a/tools/testing/selftests/bpf/progs/test_tunnel_kern.c
> +++ b/tools/testing/selftests/bpf/progs/test_tunnel_kern.c
> @@ -6,6 +6,7 @@
> * modify it under the terms of version 2 of the GNU General Public
> * License as published by the Free Software Foundation.
> */
> +#define BPF_NO_KFUNC_PROTOTYPES
> #include "vmlinux.h"
> #include <bpf/bpf_core_read.h>
> #include <bpf/bpf_helpers.h>
> @@ -36,12 +37,10 @@ enum bpf_fou_encap_type___local {
> FOU_BPF_ENCAP_GUE___local,
> };
>
> -struct bpf_fou_encap;
> -
> int bpf_skb_set_fou_encap(struct __sk_buff *skb_ctx,
> - struct bpf_fou_encap *encap, int type) __ksym;
> + struct bpf_fou_encap___local *encap, int type) __ksym;
> int bpf_skb_get_fou_encap(struct __sk_buff *skb_ctx,
> - struct bpf_fou_encap *encap) __ksym;
> + struct bpf_fou_encap___local *encap) __ksym;
> struct xfrm_state *
> bpf_xdp_get_xfrm_state(struct xdp_md *ctx, struct bpf_xfrm_state_opts *opts,
> u32 opts__sz) __ksym;
> @@ -781,7 +780,7 @@ int ipip_gue_set_tunnel(struct __sk_buff *skb)
> encap.sport = 0;
> encap.dport = bpf_htons(5555);
>
> - ret = bpf_skb_set_fou_encap(skb, (struct bpf_fou_encap *)&encap,
> + ret = bpf_skb_set_fou_encap(skb, &encap,
> bpf_core_enum_value(enum bpf_fou_encap_type___local,
> FOU_BPF_ENCAP_GUE___local));
> if (ret < 0) {
> @@ -820,7 +819,7 @@ int ipip_fou_set_tunnel(struct __sk_buff *skb)
> encap.sport = 0;
> encap.dport = bpf_htons(5555);
>
> - ret = bpf_skb_set_fou_encap(skb, (struct bpf_fou_encap *)&encap,
> + ret = bpf_skb_set_fou_encap(skb, &encap,
> FOU_BPF_ENCAP_FOU___local);
> if (ret < 0) {
> log_err(ret);
> @@ -843,7 +842,7 @@ int ipip_encap_get_tunnel(struct __sk_buff *skb)
> return TC_ACT_SHOT;
> }
>
> - ret = bpf_skb_get_fou_encap(skb, (struct bpf_fou_encap *)&encap);
> + ret = bpf_skb_get_fou_encap(skb, &encap);
> if (ret < 0) {
> log_err(ret);
> return TC_ACT_SHOT;
Sent v2 patchset:
https://lists.openvz.org/pipermail/devel/2026-September/084967.html
Added "ms/" prefix for upstream cherry-pick, split the upstreamable
commit from commit to test_sock.c and test_tunnel.sh which are gone
upstream.
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
prev parent reply other threads:[~2026-09-01 1:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-21 15:09 Eva Kurchatova
2026-08-21 15:09 ` [Devel] [PATCH vz10 2/4] selftests/bpf: run the network tests in their own netns Eva Kurchatova
2026-08-21 15:09 ` [Devel] [PATCH vz10 3/4] selftests/bpf: use the bpftool built with the tests in test_bpftool_map Eva Kurchatova
2026-08-21 15:10 ` [Devel] [PATCH vz10 4/4] selftests/bpf: size the map in test_lru_sanity3 to whole refills Eva Kurchatova
2026-09-01 1:07 ` Eva Kurchatova (Virtuozzo) [this message]
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=7bd8a651-98e7-4d90-983d-1a2bad364251@virtuozzo.com \
--to=eva.kurchatova@virtuozzo.com \
--cc=devel@openvz.org \
--cc=khorenko@virtuozzo.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