svn commit: r221561 - head/sys/dev/xl

Pyun YongHyeon yongari at FreeBSD.org
Fri May 6 22:45:14 UTC 2011


Author: yongari
Date: Fri May  6 22:45:13 2011
New Revision: 221561
URL: http://svn.freebsd.org/changeset/base/221561

Log:
  Updating status word should be the last operation of UPD structure
  renewal.  Disable instruction reordering by adding volatile to
  xl_list_onefrag structure.

Modified:
  head/sys/dev/xl/if_xl.c
  head/sys/dev/xl/if_xlreg.h

Modified: head/sys/dev/xl/if_xl.c
==============================================================================
--- head/sys/dev/xl/if_xl.c	Fri May  6 22:36:43 2011	(r221560)
+++ head/sys/dev/xl/if_xl.c	Fri May  6 22:45:13 2011	(r221561)
@@ -1904,8 +1904,8 @@ xl_newbuf(struct xl_softc *sc, struct xl
 	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);
 }

Modified: head/sys/dev/xl/if_xlreg.h
==============================================================================
--- head/sys/dev/xl/if_xlreg.h	Fri May  6 22:36:43 2011	(r221560)
+++ head/sys/dev/xl/if_xlreg.h	Fri May  6 22:45:13 2011	(r221561)
@@ -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 {


More information about the svn-src-all mailing list