netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2] bpf: add btf func and func_proto kind support
@ 2019-01-25  0:41 Yonghong Song
  2019-01-25  0:44 ` Daniel Borkmann
  2019-02-05 23:30 ` Stephen Hemminger
  0 siblings, 2 replies; 3+ messages in thread
From: Yonghong Song @ 2019-01-25  0:41 UTC (permalink / raw)
  To: stephen, ast, daniel, netdev; +Cc: kernel-team

The issue is discovered for bpf selftest test_skb_cgroup.sh.
Currently we have,
  $ ./test_skb_cgroup_id.sh
  Wait for testing link-local IP to become available ... OK
  Object has unknown BTF type: 13!
  [PASS]

In the above the BTF type 13 refers to BTF kind
BTF_KIND_FUNC_PROTO.
This patch added support of BTF_KIND_FUNC_PROTO and
BTF_KIND_FUNC during type parsing.
With this patch, I got
  $ ./test_skb_cgroup_id.sh
  Wait for testing link-local IP to become available ... OK
  [PASS]

Signed-off-by: Yonghong Song <yhs@fb.com>
---
 lib/bpf.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/bpf.c b/lib/bpf.c
index 5e85cfc0..762f8857 100644
--- a/lib/bpf.c
+++ b/lib/bpf.c
@@ -2193,12 +2193,16 @@ static int bpf_btf_prep_type_data(struct bpf_elf_ctx *ctx)
 		case BTF_KIND_ENUM:
 			type_cur += var_len * sizeof(struct btf_enum);
 			break;
+		case BTF_KIND_FUNC_PROTO:
+			type_cur += var_len * sizeof(struct btf_param);
+			break;
 		case BTF_KIND_TYPEDEF:
 		case BTF_KIND_PTR:
 		case BTF_KIND_FWD:
 		case BTF_KIND_VOLATILE:
 		case BTF_KIND_CONST:
 		case BTF_KIND_RESTRICT:
+		case BTF_KIND_FUNC:
 			break;
 		default:
 			fprintf(stderr, "Object has unknown BTF type: %u!\n", kind);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH iproute2] bpf: add btf func and func_proto kind support
  2019-01-25  0:41 [PATCH iproute2] bpf: add btf func and func_proto kind support Yonghong Song
@ 2019-01-25  0:44 ` Daniel Borkmann
  2019-02-05 23:30 ` Stephen Hemminger
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2019-01-25  0:44 UTC (permalink / raw)
  To: Yonghong Song, stephen, ast, netdev; +Cc: kernel-team

On 01/25/2019 01:41 AM, Yonghong Song wrote:
> The issue is discovered for bpf selftest test_skb_cgroup.sh.
> Currently we have,
>   $ ./test_skb_cgroup_id.sh
>   Wait for testing link-local IP to become available ... OK
>   Object has unknown BTF type: 13!
>   [PASS]
> 
> In the above the BTF type 13 refers to BTF kind
> BTF_KIND_FUNC_PROTO.
> This patch added support of BTF_KIND_FUNC_PROTO and
> BTF_KIND_FUNC during type parsing.
> With this patch, I got
>   $ ./test_skb_cgroup_id.sh
>   Wait for testing link-local IP to become available ... OK
>   [PASS]
> 
> Signed-off-by: Yonghong Song <yhs@fb.com>

Acked-by: Daniel Borkmann <daniel@iogearbox.net>

Thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH iproute2] bpf: add btf func and func_proto kind support
  2019-01-25  0:41 [PATCH iproute2] bpf: add btf func and func_proto kind support Yonghong Song
  2019-01-25  0:44 ` Daniel Borkmann
@ 2019-02-05 23:30 ` Stephen Hemminger
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2019-02-05 23:30 UTC (permalink / raw)
  To: Yonghong Song; +Cc: ast, daniel, netdev, kernel-team

On Thu, 24 Jan 2019 16:41:07 -0800
Yonghong Song <yhs@fb.com> wrote:

> The issue is discovered for bpf selftest test_skb_cgroup.sh.
> Currently we have,
>   $ ./test_skb_cgroup_id.sh
>   Wait for testing link-local IP to become available ... OK
>   Object has unknown BTF type: 13!
>   [PASS]
> 
> In the above the BTF type 13 refers to BTF kind
> BTF_KIND_FUNC_PROTO.
> This patch added support of BTF_KIND_FUNC_PROTO and
> BTF_KIND_FUNC during type parsing.
> With this patch, I got
>   $ ./test_skb_cgroup_id.sh
>   Wait for testing link-local IP to become available ... OK
>   [PASS]
> 
> Signed-off-by: Yonghong Song <yhs@fb.com>

Sure applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-05 23:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-25  0:41 [PATCH iproute2] bpf: add btf func and func_proto kind support Yonghong Song
2019-01-25  0:44 ` Daniel Borkmann
2019-02-05 23:30 ` Stephen Hemminger

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).