Skip to content

netlink: handle EMSGSIZE errors in the core

Jakub Kicinski netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 20 repliesApplied 3/3
  2. v13 patches 3 repliesSuperseded

Changes in v2 from the cover letter

- init err to 0 in last patch
v1: https://lore.kernel.org/all/[email protected]/

Patches in v2 All 3 applied

#Subject and filesSizeRepliesApplied
1/3netlink: handle EMSGSIZE errors in the corenet/netlink/af_netlink.c+9 -01 replyApplied
2/3netdev: let netlink core handle -EMSGSIZE errorsnet/core/netdev-genl.c net/core/page_pool_user.c+3 -141 replyApplied
3/3genetlink: fit NLMSG_DONE into same read() as familiesnet/netlink/genetlink.c+7 -518 repliesApplied

Reviews trailers per patch

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

PatchEric DumazetIdo Schimmel
1/3R-b R-b
2/3R-b R-b
3/3R-b R-b R-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 net-next v2 0/3] netlink: handle EMSGSIZE errors in the core

Ido discovered some time back that we usually force NLMSG_DONE to be delivered in a separate recv() syscall, even if it would fit into the same skb as data messages. He made nexthop try to fit DONE with data in commit 8743aeff5bc4 ("nexthop: Fix infinite nexthop bucket dump when using maximum nexthop ID"), and nobody has complained so far.

We have since also tried to follow the same pattern in new genetlink families, but explaining to people, or even remembering the correct handling ourselves is tedious.

Let the netlink socket layer consume -EMSGSIZE errors. Practically speaking most families use this error code as "dump needs more space", anyway.

v2:
- init err to 0 in last patch
v1: https://lore.kernel.org/all/[email protected]/

Jakub Kicinski (3):
netlink: handle EMSGSIZE errors in the core
netdev: let netlink core handle -EMSGSIZE errors
genetlink: fit NLMSG_DONE into same read() as families

 net/core/netdev-genl.c    | 15 +++------------
 net/core/page_pool_user.c |  2 --
 net/netlink/af_netlink.c  |  9 +++++++++
 net/netlink/genetlink.c   | 12 +++++++-----
 4 files changed, 19 insertions(+), 19 deletions(-)
Signature · 1 line
2.44.0