mbox series

[net-next,v2,0/3] netlink: handle EMSGSIZE errors in the core

Message ID 20240303052408.310064-1-kuba@kernel.org (mailing list archive)
Headers show
Series netlink: handle EMSGSIZE errors in the core | expand

Message

Jakub Kicinski March 3, 2024, 5:24 a.m. UTC
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/20240301012845.2951053-1-kuba@kernel.org/

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(-)

Comments

patchwork-bot+netdevbpf@kernel.org March 6, 2024, 8:10 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Sat,  2 Mar 2024 21:24:05 -0800 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/3] netlink: handle EMSGSIZE errors in the core
    https://git.kernel.org/netdev/net-next/c/b5a899154aa9
  - [net-next,v2,2/3] netdev: let netlink core handle -EMSGSIZE errors
    https://git.kernel.org/netdev/net-next/c/0b11b1c5c320
  - [net-next,v2,3/3] genetlink: fit NLMSG_DONE into same read() as families
    https://git.kernel.org/netdev/net-next/c/87d381973e49

You are awesome, thank you!