Date: Tue, 7 Jun 2011 20:46:03 +0000 (UTC) From: Marko Zec <zec@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r222834 - head/sys/net Message-ID: <201106072046.p57Kk3TC099716@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: zec Date: Tue Jun 7 20:46:03 2011 New Revision: 222834 URL: http://svn.freebsd.org/changeset/base/222834 Log: Set curvnet context in a callout-trigerred code path. MFC after: 3 days Modified: head/sys/net/bridgestp.c head/sys/net/bridgestp.h Modified: head/sys/net/bridgestp.c ============================================================================== --- head/sys/net/bridgestp.c Tue Jun 7 19:39:34 2011 (r222833) +++ head/sys/net/bridgestp.c Tue Jun 7 20:46:03 2011 (r222834) @@ -1860,6 +1860,8 @@ bstp_tick(void *arg) if (bs->bs_running == 0) return; + CURVNET_SET(bs->bs_vnet); + /* slow timer to catch missed link events */ if (bstp_timer_expired(&bs->bs_link_timer)) { LIST_FOREACH(bp, &bs->bs_bplist, bp_next) @@ -1893,6 +1895,8 @@ bstp_tick(void *arg) bp->bp_txcount--; } + CURVNET_RESTORE(); + callout_reset(&bs->bs_bstpcallout, hz, bstp_tick, bs); } @@ -2126,6 +2130,7 @@ bstp_attach(struct bstp_state *bs, struc bs->bs_protover = BSTP_PROTO_RSTP; bs->bs_state_cb = cb->bcb_state; bs->bs_rtage_cb = cb->bcb_rtage; + bs->bs_vnet = curvnet; getmicrotime(&bs->bs_last_tc_time); Modified: head/sys/net/bridgestp.h ============================================================================== --- head/sys/net/bridgestp.h Tue Jun 7 19:39:34 2011 (r222833) +++ head/sys/net/bridgestp.h Tue Jun 7 20:46:03 2011 (r222834) @@ -358,6 +358,7 @@ struct bstp_state { LIST_HEAD(, bstp_port) bs_bplist; bstp_state_cb_t bs_state_cb; bstp_rtage_cb_t bs_rtage_cb; + struct vnet *bs_vnet; }; #define BSTP_LOCK_INIT(_bs) mtx_init(&(_bs)->bs_mtx, "bstp", NULL, MTX_DEF)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106072046.p57Kk3TC099716>