lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2fbe2856-bd90-54f4-014a-4ed13f87c907@nvidia.com>
Date:   Sun, 28 Aug 2022 09:37:20 +0300
From:   Roi Dayan <roid@...dia.com>
To:     Alexander Lobakin <alexandr.lobakin@...el.com>,
        Saeed Mahameed <saeed@...nel.org>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Eric Dumazet <edumazet@...gle.com>,
        Saeed Mahameed <saeedm@...dia.com>, netdev@...r.kernel.org,
        Tariq Toukan <tariqt@...dia.com>,
        Mark Bloch <mbloch@...dia.com>, Maor Dickman <maord@...dia.com>
Subject: Re: [net-next 14/15] net/mlx5: E-Switch, Move send to vport meta rule
 creation



On 2022-08-24 5:43 PM, Alexander Lobakin wrote:
> From: Saeed Mahameed <saeed@...nel.org>
> Date: Mon, 22 Aug 2022 22:55:32 -0700
> 
>> From: Roi Dayan <roid@...dia.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@...dia.com>
>> Reviewed-by: Mark Bloch <mbloch@...dia.com>
>> Reviewed-by: Maor Dickman <maord@...dia.com>
>> Signed-off-by: Saeed Mahameed <saeedm@...dia.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ