net/mlx5e: Fix ethtool -g/G rx ring parameter report with striding RQ
authorEran Ben Elisha <eranbe@mellanox.com>
Sun, 28 Aug 2016 22:13:46 +0000 (01:13 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Aug 2016 03:24:15 +0000 (23:24 -0400)
commitcc8e9ebf952699cb6870f1366a4920d05b036e31
treeac2651c5d31fede401c5e8348abdb04431ef7c12
parent6e8dd6d6f4bd2fd6fefdbf2e73bf251e36db59af
net/mlx5e: Fix ethtool -g/G rx ring parameter report with striding RQ

The driver RQ has two possible configurations: striding RQ and
non-striding RQ.  Until this patch, the driver always reported the
number of hardware WQEs (ring descriptors). For non striding RQ
configuration, this was OK since we have one WQE per pending packet
For striding RQ, multiple packets can fit into one WQE. For better
user experience we normalize the rx_pending parameter (size of wqe/mtu)
as the average ring size in case of striding RQ.

Fixes: 461017cb006a ('net/mlx5e: Support RX multi-packet WQE ...')
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c