Skip to content

AF_XDP: add socket monitoring support

[email protected] netdev 2 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 1 replyApplied
  2. v13 patches 4 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3net: xsk: track AF_XDP sockets on a per-netns listinclude/net/net_namespace.h include/net/netns/xdp.h net/xdp/xsk.c+47 -00 replies
2/3xsk: add id to umeminclude/net/xdp_sock.h net/xdp/xdp_umem.c+14 -00 replies
3/3xsk: add sock_diag interface for AF_XDPinclude/uapi/linux/xdp_diag.h net/xdp/Kconfig net/xdp/Makefile +3 more+285 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH bpf-next v2 0/3] AF_XDP: add socket monitoring support

From: Björn Töpel <[email protected]>

This series adds an AF_XDP sock_diag interface for querying sockets from user-space. Tools like iproute2 ss(8) can use this interface to list open AF_XDP sockets.

The diagnostic provides information about the Rx/Tx/fill/completetion rings, umem, memory usage and such. For a complete list, please refer to the xsk_diag.c file.

The AF_XDP sock_diag interface is optional, and can be built as a module.

A separate patch series, adding ss(8) iproute2 support, will follow.

v1->v2: * Removed extra newline
* Zero-out all user-space facing structures prior setting the members
* Added explicit "pad" member in _msg struct
* Removed unused variable "req" in xsk_diag_handler_dump()

Thanks to Daniel for reviewing the series!

Cheers,
Björn

Björn Töpel (3):
net: xsk: track AF_XDP sockets on a per-netns list
xsk: add id to umem
xsk: add sock_diag interface for AF_XDP

 include/net/net_namespace.h   |   4 +
 include/net/netns/xdp.h       |  13 +++
 include/net/xdp_sock.h        |   1 +
 include/uapi/linux/xdp_diag.h |  72 +++++++++++++
 net/xdp/Kconfig               |   8 ++
 net/xdp/Makefile              |   1 +
 net/xdp/xdp_umem.c            |  13 +++
 net/xdp/xsk.c                 |  36 ++++++-
 net/xdp/xsk.h                 |  12 +++
 net/xdp/xsk_diag.c            | 191 ++++++++++++++++++++++++++++++++++
 10 files changed, 346 insertions(+), 5 deletions(-)
 create mode 100644 include/net/netns/xdp.h
 create mode 100644 include/uapi/linux/xdp_diag.h
 create mode 100644 net/xdp/xsk.h
 create mode 100644 net/xdp/xsk_diag.c
Signature · 1 line
2.19.1