]> git.baikalelectronics.ru Git - kernel.git/commit
NTB: Fix ntb_transport out-of-order RX update
authorAllen Hubbe <Allen.Hubbe@emc.com>
Mon, 13 Jul 2015 12:07:08 +0000 (08:07 -0400)
committerJon Mason <jdmason@kudzu.us>
Sun, 9 Aug 2015 20:32:21 +0000 (16:32 -0400)
commit0f9449f3b687853f426c7e57497aa913a3bc7069
treeb806c45f7d5e96eb1460f3b656bd9b7bb3646ee9
parentff0ffcac2f691cccf6819bd3a07f6659607f7a62
NTB: Fix ntb_transport out-of-order RX update

It was possible for a synchronous update of the RX index in the error
case to get ahead of the asynchronous RX index update in the normal
case.  Change the RX processing to preserve an RX completion order.

There were two error cases.  First, if a buffer is not present to
receive data, there would be no queue entry to preserve the RX
completion order.  Instead of dropping the RX frame, leave the RX frame
in the ring.  Schedule RX processing when RX entries are enqueued, in
case there are RX frames waiting in the ring to be received.

Second, if a buffer is too small to receive data, drop the frame in the
ring, mark the RX entry as done, and indicate the error in the RX entry
length.  Check for a negative length in the receive callback in
ntb_netdev, and count occurrences as rx_length_errors.

Signed-off-by: Allen Hubbe <Allen.Hubbe@emc.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/net/ntb_netdev.c
drivers/ntb/ntb_transport.c