From: Simon Horman <horms@kernel.org>
To: William Tu <witu@nvidia.com>
Cc: netdev@vger.kernel.org, jiri@nvidia.com, bodong@nvidia.com,
tariqt@nvidia.com, yossiku@nvidia.com, kuba@kernel.org
Subject: Re: [PATCH net-next RFC 1/2] devlink: Add shared descriptor eswitch attr
Date: Wed, 28 Feb 2024 13:12:49 +0000 [thread overview]
Message-ID: <20240228131249.GE292522@kernel.org> (raw)
In-Reply-To: <20240228015954.11981-1-witu@nvidia.com>
On Wed, Feb 28, 2024 at 03:59:53AM +0200, William Tu wrote:
...
> diff --git a/net/devlink/netlink_gen.c b/net/devlink/netlink_gen.c
> index c81cf2dd154f..ac8b0c7105dd 100644
> --- a/net/devlink/netlink_gen.c
> +++ b/net/devlink/netlink_gen.c
> @@ -194,12 +194,14 @@ static const struct nla_policy devlink_eswitch_get_nl_policy[DEVLINK_ATTR_DEV_NA
> };
>
> /* DEVLINK_CMD_ESWITCH_SET - do */
> -static const struct nla_policy devlink_eswitch_set_nl_policy[DEVLINK_ATTR_ESWITCH_ENCAP_MODE + 1] = {
> +static const struct nla_policy devlink_eswitch_set_nl_policy[DEVLINK_ATTR_ESWITCH_SHRDESC_COUNT + 1] = {
> [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
> [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
> [DEVLINK_ATTR_ESWITCH_MODE] = NLA_POLICY_MAX(NLA_U16, 1),
> [DEVLINK_ATTR_ESWITCH_INLINE_MODE] = NLA_POLICY_MAX(NLA_U16, 3),
> [DEVLINK_ATTR_ESWITCH_ENCAP_MODE] = NLA_POLICY_MAX(NLA_U8, 1),
> + [DEVLINK_ATTR_ESWITCH_SHRDESC_MODE] = NLA_POLICY_MAX(NLA_U8, 1),
> + [DEVLINK_ATTR_ESWITCH_SHRDESC_COUNT] = NLA_POLICY_MAX(NLA_U32, 65535),
> };
Hi William,
I realise this is probably not central to your purpose in sending an RFC,
but my understanding is that the max value set using NLA_POLICY_MAX
is of type s16, and thus 65535 is too large - it becomes -1.
Flagged by W=1 build with clang-17.
>
> /* DEVLINK_CMD_DPIPE_TABLE_GET - do */
...
next prev parent reply other threads:[~2024-02-28 13:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-28 1:59 [PATCH net-next RFC 1/2] devlink: Add shared descriptor eswitch attr William Tu
2024-02-28 1:59 ` [PATCH net-next RFC 2/2] net/mlx5e: Add eswitch shared descriptor devlink William Tu
2024-02-28 13:12 ` Simon Horman [this message]
2024-02-28 13:20 ` [PATCH net-next RFC 1/2] devlink: Add shared descriptor eswitch attr Jiri Pirko
2024-02-29 5:24 ` William Tu
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=20240228131249.GE292522@kernel.org \
--to=horms@kernel.org \
--cc=bodong@nvidia.com \
--cc=jiri@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tariqt@nvidia.com \
--cc=witu@nvidia.com \
--cc=yossiku@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.