All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roi Dayan <roid@nvidia.com>
To: Alexander Lobakin <alexandr.lobakin@intel.com>,
	Saeed Mahameed <saeed@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>,
	Saeed Mahameed <saeedm@nvidia.com>,
	netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
	Mark Bloch <mbloch@nvidia.com>, Maor Dickman <maord@nvidia.com>
Subject: Re: [net-next 14/15] net/mlx5: E-Switch, Move send to vport meta rule creation
Date: Sun, 28 Aug 2022 09:37:20 +0300	[thread overview]
Message-ID: <2fbe2856-bd90-54f4-014a-4ed13f87c907@nvidia.com> (raw)
In-Reply-To: <20220824144328.1535198-1-olek@wotan.strafe.russland>



On 2022-08-24 5:43 PM, Alexander Lobakin wrote:
> From: Saeed Mahameed <saeed@kernel.org>
> Date: Mon, 22 Aug 2022 22:55:32 -0700
> 
>> From: Roi Dayan <roid@nvidia.com>
>>
>> Move the creation of the rules from offloads fdb table init to
>> per rep vport init.
>> This way the driver will creating the send to vport meta rule
>> on any representor, e.g. SF representors.
>>
>> Signed-off-by: Roi Dayan <roid@nvidia.com>
>> Reviewed-by: Mark Bloch <mbloch@nvidia.com>
>> Reviewed-by: Maor Dickman <maord@nvidia.com>
>> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
>> ---
>>   .../net/ethernet/mellanox/mlx5/core/en_main.c |   4 +-
>>   .../net/ethernet/mellanox/mlx5/core/en_rep.c  |  53 ++++++++-
>>   .../net/ethernet/mellanox/mlx5/core/en_rep.h  |   9 +-
>>   .../net/ethernet/mellanox/mlx5/core/eswitch.c |   1 -
>>   .../net/ethernet/mellanox/mlx5/core/eswitch.h |   5 +-
>>   .../mellanox/mlx5/core/eswitch_offloads.c     | 112 +++++-------------
>>   6 files changed, 90 insertions(+), 94 deletions(-)
> 
> [...]
> 
>> +static int
>> +mlx5e_rep_add_meta_tunnel_rule(struct mlx5e_priv *priv)
>> +{
>> +	struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
>> +	struct mlx5e_rep_priv *rpriv = priv->ppriv;
>> +	struct mlx5_eswitch_rep *rep = rpriv->rep;
>> +	struct mlx5_flow_handle *flow_rule;
>> +	struct mlx5_flow_group *g;
>> +	int err;
>> +
>> +	g = esw->fdb_table.offloads.send_to_vport_meta_grp;
>> +	if (!g)
>> +		return 0;
>> +
>> +	flow_rule = mlx5_eswitch_add_send_to_vport_meta_rule(esw, rep->vport);
>> +	if (IS_ERR(flow_rule)) {
>> +		err = PTR_ERR(flow_rule);
>> +		goto out;
>> +	}
>> +
>> +	rpriv->send_to_vport_meta_rule = flow_rule;
>> +
>> +out:
>> +	return err;
>> +}
> 
> On my system (LLVM, CONFIG_WERROR=y):
> 
> drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:481:6: error: variable 'err' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
>          if (IS_ERR(flow_rule)) {
>              ^~~~~~~~~~~~~~~~~
> drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:489:9: note: uninitialized use occurs here
>          return err;
>                 ^~~
> 
> I believe you can just
> 
> 	if (IS_ERR(flow_rule))
> 		return PTR_ERR(flow_rule);
> 
> 	rpriv->send_to_vport_meta_rule = flow_rule;
> 
> 	return 0;
> }
> 
> ?

thanks. missed that. i see the series got merged so i'll send a fix.

> 
>> +
>> +static void
>> +mlx5e_rep_del_meta_tunnel_rule(struct mlx5e_priv *priv)
>> +{
>> +	struct mlx5e_rep_priv *rpriv = priv->ppriv;
>> +
>> +	if (rpriv->send_to_vport_meta_rule)
>> +		mlx5_eswitch_del_send_to_vport_meta_rule(rpriv->send_to_vport_meta_rule);
>> +}
> 
> [...]
> 
>> -- 
>> 2.37.1
> 
> Thanks,
> Olek


  reply	other threads:[~2022-08-28  6:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-23  5:55 [pull request][net-next 00/15] mlx5 updates 2022-08-22 Saeed Mahameed
2022-08-23  5:55 ` [net-next 01/15] net/mlx5e: Introduce flow steering API Saeed Mahameed
2022-08-24 12:30   ` patchwork-bot+netdevbpf
2022-08-23  5:55 ` [net-next 02/15] net/mlx5e: Decouple fs_tt_redirect from en.h Saeed Mahameed
2022-08-23  5:55 ` [net-next 03/15] net/mlx5e: Decouple fs_tcp " Saeed Mahameed
2022-08-23  5:55 ` [net-next 04/15] net/mlx5e: Drop priv argument of ptp function in en_fs Saeed Mahameed
2022-08-23  5:55 ` [net-next 05/15] net/mlx5e: Convert ethtool_steering member of flow_steering struct to pointer Saeed Mahameed
2022-08-23  5:55 ` [net-next 06/15] net/mlx5e: Directly get flow_steering struct as input when init/cleanup ethtool steering Saeed Mahameed
2022-08-23  5:55 ` [net-next 07/15] net/mlx5e: Separate ethtool_steering from fs.h and make private Saeed Mahameed
2022-08-23  5:55 ` [net-next 08/15] net/mlx5e: Introduce flow steering debug macros Saeed Mahameed
2022-08-23  5:55 ` [net-next 09/15] net/mlx5e: Make flow steering arfs independent of priv Saeed Mahameed
2022-08-23  5:55 ` [net-next 10/15] net/mlx5e: Make all ttc functions of en_fs get fs struct as argument Saeed Mahameed
2022-08-23  5:55 ` [net-next 11/15] net/mlx5e: Completely eliminate priv from fs.h Saeed Mahameed
2022-08-23  5:55 ` [net-next 12/15] net/mlx5: E-Switch, Add default drop rule for unmatched packets Saeed Mahameed
2022-08-23  5:55 ` [net-next 13/15] net/mlx5: E-Switch, Split creating fdb tables into smaller chunks Saeed Mahameed
2022-08-23  5:55 ` [net-next 14/15] net/mlx5: E-Switch, Move send to vport meta rule creation Saeed Mahameed
2022-08-24 14:43   ` Alexander Lobakin
2022-08-28  6:37     ` Roi Dayan [this message]
2022-08-23  5:55 ` [net-next 15/15] net/mlx5: TC, Add support for SF tunnel offload 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=2fbe2856-bd90-54f4-014a-4ed13f87c907@nvidia.com \
    --to=roid@nvidia.com \
    --cc=alexandr.lobakin@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=maord@nvidia.com \
    --cc=mbloch@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.