net: mvpp2: release reference to txq_cpu[] entry after unmapping
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 21 Feb 2017 10:28:05 +0000 (11:28 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Feb 2017 18:16:15 +0000 (13:16 -0500)
commit36fb7435b6ac4d288a2d4deea8934f9456ab46b6
treef4d4b08eb232ead0332c795e9bb9848876bcc63b
parentab42676af052e6d3502b31c2dc6b07af08ff126f
net: mvpp2: release reference to txq_cpu[] entry after unmapping

The mvpp2_txq_bufs_free() function is called upon TX completion to DMA
unmap TX buffers, and free the corresponding SKBs. It gets the
references to the SKB to free and the DMA buffer to unmap from a per-CPU
txq_pcpu data structure.

However, the code currently increments the pointer to the next entry
before doing the DMA unmap and freeing the SKB. It does not cause any
visible problem because for a given SKB the TX completion is guaranteed
to take place on the CPU where the TX was started. However, it is much
more logical to increment the pointer to the next entry once the current
entry has been completely unmapped/released.

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