net/mlx5e: Verify coalescing parameters in range
authorMoshe Shemesh <moshe@mellanox.com>
Thu, 15 Feb 2018 10:41:48 +0000 (12:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Apr 2018 10:31:16 +0000 (12:31 +0200)
commitae4d4eb29e545b24aa04e947f156ec8e520c8b17
tree04ed6c934fa1f20bd24d865e49f963bcbb0d84bb
parent7102de5aef566b2a51111d49d81a14bb10bb36c4
net/mlx5e: Verify coalescing parameters in range

[ Upstream commit b392a2078b5e0094ff38aa0c9d2a31b3f607d4ef ]

Add check of coalescing parameters received through ethtool are within
range of values supported by the HW.
Driver gets the coalescing rx/tx-usecs and rx/tx-frames as set by the
users through ethtool. The ethtool support up to 32 bit value for each.
However, mlx5 modify cq limits the coalescing time parameter to 12 bit
and coalescing frames parameters to 16 bits.
Return out of range error if user tries to set these parameters to
higher values.

Fixes: f62b8bb8f2d3 ('net/mlx5: Extend mlx5_core to support ConnectX-4 Ethernet functionality')
Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c