netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	Vladyslav Tarasiuk <vladyslavt@nvidia.com>,
	Tariq Toukan <tariqt@nvidia.com>
Subject: Re: [net-next 09/12] net/mlx5e: Validate stop_room size upon user input
Date: Wed, 04 Nov 2020 16:38:43 -0800	[thread overview]
Message-ID: <c8f7ec13a4a64e258ad07a7029551ea6f6d21df2.camel@kernel.org> (raw)
In-Reply-To: <20201104140256.1b65e751@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>

On Wed, 2020-11-04 at 14:02 -0800, Jakub Kicinski wrote:
> On Tue, 3 Nov 2020 11:47:35 -0800 Saeed Mahameed wrote:
> > From: Vladyslav Tarasiuk <vladyslavt@nvidia.com>
> > 
> > Stop room is a space that may be taken by WQEs in the SQ during a
> > packet
> > transmit. It is used to check if next packet has enough room in the
> > SQ.
> > Stop room guarantees this packet can be served and if not, the
> > queue is
> > stopped, so no more packets are passed to the driver until it's
> > ready.
> > 
> > Currently, stop_room size is calculated and validated upon tx
> > queues
> > allocation. This makes it impossible to know if user provided valid
> > input for certain parameters when interface is down.
> > 
> > Instead, store stop_room in mlx5e_sq_param and create
> > mlx5e_validate_params(), to validate its fields upon user input
> > even
> > when the interface is down.
> > 
> > Signed-off-by: Vladyslav Tarasiuk <vladyslavt@nvidia.com>
> > Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
> > Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
> 
> 32 bit build wants you to use %zd or such: 
> 

We do not test 32 bit. Will fix this,
Thanks.

> drivers/net/ethernet/mellanox/mlx5/core/en/params.c: In function
> ‘mlx5e_validate_params’:
> drivers/net/ethernet/mellanox/mlx5/core/en/params.c:182:72: warning:
> format ‘%lu’ expects argument of type ‘long unsigned int’, but
> argument 4 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=]
>   182 |   netdev_err(priv->netdev, "Stop room %hu is bigger than the
> SQ size %lu\n",
>       |                                                              
>         ~~^
>       |                                                              
>           |
>       |                                                              
>           long unsigned int
>       |                                                              
>         %u
>   183 |       stop_room, sq_size);
>       |                  ~~~~~~~                                     
>            
>       |                  |
>       |                  size_t {aka unsigned int}


  reply	other threads:[~2020-11-05  0:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03 19:47 [pull request][net-next 00/12] mlx5 updates-2020-11-03 Saeed Mahameed
2020-11-03 19:47 ` [net-next 01/12] net/mlx5: DR, Remove unused member of action struct Saeed Mahameed
2020-11-03 19:47 ` [net-next 02/12] net/mlx5: DR, Rename builders HW specific names Saeed Mahameed
2020-11-03 19:47 ` [net-next 03/12] net/mlx5: DR, Rename matcher functions to be more HW agnostic Saeed Mahameed
2020-11-03 19:47 ` [net-next 04/12] net/mlx5: DR, Add buddy allocator utilities Saeed Mahameed
2020-11-03 19:47 ` [net-next 05/12] net/mlx5: DR, Handle ICM memory via buddy allocation instead of buckets Saeed Mahameed
2020-11-03 19:47 ` [net-next 06/12] net/mlx5: DR, Sync chunks only during free Saeed Mahameed
2020-11-03 19:47 ` [net-next 07/12] net/mlx5: DR, ICM memory pools sync optimization Saeed Mahameed
2020-11-03 19:47 ` [net-next 08/12] net/mlx5: DR, Free unused buddy ICM memory Saeed Mahameed
2020-11-03 19:47 ` [net-next 09/12] net/mlx5e: Validate stop_room size upon user input Saeed Mahameed
2020-11-04 22:02   ` Jakub Kicinski
2020-11-05  0:38     ` Saeed Mahameed [this message]
2020-11-03 19:47 ` [net-next 10/12] net/mlx4: Cleanup kernel-doc warnings Saeed Mahameed
2020-11-03 19:47 ` [net-next 11/12] net/mlx5: " Saeed Mahameed
2020-11-03 19:47 ` [net-next 12/12] net: mlx5: Replace in_irq() usage 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=c8f7ec13a4a64e258ad07a7029551ea6f6d21df2.camel@kernel.org \
    --to=saeed@kernel.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tariqt@nvidia.com \
    --cc=vladyslavt@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;
as well as URLs for NNTP newsgroup(s).