hi roland, ... On Wed, Jun 20, 2007 at 02:00:27PM -0700, Roland Dreier wrote: > > + tail = *(volatile u64 *)pd->port_rcvhdrtail_kvaddr; > > Why is there a volatile here? cf http://lwn.net/Articles/234017/ > ("volatile considered harmful")
from that article: - Pointers to data structures in coherent memory which might be modified by I/O devices can, sometimes, legitimately be volatile. A ring buffer used by a network adapter, where that adapter changes pointers to indicate which descriptors have been processed, is an example of this type of situation. the port_rcvhdrttail_kvaddr is the kernel virtual address allocated in coherent memory where the header queue is updated by the chip. we use volatile to make sure the compiler does not use stale data... arthur _______________________________________________ general mailing list [email protected] http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
