]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5: Add retry mechanism to the command entry index allocation
authorEran Ben Elisha <eranbe@nvidia.com>
Mon, 31 Aug 2020 12:04:35 +0000 (15:04 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Oct 2020 09:55:56 +0000 (11:55 +0200)
commit91ddbc505218f20fd858dec7f7152beca64e928c
tree57542bc176ca00954c43e3397209b4f8408f54b9
parent963f9da027303820d43cbf469b20dfdde48b1207
net/mlx5: Add retry mechanism to the command entry index allocation

[ Upstream commit 410bd754cd73c4a2ac3856d9a03d7b08f9c906bf ]

It is possible that new command entry index allocation will temporarily
fail. The new command holds the semaphore, so it means that a free entry
should be ready soon. Add one second retry mechanism before returning an
error.

Patch "net/mlx5: Avoid possible free of command entry while timeout comp
handler" increase the possibility to bump into this temporarily failure
as it delays the entry index release for non-callback commands.

Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
Signed-off-by: Eran Ben Elisha <eranbe@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/cmd.c