summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMaor Dickman <maord@nvidia.com>2023-02-08 18:44:06 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-11 18:40:13 +0300
commit8817602cffe0107834865b5d2c2fb7f77132d7dc (patch)
tree3311e19872686e49c34821750f4a0a75f43603f6 /drivers
parent0ac65fab2b3f121e4d606b3729cf06da0bfc8885 (diff)
downloadlinux-8817602cffe0107834865b5d2c2fb7f77132d7dc.tar.xz
net/mlx5: Geneve, Fix handling of Geneve object id as error code
[ Upstream commit d28a06d7dbedc598a06bd1e53a28125f87ca5d0c ] 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: 0ccc171ea6a2 ("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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/lib/geneve.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/geneve.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/geneve.c
index 23361a9ae4fa..6dc83e871cd7 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/geneve.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/geneve.c
@@ -105,6 +105,7 @@ int mlx5_geneve_tlv_option_add(struct mlx5_geneve *geneve, struct geneve_opt *op
geneve->opt_type = opt->type;
geneve->obj_id = res;
geneve->refcount++;
+ res = 0;
}
unlock: