ibmvnic: Ensure that SCRQ entry reads are correctly ordered
authorThomas Falcon <tlfalcon@linux.ibm.com>
Tue, 1 Dec 2020 15:52:10 +0000 (09:52 -0600)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Dec 2020 18:09:04 +0000 (10:09 -0800)
commitb71ec952234610b4f90ef17a2fdcb124d5320070
treefa2ca8f1ae8fc7d8b776f10a5a7e49b877c2487e
parent237f977ab920490502f5fe39af4390f26db2cd40
ibmvnic: Ensure that SCRQ entry reads are correctly ordered

Ensure that received Subordinate Command-Response Queue (SCRQ)
entries are properly read in order by the driver. These queues
are used in the ibmvnic device to process RX buffer and TX completion
descriptors. dma_rmb barriers have been added after checking for a
pending descriptor to ensure the correct descriptor entry is checked
and after reading the SCRQ descriptor to ensure the entire
descriptor is read before processing.

Fixes: 032c5e82847a ("Driver for IBM System i/p VNIC protocol")
Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ibm/ibmvnic.c