mbox series

[SRU,F:linux-bluefield,v3,0/1] UBUNTU: SAUCE: tmfifo: Fix a memory barrier issue

Message ID cover.1620304098.git.limings@nvidia.com
Headers show
Series UBUNTU: SAUCE: tmfifo: Fix a memory barrier issue | expand

Message

Liming Sun May 6, 2021, 12:30 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1927262

SRU Justification:

[Impact]

* The virtio framework uses wmb() when updating avail->idx. It guarantees
  the write order, but not necessarily loading order for the code accessing
  the memory. So potentially it could cause traffic stuck which has been
  observed in the field.

[Fix]
* This commit adds a load barrier after reading the avail->idx to make sure
  all the data in the descriptor is visible. It also adds a barrier when
  returning the packet to virtio framework to make sure read/writes are
  visible to the virtio code.

[Test Case]
* Just normal test. This change doesn't affect any functionality.

[Regression Potential]

* This version of the driver was tested by QA/verification for a while so no
  known regression at the moment.

Comments

Tim Gardner May 7, 2021, 7:02 p.m. UTC | #1
Applied to focal:bluefield/master-next. Thanks.

-rtg

On 5/6/21 6:30 AM, Liming Sun wrote:
> BugLink: https://bugs.launchpad.net/bugs/1927262
> 
> SRU Justification:
> 
> [Impact]
> 
> * The virtio framework uses wmb() when updating avail->idx. It guarantees
>    the write order, but not necessarily loading order for the code accessing
>    the memory. So potentially it could cause traffic stuck which has been
>    observed in the field.
> 
> [Fix]
> * This commit adds a load barrier after reading the avail->idx to make sure
>    all the data in the descriptor is visible. It also adds a barrier when
>    returning the packet to virtio framework to make sure read/writes are
>    visible to the virtio code.
> 
> [Test Case]
> * Just normal test. This change doesn't affect any functionality.
> 
> [Regression Potential]
> 
> * This version of the driver was tested by QA/verification for a while so no
>    known regression at the moment.
>