Skip to content

Commit 65b4eb9

Browse files
kliteynPaolo Abeni
authored andcommitted
net/mlx5: HWS, removed wrong access to a number of rules variable
Removed wrong access to the num_of_rules field of the matcher. This is a usual u32 variable, but the access was as if it was atomic. This fixes the following CI warnings: mlx5hws_bwc.c:708:17: warning: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0 bytes) [-Watomic-alignment] Fixes: 510f9f6 ("net/mlx5: HWS, added API and enabled HWS support") Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Yevgeny Kliteynik <[email protected]> Reviewed-by: Itamar Gozlan <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 7decd1f commit 65b4eb9

File tree

1 file changed

+1
-3
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/steering/hws

1 file changed

+1
-3
lines changed

drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,6 @@ static int hws_bwc_matcher_move(struct mlx5hws_bwc_matcher *bwc_matcher)
691691
static int
692692
hws_bwc_matcher_rehash_size(struct mlx5hws_bwc_matcher *bwc_matcher)
693693
{
694-
u32 num_of_rules;
695694
int ret;
696695

697696
/* If the current matcher size is already at its max size, we can't
@@ -705,8 +704,7 @@ hws_bwc_matcher_rehash_size(struct mlx5hws_bwc_matcher *bwc_matcher)
705704
* Need to check again if we really need rehash.
706705
* If the reason for rehash was size, but not any more - skip rehash.
707706
*/
708-
num_of_rules = __atomic_load_n(&bwc_matcher->num_of_rules, __ATOMIC_RELAXED);
709-
if (!hws_bwc_matcher_rehash_size_needed(bwc_matcher, num_of_rules))
707+
if (!hws_bwc_matcher_rehash_size_needed(bwc_matcher, bwc_matcher->num_of_rules))
710708
return 0;
711709

712710
/* Now we're done all the checking - do the rehash:

0 commit comments

Comments
 (0)