Skip to content

Provide bpf_sk_storage data in INET_DIAG

Martin KaFai Lau bpf netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 5 repliesIn review
  2. v14 patches 6 repliesSuperseded

Changes in v2 from the cover letter

- Add commit message for u16 to u32 change in min_dump_alloc in Patch 4 (Song)
- Add comment to explain the !skb->len check in __inet_diag_dump in Patch 4.
- Do the map->map_type check earlier in Patch 3 for readability.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4inet_diag: Refactor inet_sk_diag_fill(), dump(), and dump_one()include/linux/inet_diag.h net/dccp/diag.c net/ipv4/inet_diag.c +4 more+73 -1130 replies
2/4inet_diag: Move the INET_DIAG_REQ_BYTECODE nlattr to cb->datainclude/linux/inet_diag.h include/uapi/linux/inet_diag.h net/dccp/diag.c +5 more+98 -640 replies
3/4bpf: INET_DIAG support in bpf_sk_storageinclude/linux/bpf.h include/net/bpf_sk_storage.h include/uapi/linux/sock_diag.h +2 more+346 -60 replies
4/4bpf: inet_diag: Dump bpf_sk_storages in inet_diag_dump()include/linux/inet_diag.h include/linux/netlink.h include/uapi/linux/inet_diag.h +1 more+82 -25 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchSong Liu
1/4A-b
2/4A-b
3/4A-b
4/4A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH bpf-next v2 0/4] Provide bpf_sk_storage data in INET_DIAG

The bpf_prog can store specific info to a sk by using bpf_sk_storage. In other words, a sk can be extended by a bpf_prog.

This series is to support providing bpf_sk_storage data during inet_diag's dump. The primary target is the usage like iproute2's "ss".

The first two patches are refactoring works in inet_diag to make adding bpf_sk_storage support easier. The next two patches do the actual work.

Please see individual patch for details.

v2:
- Add commit message for u16 to u32 change in min_dump_alloc in Patch 4 (Song)
- Add comment to explain the !skb->len check in __inet_diag_dump in Patch 4.
- Do the map->map_type check earlier in Patch 3 for readability.

Martin KaFai Lau (4):
inet_diag: Refactor inet_sk_diag_fill(), dump(), and dump_one()
inet_diag: Move the INET_DIAG_REQ_BYTECODE nlattr to cb->data
bpf: INET_DIAG support in bpf_sk_storage
bpf: inet_diag: Dump bpf_sk_storages in inet_diag_dump()

 include/linux/bpf.h            |   1 +
 include/linux/inet_diag.h      |  27 +--
 include/linux/netlink.h        |   4 +-
 include/net/bpf_sk_storage.h   |  27 +++
 include/uapi/linux/inet_diag.h |   5 +-
 include/uapi/linux/sock_diag.h |  26 +++
 kernel/bpf/syscall.c           |  15 ++
 net/core/bpf_sk_storage.c      | 283 +++++++++++++++++++++++++++++-
 net/dccp/diag.c                |   9 +-
 net/ipv4/inet_diag.c           | 307 ++++++++++++++++++++-------------
 net/ipv4/raw_diag.c            |  24 ++-
 net/ipv4/tcp_diag.c            |   8 +-
 net/ipv4/udp_diag.c            |  41 +++--
 net/sctp/diag.c                |   7 +-
 14 files changed, 599 insertions(+), 185 deletions(-)
Signature · 1 line
2.17.1