public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Simon Horman <horms@kernel.org>
Cc: William Tu <witu@nvidia.com>,
	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 14:20:16 +0100	[thread overview]
Message-ID: <Zd8zECmvTWF_gZO5@nanopsycho> (raw)
In-Reply-To: <20240228131249.GE292522@kernel.org>

Wed, Feb 28, 2024 at 02:12:49PM CET, horms@kernel.org wrote:
>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.

First of all:
/* Do not edit directly, auto-generated from: */
/*      Documentation/netlink/specs/devlink.yaml */



>
>>  
>>  /* DEVLINK_CMD_DPIPE_TABLE_GET - do */
>
>...
>

  reply	other threads:[~2024-02-28 13:20 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 ` [PATCH net-next RFC 1/2] devlink: Add shared descriptor eswitch attr Simon Horman
2024-02-28 13:20   ` Jiri Pirko [this message]
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=Zd8zECmvTWF_gZO5@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=bodong@nvidia.com \
    --cc=horms@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox