All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Jiri Pirko <jiri@resnulli.us>
Cc: Saeed Mahameed <saeed@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>,
	Saeed Mahameed <saeedm@nvidia.com>,
	netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
	Gal Pressman <gal@nvidia.com>,
	Leon Romanovsky <leonro@nvidia.com>, Jiri Pirko <jiri@nvidia.com>
Subject: Re: [PATCH net-next V2 01/14] devlink: define enum for attr types of dynamic attributes
Date: Fri, 18 Apr 2025 17:08:03 -0700	[thread overview]
Message-ID: <20250418170803.5afa2ddf@kernel.org> (raw)
In-Reply-To: <bctzge47tevxcbbawe7kvbzlygimyxstqiqpptfc63o67g4slc@jenow3ls7fgz>

On Fri, 18 Apr 2025 12:26:50 +0200 Jiri Pirko wrote:
> Thu, Apr 17, 2025 at 03:08:26AM +0200, kuba@kernel.org wrote:
> >On Mon, 14 Apr 2025 12:59:46 -0700 Saeed Mahameed wrote:  
> >> From: Jiri Pirko <jiri@nvidia.com>
> >> 
> >> Devlink param and health reporter fmsg use attributes with dynamic type
> >> which is determined according to a different type. Currently used values
> >> are NLA_*. The problem is, they are not part of UAPI. They may change
> >> which would cause a break.
> >> 
> >> To make this future safe, introduce a enum that shadows NLA_* values in
> >> it and is part of UAPI.
> >> 
> >> Also, this allows to possibly carry types that are unrelated to NLA_*
> >> values.  
> >
> >I don't think you need to expose this in C. I had to solve this
> >problem for rtnl because we nested dpll attrs in link info. Please see:
> >
> >https://github.com/kuba-moo/linux/commit/6faf7a638d0a5ded688a22a1337f56470dca85a3
> >
> >and look at the change for dpll here (sorry IDK how to link to a line :S)
> >
> >https://github.com/kuba-moo/linux/commit/00c8764ebb12f925b6f1daedd5e08e6fac478bfd
> >
> >With that you can add the decode info to the YAML spec for Python et al.
> >but there's no need do duplicate the values. Right now this patch
> >generates a bunch of "missing kdoc" warnings.
> >
> >Ima start sending those changes after the net -> net-next merge,
> >some of the prep had to go to net :(  
> 
> I may be missing something, I don't see how your work is related to
> mine. The problem I'm trying to solve is that kernel sends NLA_* values
> to userspace, without NLA_* being part of UAPI. At any time (even unlikely),
> NLA_* values in kernel may change and that would break the userspace
> suddenly getting different values.
> 
> Therefore, I introduce an enum for this. This is how it should have been
> done from day 1, it's a bug in certain sense. Possibility to carry
> non-NLA_* type in this enum is a plus we benefit from later in this
> patchset.

Ugh, I thought enum netlink_attribute_type matches the values :|
And user space uses MNL_ types.

Please don't invent _DYN_ATTR at least. Why not PARAM_TYPE ?

  reply	other threads:[~2025-04-19  0:08 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-14 19:59 [PATCH net-next V2 00/14] devlink, mlx5: Add new parameters for link management and SRIOV/eSwitch configurations Saeed Mahameed
2025-04-14 19:59 ` [PATCH net-next V2 01/14] devlink: define enum for attr types of dynamic attributes Saeed Mahameed
2025-04-17  1:08   ` Jakub Kicinski
2025-04-18 10:26     ` Jiri Pirko
2025-04-19  0:08       ` Jakub Kicinski [this message]
2025-04-22  9:14         ` Jiri Pirko
2025-04-22 14:55           ` Jakub Kicinski
2025-04-23 11:12             ` Jiri Pirko
2025-04-23 22:07               ` Jakub Kicinski
2025-04-24  9:14                 ` Jiri Pirko
2025-04-14 19:59 ` [PATCH net-next V2 02/14] devlink: Add 'total_vfs' generic device param Saeed Mahameed
2025-04-14 19:59 ` [PATCH net-next V2 03/14] net/mlx5: Implement cqe_compress_type via devlink params Saeed Mahameed
2025-04-14 19:59 ` [PATCH net-next V2 04/14] net/mlx5: Implement devlink enable_sriov parameter Saeed Mahameed
2025-04-15  7:20   ` Jiri Pirko
2025-04-14 19:59 ` [PATCH net-next V2 05/14] net/mlx5: Implement devlink total_vfs parameter Saeed Mahameed
2025-04-14 19:59 ` [PATCH net-next V2 06/14] devlink: pass struct devlink_port * as arg to devlink_nl_param_fill() Saeed Mahameed
2025-04-14 19:59 ` [PATCH net-next V2 07/14] devlink: Implement port params registration Saeed Mahameed
2025-04-14 19:59 ` [PATCH net-next V2 08/14] devlink: Implement get/dump netlink commands for port params Saeed Mahameed
2025-04-14 19:59 ` [PATCH net-next V2 09/14] devlink: Implement set netlink command " Saeed Mahameed
2025-04-14 19:59 ` [PATCH net-next V2 10/14] devlink: Add 'keep_link_up' generic devlink device param Saeed Mahameed
2025-04-14 19:59 ` [PATCH net-next V2 11/14] net/mlx5: Implement devlink keep_link_up port parameter Saeed Mahameed
2025-04-14 19:59 ` [PATCH net-next V2 12/14] devlink: Throw extack messages on param value validation error Saeed Mahameed
2025-04-14 19:59 ` [PATCH net-next V2 13/14] devlink: Implement devlink param multi attribute nested data values Saeed Mahameed
2025-04-14 19:59 ` [PATCH net-next V2 14/14] net/mlx5: Implement eSwitch hairpin per prio buffers devlink params Saeed Mahameed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250418170803.5afa2ddf@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=jiri@nvidia.com \
    --cc=jiri@resnulli.us \
    --cc=leonro@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeed@kernel.org \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.