net: mvpp2: handle too large value handling in mvpp2_rx_pkts_coal_set()
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 21 Feb 2017 10:28:03 +0000 (11:28 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Feb 2017 18:16:14 +0000 (13:16 -0500)
commitf8b0d5f8cc10f43642f97db6b37d60d765cff34a
tree9040344d57573ac34f1ad4f45ca456e839279dca
parentd63f9e41f981722b11f42ea2b19798c00fcae0f9
net: mvpp2: handle too large value handling in mvpp2_rx_pkts_coal_set()

Currently, mvpp2_rx_pkts_coal_set() does the following to avoid setting
a too large value for the RX coalescing by packet number:

  val = (pkts & MVPP2_OCCUPIED_THRESH_MASK);

This means that if you set a value that is slightly higher the the
maximum number of packets, you in fact get a very low value. It makes a
lot more sense to simply check if the value is too high, and if it's too
high, limit it to the maximum possible value.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2.c