Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 May 2011 22:45:13 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r221561 - head/sys/dev/xl
Message-ID:  <201105062245.p46MjD9Z069748@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105062245.p46MjD9Z069748>