]> 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)
commite5d5b8780516d0e3eeaa9edc50c3408950303af7
tree3b30dd206b66a9d533ab19473afc46378a2f2c3d
parentd5dc0796459f88fd5353fc0a2f115ade5b3d2dd9
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