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@xxxxxx>