]> git.baikalelectronics.ru Git - kernel.git/commit
net: mv643xx_eth: ensure coalesce settings survive read-modify-write
authorRussell King <rmk+kernel@armlinux.org.uk>
Tue, 1 Nov 2016 10:50:01 +0000 (10:50 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Nov 2016 16:17:16 +0000 (12:17 -0400)
commit6c0e61ec18a45c1a36b45e255b3e6c65600b3ed4
treee938511fe8a1bbf73eed926c1f96cac7d0da86fc
parentb9dd743e151303d92a1e6496380a1d203d754cb4
net: mv643xx_eth: ensure coalesce settings survive read-modify-write

The coalesce settings behave badly when changing just one value:

... # ethtool -c eth0
rx-usecs: 249
... # ethtool -C eth0 tx-usecs 250
... # ethtool -c eth0
rx-usecs: 248

This occurs due to rounding errors when calculating the microseconds
value - the divisons round down.  This causes (eg) the rx-usecs to
decrease by one every time the tx-usecs value is set as per the above.

Fix this by making the divison round-to-nearest.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mv643xx_eth.c