OSDN Git Service

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)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 2 Oct 2020 17:59:55 +0000 (10:59 -0700)
commit410bd754cd73c4a2ac3856d9a03d7b08f9c906bf
treebefc8e8b360dc58eec0f0f84afd436326f15ca00
parent1d5558b1f0de81f54ddee05f3793acc5260d107f
net/mlx5: Add retry mechanism to the command entry index allocation

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>
drivers/net/ethernet/mellanox/mlx5/core/cmd.c