]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: Geneve, Fix handling of Geneve object id as error code
authorMaor Dickman <maord@nvidia.com>
Wed, 8 Feb 2023 15:44:06 +0000 (17:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 12:55:27 +0000 (13:55 +0100)
commitede076ae7af87b38d5a3cbdab10d3d2c1bbbfa25
tree56cbaf018f0264e08841d20b93e8d122f4cf7d64
parent259b1a08aef4d607194a40f9006b894941bae7ec
net/mlx5: Geneve, Fix handling of Geneve object id as error code

[ Upstream commit cf50115be971ab03e94c861f6fe45081be6e0694 ]

On success, mlx5_geneve_tlv_option_create returns non negative
Geneve object id. In case the object id is positive value the
caller functions will handle it as an error (non zero) and
will fail to offload the Geneve rule.

Fix this by changing caller function ,mlx5_geneve_tlv_option_add,
to return 0 in case valid non negative object id was provided.

Fixes: 56e702b36a5b ("net/mlx5: Geneve, Manage Geneve TLV options")
Signed-off-by: Maor Dickman <maord@nvidia.com>
Reviewed-by: Raed Salem <raeds@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/lib/geneve.c