BPF List
 help / color / mirror / Atom feed
From: Jakub Sitnicki <jakub@cloudflare.com>
To: Yonghong Song <yonghong.song@linux.dev>
Cc: bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	John Fastabend <john.fastabend@gmail.com>,
	kernel-team@fb.com, Martin KaFai Lau <martin.lau@kernel.org>
Subject: Re: [RFC PATCH bpf-next 4/5] bpftool: Add link dump support for BPF_LINK_TYPE_SK_MSG
Date: Fri, 08 Mar 2024 16:07:22 +0000	[thread overview]
Message-ID: <87frwyrku7.fsf@cloudflare.com> (raw)
In-Reply-To: <20240305202216.3891808-1-yonghong.song@linux.dev>

On Tue, Mar 05, 2024 at 12:22 PM -08, Yonghong Song wrote:
> An example output looks like:
>   9: sk_msg  prog 108
>           map_id 84  attach_type sk_msg_verdict
>
> Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
> ---
>  tools/bpf/bpftool/link.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/tools/bpf/bpftool/link.c b/tools/bpf/bpftool/link.c
> index afde9d0c2ea1..5eb140197d3f 100644
> --- a/tools/bpf/bpftool/link.c
> +++ b/tools/bpf/bpftool/link.c
> @@ -526,6 +526,9 @@ static int show_link_close_json(int fd, struct bpf_link_info *info)
>  		show_link_ifindex_json(info->netkit.ifindex, json_wtr);
>  		show_link_attach_type_json(info->netkit.attach_type, json_wtr);
>  		break;
> +	case BPF_LINK_TYPE_SK_MSG:
> +		jsonw_uint_field(json_wtr, "map_id", info->skmsg.map_id);
> +		show_link_attach_type_json(info->skmsg.attach_type, json_wtr);

Compiler says - missing break.

>  	case BPF_LINK_TYPE_XDP:
>  		show_link_ifindex_json(info->xdp.ifindex, json_wtr);
>  		break;
> @@ -915,6 +918,11 @@ static int show_link_close_plain(int fd, struct bpf_link_info *info)
>  		show_link_ifindex_plain(info->netkit.ifindex);
>  		show_link_attach_type_plain(info->netkit.attach_type);
>  		break;
> +	case BPF_LINK_TYPE_SK_MSG:
> +		printf("\n\t");
> +		printf("map_id %u  ", info->skmsg.map_id);
> +		show_link_attach_type_plain(info->skmsg.attach_type);
> +		break;
>  	case BPF_LINK_TYPE_XDP:
>  		printf("\n\t");
>  		show_link_ifindex_plain(info->xdp.ifindex);


  reply	other threads:[~2024-03-10 18:41 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-05 20:21 [RFC PATCH bpf-next 0/5] Add bpf_link support for sk_msg prog Yonghong Song
2024-03-05 20:22 ` [RFC PATCH bpf-next 1/5] bpf: Add link " Yonghong Song
2024-03-09  0:59   ` Andrii Nakryiko
2024-03-09 18:41     ` Yonghong Song
2024-03-10 19:23     ` Jakub Sitnicki
2024-03-11 21:58       ` Yonghong Song
2024-03-11  8:30   ` Jiri Olsa
2024-03-11 22:07     ` Yonghong Song
2024-03-05 20:22 ` [RFC PATCH bpf-next 2/5] libbpf: Refactor bpf_program_attach_fd() Yonghong Song
2024-03-09  1:02   ` Andrii Nakryiko
2024-03-09 18:43     ` Yonghong Song
2024-03-05 20:22 ` [RFC PATCH bpf-next 3/5] libbpf: Add link support for BPF_PROG_TYPE_SK_MSG Yonghong Song
2024-03-09  1:01   ` Andrii Nakryiko
2024-03-09 18:49     ` Yonghong Song
2024-03-05 20:22 ` [RFC PATCH bpf-next 4/5] bpftool: Add link dump support for BPF_LINK_TYPE_SK_MSG Yonghong Song
2024-03-08 16:07   ` Jakub Sitnicki [this message]
2024-03-11 21:54     ` Yonghong Song
2024-03-05 20:22 ` [RFC PATCH bpf-next 5/5] selftests/bpf: Add some tests with new bpf_program__attach_sk_msg() API Yonghong Song
2024-03-06 19:19 ` [RFC PATCH bpf-next 0/5] Add bpf_link support for sk_msg prog John Fastabend
2024-03-07 22:47   ` Yonghong Song
2024-03-07 13:01 ` Jakub Sitnicki
2024-03-11 21:53   ` Yonghong Song
2024-03-10 19:52 ` Jakub Sitnicki

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=87frwyrku7.fsf@cloudflare.com \
    --to=jakub@cloudflare.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kernel-team@fb.com \
    --cc=martin.lau@kernel.org \
    --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