Commit d5ec899a authored by Amir Vadai's avatar Amir Vadai Committed by David S. Miller

net/mlx4_en: Report actual number of rings in indirection table

Hardware requires the number of rings in indirection table to be a power
of 2. When setting number of channels to a non power of 2 number,
indirection table is using only the closest power of 2 rings.
Report this number in 'ethtool -x' and not the total number of rx rings.
Signed-off-by: default avatarAmir Vadai <amirv@mellanox.com>
Signed-off-by: default avatarEugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 207af6c5
...@@ -982,6 +982,7 @@ static int mlx4_en_get_rxfh(struct net_device *dev, u32 *ring_index, u8 *key) ...@@ -982,6 +982,7 @@ static int mlx4_en_get_rxfh(struct net_device *dev, u32 *ring_index, u8 *key)
int err = 0; int err = 0;
rss_rings = priv->prof->rss_rings ?: priv->rx_ring_num; rss_rings = priv->prof->rss_rings ?: priv->rx_ring_num;
rss_rings = 1 << ilog2(rss_rings);
while (n--) { while (n--) {
ring_index[n] = rss_map->qps[n % rss_rings].qpn - ring_index[n] = rss_map->qps[n % rss_rings].qpn -
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment