HomeFreeBSD

sfxge: add barriers to BAR write macros

Description

sfxge: add barriers to BAR write macros

In theory the barriers are required to cope with write combining and
reordering. Two barriers are added (sometimes merged to one):

  1. Before the first write to guarantee that previous writes to the region have been done
  2. Before the last write to guarantee that write to the last dword/qword is done after previous writes

Barriers are inserted before in the assumption that it is better to
postpone barriers as much as it is possible (more chances that the
operation has already been already done and barrier does not stall CPU).

On x86 and amd64 bus space write barriers are just compiler memory barriers
which are definitely required.

Sponsored by: Solarflare Communications, Inc.
Differential Revision: https://reviews.freebsd.org/D2077

Details

Provenance
arybchikAuthored on
Differential Revision
D2077: sfxge: add barriers to BAR write macros
Parents
rS280374: sfxge: assert either kernel or internal copy of interface flags
Branches
Unknown
Tags
Unknown

Event Timeline