From 6356409dba298549e32431a1880412217b1987b3 Mon Sep 17 00:00:00 2001 From: yongari Date: Fri, 6 May 2011 22:45:13 +0000 Subject: Updating status word should be the last operation of UPD structure renewal. Disable instruction reordering by adding volatile to xl_list_onefrag structure. --- sys/dev/xl/if_xl.c | 2 +- sys/dev/xl/if_xlreg.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/xl/if_xl.c b/sys/dev/xl/if_xl.c index d3d522f..88a7ba8 100644 --- a/sys/dev/xl/if_xl.c +++ b/sys/dev/xl/if_xl.c @@ -1904,8 +1904,8 @@ xl_newbuf(struct xl_softc *sc, struct xl_chain_onefrag *c) sc->xl_tmpmap = map; c->xl_mbuf = m_new; c->xl_ptr->xl_frag.xl_len = htole32(m_new->m_len | XL_LAST_FRAG); - c->xl_ptr->xl_status = 0; c->xl_ptr->xl_frag.xl_addr = htole32(segs->ds_addr); + c->xl_ptr->xl_status = 0; bus_dmamap_sync(sc->xl_mtag, c->xl_map, BUS_DMASYNC_PREREAD); return (0); } diff --git a/sys/dev/xl/if_xlreg.h b/sys/dev/xl/if_xlreg.h index 2685c44..5c1c60c 100644 --- a/sys/dev/xl/if_xlreg.h +++ b/sys/dev/xl/if_xlreg.h @@ -468,8 +468,8 @@ struct xl_list { struct xl_list_onefrag { u_int32_t xl_next; /* final entry has 0 nextptr */ - u_int32_t xl_status; - struct xl_frag xl_frag; + volatile u_int32_t xl_status; + volatile struct xl_frag xl_frag; }; struct xl_list_data { -- cgit v1.1