Skip to content

Commit 4f6626b

Browse files
mosheshemesh2Saeed Mahameed
authored andcommitted
Revert "net/mlx5: Add retry mechanism to the command entry index allocation"
This reverts commit 410bd75. The reverted commit had added a retry mechanism to the command entry index allocation. The previous patch ensures that there is a free command entry index once the command work handler holds the command semaphore. Thus the retry mechanism is not needed. Fixes: 410bd75 ("net/mlx5: Add retry mechanism to the command entry index allocation") Signed-off-by: Moshe Shemesh <[email protected]> Reviewed-by: Eran Ben Elisha <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 8e715cd commit 4f6626b

File tree

1 file changed

+1
-20
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+1
-20
lines changed

drivers/net/ethernet/mellanox/mlx5/core/cmd.c

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -904,25 +904,6 @@ static bool opcode_allowed(struct mlx5_cmd *cmd, u16 opcode)
904904
return cmd->allowed_opcode == opcode;
905905
}
906906

907-
static int cmd_alloc_index_retry(struct mlx5_cmd *cmd)
908-
{
909-
unsigned long alloc_end = jiffies + msecs_to_jiffies(1000);
910-
int idx;
911-
912-
retry:
913-
idx = cmd_alloc_index(cmd);
914-
if (idx < 0 && time_before(jiffies, alloc_end)) {
915-
/* Index allocation can fail on heavy load of commands. This is a temporary
916-
* situation as the current command already holds the semaphore, meaning that
917-
* another command completion is being handled and it is expected to release
918-
* the entry index soon.
919-
*/
920-
cpu_relax();
921-
goto retry;
922-
}
923-
return idx;
924-
}
925-
926907
bool mlx5_cmd_is_down(struct mlx5_core_dev *dev)
927908
{
928909
return pci_channel_offline(dev->pdev) ||
@@ -950,7 +931,7 @@ static void cmd_work_handler(struct work_struct *work)
950931
sem = ent->page_queue ? &cmd->pages_sem : &cmd->sem;
951932
down(sem);
952933
if (!ent->page_queue) {
953-
alloc_ret = cmd_alloc_index_retry(cmd);
934+
alloc_ret = cmd_alloc_index(cmd);
954935
if (alloc_ret < 0) {
955936
mlx5_core_err_rl(dev, "failed to allocate command entry\n");
956937
if (ent->callback) {

0 commit comments

Comments
 (0)