All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: Roi Dayan <roid@mellanox.com>,
	"saeedm@dev.mellanox.co.il" <saeedm@dev.mellanox.co.il>,
	Paul Blakey <paulb@mellanox.com>,
	"xiangxia.m.yue@gmail.com" <xiangxia.m.yue@gmail.com>,
	"gerlitz.or@gmail.com" <gerlitz.or@gmail.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [net-next] net/mlx5e: Remove the unnecessary parameter
Date: Tue, 25 Feb 2020 22:50:29 +0000	[thread overview]
Message-ID: <5361639fee997ea6239d6115978f86f26fb918b4.camel@mellanox.com> (raw)
In-Reply-To: <1582646588-91471-1-git-send-email-xiangxia.m.yue@gmail.com>

On Wed, 2020-02-26 at 00:03 +0800, xiangxia.m.yue@gmail.com wrote:
> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> 
> The parameter desired_size is always 0, and there is only one
> function calling the mlx5_esw_chains_get_avail_sz_from_pool.
> Deleting the parameter desired_size.

Paul, what is the reasoning behind desired size, i confirm that it  is
not actually used right now, do we have a pending patch that needs it
? 
if this is not going to happen in the near future i vote to apply this
patch and bring it back when needed.


Thanks,
Saeed.

> 
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> ---
>  .../net/ethernet/mellanox/mlx5/core/eswitch_offloads_chains.c | 11
> +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git
> a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_chains.c
> b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_chains.c
> index c5a446e..ce5b7e1 100644
> ---
> a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_chains.c
> +++
> b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_chains.c
> @@ -134,19 +134,14 @@ static unsigned int
> mlx5_esw_chains_get_level_range(struct mlx5_eswitch *esw)
>  	return FDB_TC_LEVELS_PER_PRIO;
>  }
>  
> -#define POOL_NEXT_SIZE 0
>  static int
> -mlx5_esw_chains_get_avail_sz_from_pool(struct mlx5_eswitch *esw,
> -				       int desired_size)
> +mlx5_esw_chains_get_avail_sz_from_pool(struct mlx5_eswitch *esw)
>  {
>  	int i, found_i = -1;
>  
>  	for (i = ARRAY_SIZE(ESW_POOLS) - 1; i >= 0; i--) {
> -		if (fdb_pool_left(esw)[i] && ESW_POOLS[i] >
> desired_size) {
> +		if (fdb_pool_left(esw)[i])
>  			found_i = i;
> -			if (desired_size != POOL_NEXT_SIZE)
> -				break;
> -		}
>  	}
>  
>  	if (found_i != -1) {
> @@ -198,7 +193,7 @@ static unsigned int
> mlx5_esw_chains_get_level_range(struct mlx5_eswitch *esw)
>  		ft_attr.flags |= (MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT |
>  				  MLX5_FLOW_TABLE_TUNNEL_EN_DECAP);
>  
> -	sz = mlx5_esw_chains_get_avail_sz_from_pool(esw,
> POOL_NEXT_SIZE);
> +	sz = mlx5_esw_chains_get_avail_sz_from_pool(esw);
>  	if (!sz)
>  		return ERR_PTR(-ENOSPC);
>  	ft_attr.max_fte = sz;

  reply	other threads:[~2020-02-25 22:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-25 16:03 [net-next] net/mlx5e: Remove the unnecessary parameter xiangxia.m.yue
2020-02-25 22:50 ` Saeed Mahameed [this message]
2020-02-26  9:53   ` Paul Blakey
2020-02-27  2:02     ` Tonghao Zhang

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=5361639fee997ea6239d6115978f86f26fb918b4.camel@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=gerlitz.or@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=paulb@mellanox.com \
    --cc=roid@mellanox.com \
    --cc=saeedm@dev.mellanox.co.il \
    --cc=xiangxia.m.yue@gmail.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.