OSDN Git Service

bnxt_en: Add missing DMA memory barriers
authorMichael Chan <michael.chan@broadcom.com>
Sun, 15 Aug 2021 20:15:37 +0000 (16:15 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Aug 2021 10:31:41 +0000 (11:31 +0100)
commit828affc27ed43441bd1efdaf4e07e96dd43a0362
tree20077ce5ef32c3175f4f2d14e5bbbd061c8d08b3
parent976e52b718c3de9077fff8f3f674afb159c57fb1
bnxt_en: Add missing DMA memory barriers

Each completion ring entry has a valid bit to indicate that the entry
contains a valid completion event.  The driver's main poll loop
__bnxt_poll_work() has the proper dma_rmb() to make sure the valid
bit of the next entry has been checked before proceeding further.
But when we call bnxt_rx_pkt() to process the RX event, the RX
completion event consists of two completion entries and only the
first entry has been checked to be valid.  We need the same barrier
after checking the next completion entry.  Add missing dma_rmb()
barriers in bnxt_rx_pkt() and other similar locations.

Fixes: 67a95e2022c7 ("bnxt_en: Need memory barrier when processing the completion ring.")
Reported-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c