net: mvpp2: update the BM buffer free/destroy logic
authorStefan Chulski <stefanc@marvell.com>
Mon, 5 Mar 2018 14:16:51 +0000 (15:16 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Mar 2018 17:55:54 +0000 (12:55 -0500)
commiteffbf5f58d64b1d1f93cb687d9797b42f291d5fd
tree84c30c1e467e561a409159328deb3390d5ab8eb6
parent01d049366529544f1df44139f5ca225d4c36ec31
net: mvpp2: update the BM buffer free/destroy logic

The buffer free routine is updated to release only given a number of
buffers, and the destroy routine now checks the actual number of buffers
in the (BPPI and BPPE) HW counters before draining the pools. This
change helps getting jumbo frames support.

Signed-off-by: Stefan Chulski <stefanc@marvell.com>
[Antoine: cosmetic cleanup, commit message]
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2.c