Skip to contentSkip to conversation

net/mlx4: fix sparse warnings on wrong type for RSS keys

PATCH In review Yevgeny Petrilin 1 participant 1 message Mar 6, 2012

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 4/8 net/mlx4: fix sparse warnings on wrong type for RSS keys

From: Yevgeny Petrilin <[email protected]>

The keys used for the hardware RSS topelitz hash are of type __be32
where the values provided by the driver are from array of u32,
this triggered sparse warning on incorrect type in assignment as of different base types. Since these values are picked randomly,
the fix is to transform the key to __be32 by executing cpu_to_be_32()

---
 drivers/net/ethernet/mellanox/mlx4/en_rx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/ethernet/mellanox/mlx4/en_rx.c +1 -1
index c881712..9adbd53 100644
@@ -910,7 +910,7 @@ int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv)
 	rss_context->flags = rss_mask;
 	rss_context->hash_fn = MLX4_RSS_HASH_TOP;
 	for (i = 0; i < 10; i++)
-		rss_context->rss_key[i] = rsskey[i];
+		rss_context->rss_key[i] = cpu_to_be32(rsskey[i]);
 
 	err = mlx4_qp_to_ready(mdev->dev, &priv->res.mtt, &context,
 			       &rss_map->indir_qp, &rss_map->indir_state);
Signature · 1 line
1.7.7