]> git.baikalelectronics.ru Git - kernel.git/commit
ibmvnic: Improve TX buffer accounting
authorThomas Falcon <tlfalcon@linux.vnet.ibm.com>
Sat, 17 Mar 2018 01:00:29 +0000 (20:00 -0500)
committerDavid S. Miller <davem@davemloft.net>
Sun, 18 Mar 2018 00:12:39 +0000 (20:12 -0400)
commit09b6e906e62b54852a2310b9347455e0759f44e4
tree3b30dd206b66a9d533ab19473afc46378a2f2c3d
parent6e707f21df03eb0fe70b4a803ea06017d0ef685a
ibmvnic: Improve TX buffer accounting

Improve TX pool buffer accounting to prevent the producer
index from overruning the consumer. First, set the next free
index to an invalid value if it is in use. If next buffer
to be consumed is in use, drop the packet.

Finally, if the transmit fails for some other reason, roll
back the consumer index and set the free map entry to its original
value. This should also be done if the DMA map fails.

Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ibm/ibmvnic.c