mbox series

[net-next,v2,0/6] netlink: support reporting missing attributes

Message ID 20220825024122.1998968-1-kuba@kernel.org (mailing list archive)
Headers show
Series netlink: support reporting missing attributes | expand

Message

Jakub Kicinski Aug. 25, 2022, 2:41 a.m. UTC
This series adds support for reporting missing attributes
in a structured way. We can't point at things which don't
exist so we point at the containing nest or preceding
fixed header and report which attr type we expected to see.

Example of (YAML-based) user space reporting ethtool header
missing:

 Kernel error: missing attribute: .header

I was tempted to integrate the check with the policy
but it seems tricky without doing a full scan, and there
may be a ton of attrs in the policy. So leaving that
for later.

v2:
 - add patch 1
 - remove the nest attr if the attr is missing in the root

Jakub Kicinski (6):
  netlink: factor out extack composition
  netlink: add support for ext_ack missing attributes
  netlink: add helpers for extack attr presence checking
  devlink: use missing attribute ext_ack
  ethtool: strset: report missing ETHTOOL_A_STRINGSET_ID via ext_ack
  ethtool: report missing header via ext_ack in the default handler

 Documentation/userspace-api/netlink/intro.rst |  7 +-
 include/linux/netlink.h                       | 24 +++++
 include/net/genetlink.h                       |  7 ++
 include/uapi/linux/netlink.h                  |  6 ++
 net/core/devlink.c                            | 41 ++++----
 net/ethtool/netlink.c                         |  3 +
 net/ethtool/strset.c                          |  2 +-
 net/netlink/af_netlink.c                      | 97 +++++++++++++------
 8 files changed, 133 insertions(+), 54 deletions(-)

Comments

Johannes Berg Aug. 25, 2022, 6:51 a.m. UTC | #1
On Wed, 2022-08-24 at 19:41 -0700, Jakub Kicinski wrote:
> This series adds support for reporting missing attributes
> in a structured way. We can't point at things which don't
> exist so we point at the containing nest or preceding
> fixed header
> 

If you were planning to use the cover letter for anything, then that "or
preceding fixed header" should now be removed :)

Apart from the couple of nits I just sent,

Reviewed-by: Johannes Berg <johannes@sipsolutions.net>

(for the whole set)

Thanks for doing this!

johannes