bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin KaFai Lau <kafai@fb.com>
To: Yonghong Song <yhs@fb.com>
Cc: <bpf@vger.kernel.org>, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>, <kernel-team@fb.com>
Subject: Re: [PATCH bpf-next 01/13] bpf: add bpf_seq_afinfo in tcp_iter_state
Date: Thu, 18 Jun 2020 11:09:20 -0700	[thread overview]
Message-ID: <20200618180915.a6gkehjt5jlaa3bb@kafai-mbp.dhcp.thefacebook.com> (raw)
In-Reply-To: <20200617211537.1855673-1-yhs@fb.com>

On Wed, Jun 17, 2020 at 02:15:37PM -0700, Yonghong Song wrote:
> A new field bpf_seq_afinfo is added to tcp_iter_state
> to provide bpf tcp iterator afinfo. There are two
> reasons on why we did this.
> 
> First, the current way to get afinfo from PDE_DATA
> does not work for bpf iterator as its seq_file
> inode does not conform to /proc/net/{tcp,tcp6}
> inode structures. More specifically, anonymous
> bpf iterator will use an anonymous inode which
> is shared in the system and we cannot change inode
> private data structure at all.
> 
> Second, bpf iterator for tcp/tcp6 wants to
> traverse all tcp and tcp6 sockets in one pass
> and bpf program can control whether they want
> to skip one sk_family or not. Having a different
> afinfo with family AF_UNSPEC make it easier
> to understand in the code.
Acked-by: Martin KaFai Lau <kafai@fb.com>

  reply	other threads:[~2020-06-18 18:10 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17 21:15 [PATCH bpf-next 00/13] implement bpf iterator for tcp and udp sockets Yonghong Song
2020-06-17 21:15 ` [PATCH bpf-next 01/13] bpf: add bpf_seq_afinfo in tcp_iter_state Yonghong Song
2020-06-18 18:09   ` Martin KaFai Lau [this message]
2020-06-17 21:15 ` [PATCH bpf-next 02/13] net: bpf: implement bpf iterator for tcp Yonghong Song
2020-06-18 18:52   ` Martin KaFai Lau
2020-06-17 21:15 ` [PATCH bpf-next 03/13] bpf: support 'X' in bpf_seq_printf() helper Yonghong Song
2020-06-18 18:55   ` Martin KaFai Lau
2020-06-17 21:15 ` [PATCH bpf-next 04/13] bpf: allow tracing programs to use bpf_jiffies64() helper Yonghong Song
2020-06-18 19:00   ` Martin KaFai Lau
2020-06-17 21:15 ` [PATCH bpf-next 05/13] bpf: add bpf_skc_to_tcp6_sock() helper Yonghong Song
2020-06-18 20:54   ` Martin KaFai Lau
2020-06-18 23:31     ` Yonghong Song
2020-06-17 21:15 ` [PATCH bpf-next 06/13] bpf: add bpf_skc_to_{tcp,tcp_timewait,tcp_request}_sock() helpers Yonghong Song
2020-06-17 21:15 ` [PATCH bpf-next 07/13] bpf: add bpf_seq_afinfo in udp_iter_state Yonghong Song
2020-06-17 21:15 ` [PATCH bpf-next 08/13] net: bpf: implement bpf iterator for udp Yonghong Song
2020-06-17 21:15 ` [PATCH bpf-next 09/13] bpf: add bpf_skc_to_udp6_sock() helper Yonghong Song
2020-06-17 21:15 ` [PATCH bpf-next 10/13] bpf/selftests: move newer bpf_iter_* type redefining to a new header file Yonghong Song
2020-06-17 22:47   ` Andrii Nakryiko
2020-06-17 21:15 ` [PATCH bpf-next 11/13] tools/bpf: selftests: implement sample tcp/tcp6 bpf_iter programs Yonghong Song
2020-06-17 22:51   ` Andrii Nakryiko
     [not found]     ` <ab5a131f-93c7-802b-49be-dd72085d8e56@fb.com>
2020-06-18  6:24       ` Andrii Nakryiko
2020-06-17 21:15 ` [PATCH bpf-next 12/13] tools/bpf: add udp4/udp6 bpf iterator Yonghong Song
2020-06-17 21:15 ` [PATCH bpf-next 13/13] bpf/selftests: add tcp/udp iterator programs to selftests Yonghong Song

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=20200618180915.a6gkehjt5jlaa3bb@kafai-mbp.dhcp.thefacebook.com \
    --to=kafai@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=yhs@fb.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).