[ewg] [PATCH 4/5] libnes: OpenFabrics userspace verbs

Roland Dreier rdreier at cisco.com
Wed Aug 8 10:24:18 PDT 2007


 > +	nesupd->udoorbell = mmap(NULL, page_size, PROT_WRITE | PROT_READ, MAP_SHARED,
 > +			context->cmd_fd, nesupd->db_index * page_size);
 > +
 > +	if (((void *)-1) == nesupd->udoorbell) {

probably cleaner to test against MAP_FAILED here.

 > +			asm __volatile__("": : :"memory");

This is insufficient on architectures with weak memory ordering; you
probably want mb() from <infiniband/arch.h>.



More information about the ewg mailing list