Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Oct 2019 10:25:46 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r353258 - stable/11/sys/dev/mlx5/mlx5_core
Message-ID:  <201910071025.x97APkAc024766@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Mon Oct  7 10:25:46 2019
New Revision: 353258
URL: https://svnweb.freebsd.org/changeset/base/353258

Log:
  MFC r352993:
  Randomize the delay when waiting for VSC flag in mlx5core.
  
  The PRM suggests random 0 - 10ms to prevent multiple waiters on the same
  interval in order to avoid starvation.
  
  Submitted by:	slavash@
  Sponsored by:	Mellanox Technologies

Modified:
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_vsc.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_vsc.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_vsc.c	Mon Oct  7 10:25:08 2019	(r353257)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_vsc.c	Mon Oct  7 10:25:46 2019	(r353258)
@@ -52,7 +52,7 @@ int mlx5_vsc_lock(struct mlx5_core_dev *mdev)
 			 * The PRM suggests random 0 - 10ms to prevent multiple
 			 * waiters on the same interval in order to avoid starvation
 			 */
-			DELAY((random() % 11) * 1000);
+			DELAY((random() % 9000) + 1000);
 			continue;
 		}
 
@@ -99,7 +99,7 @@ mlx5_vsc_wait_on_flag(struct mlx5_core_dev *mdev, u32 
 			break;
 
 		retries++;
-		DELAY(10);
+		DELAY((random() % 90) + 10);
 	}
 
 	return 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910071025.x97APkAc024766>