OSDN Git Service

net: mvpp2: enable proper per-CPU TX buffers unmapping
authorMarcin Wojtas <mw@semihalf.com>
Thu, 6 Aug 2015 17:00:29 +0000 (19:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 Aug 2015 17:57:00 +0000 (10:57 -0700)
commit71ce391dfb7843f4d31abcd7287967a00cb1b8a1
tree6208eafcd6ce9eb5577f5564027fa29100cef2bb
parentd53793c5d6eb0cfe4175d9c315a30d65adf3478b
net: mvpp2: enable proper per-CPU TX buffers unmapping

mvpp2 driver allows usage of per-CPU TX processing. Once the packets are
prepared independetly on each CPU, the hardware enqueues the descriptors in
common TX queue. After they are sent, the buffers and associated sk_buffs
should be released on the corresponding CPU.

This is why a special index is maintained in order to point to the right data to
be released after transmission takes place. Each per-CPU TX queue comprise an
array of sent sk_buffs, freed in mvpp2_txq_bufs_free function. However, the
index was used there also for obtaining a descriptor (and therefore a buffer to
be DMA-unmapped) from common TX queue, which was wrong, because it was not
referring to the current CPU.

This commit enables proper unmapping of sent data buffers by indexing them in
per-CPU queues using a dedicated array for keeping their physical addresses.

Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2.c