Date: Wed, 20 Jul 2016 06:12:32 +0000 (UTC) From: Sepherosa Ziehau <sephe@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303072 - head/sys/dev/hyperv/vmbus Message-ID: <201607200612.u6K6CW9v069738@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sephe Date: Wed Jul 20 06:12:32 2016 New Revision: 303072 URL: https://svnweb.freebsd.org/changeset/base/303072 Log: hyperv/vmbus: Save MNF trigger location instead of MNF trigger index. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7246 Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c head/sys/dev/hyperv/vmbus/vmbus_chanvar.h Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Jul 20 06:00:27 2016 (r303071) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Jul 20 06:12:32 2016 (r303072) @@ -89,13 +89,10 @@ vmbus_chan_signal_tx(struct hv_vmbus_cha atomic_set_long(&sc->vmbus_tx_evtflags[chanid >> VMBUS_EVTFLAG_SHIFT], 1UL << (chanid & VMBUS_EVTFLAG_MASK)); - if (chan->ch_flags & VMBUS_CHAN_FLAG_HASMNF) { - atomic_set_int( - &sc->vmbus_mnf2->mnf_trigs[chan->ch_montrig_idx].mt_pending, - chan->ch_montrig_mask); - } else { + if (chan->ch_flags & VMBUS_CHAN_FLAG_HASMNF) + atomic_set_int(chan->ch_montrig, chan->ch_montrig_mask); + else hypercall_signal_event(chan->ch_monprm_dma.hv_paddr); - } } static int @@ -1106,13 +1103,19 @@ vmbus_chan_msgproc_choffer(struct vmbus_ chan->ch_monprm->mp_connid = offer->chm_connid; if (offer->chm_flags1 & VMBUS_CHOFFER_FLAG1_HASMNF) { + int trig_idx; + /* * Setup MNF stuffs. */ chan->ch_flags |= VMBUS_CHAN_FLAG_HASMNF; - chan->ch_montrig_idx = offer->chm_montrig / VMBUS_MONTRIG_LEN; - if (chan->ch_montrig_idx >= VMBUS_MONTRIGS_MAX) + + trig_idx = offer->chm_montrig / VMBUS_MONTRIG_LEN; + if (trig_idx >= VMBUS_MONTRIGS_MAX) panic("invalid monitor trigger %u", offer->chm_montrig); + chan->ch_montrig = + &sc->vmbus_mnf2->mnf_trigs[trig_idx].mt_pending; + chan->ch_montrig_mask = 1 << (offer->chm_montrig % VMBUS_MONTRIG_LEN); } Modified: head/sys/dev/hyperv/vmbus/vmbus_chanvar.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chanvar.h Wed Jul 20 06:00:27 2016 (r303071) +++ head/sys/dev/hyperv/vmbus/vmbus_chanvar.h Wed Jul 20 06:12:32 2016 (r303072) @@ -80,7 +80,7 @@ typedef struct hv_vmbus_channel { * These are based on the offer_msg.monitor_id. * Save it here for easy access. */ - int ch_montrig_idx; /* MNF trig index */ + volatile uint32_t *ch_montrig; /* MNF trigger */ uint32_t ch_montrig_mask;/* MNF trig mask */ /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607200612.u6K6CW9v069738>