Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151525278
D7104.id18137.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D7104.id18137.diff
View Options
Index: sys/dev/hyperv/vmbus/hv_channel_mgmt.c
===================================================================
--- sys/dev/hyperv/vmbus/hv_channel_mgmt.c
+++ sys/dev/hyperv/vmbus/hv_channel_mgmt.c
@@ -247,7 +247,7 @@
}
static void
-vmbus_channel_select_defcpu(struct hv_vmbus_channel *chan)
+vmbus_chan_cpu_default(struct hv_vmbus_channel *chan)
{
/*
* By default, pin the channel to cpu0. Devices having
@@ -262,56 +262,54 @@
const struct vmbus_message *msg)
{
const struct vmbus_chanmsg_choffer *offer;
- hv_vmbus_channel* new_channel;
+ struct hv_vmbus_channel *chan;
int error;
offer = (const struct vmbus_chanmsg_choffer *)msg->msg_data;
- /*
- * Allocate the channel object and save this offer
- */
- new_channel = vmbus_chan_alloc(sc);
- if (new_channel == NULL) {
+ chan = vmbus_chan_alloc(sc);
+ if (chan == NULL) {
device_printf(sc->vmbus_dev, "allocate chan%u failed\n",
offer->chm_chanid);
return;
}
- new_channel->ch_id = offer->chm_chanid;
- new_channel->ch_subidx = offer->chm_subidx;
- new_channel->ch_guid_type = offer->chm_chtype;
- new_channel->ch_guid_inst = offer->chm_chinst;
+ chan->ch_id = offer->chm_chanid;
+ chan->ch_subidx = offer->chm_subidx;
+ chan->ch_guid_type = offer->chm_chtype;
+ chan->ch_guid_inst = offer->chm_chinst;
/* Batch reading is on by default */
- new_channel->ch_flags |= VMBUS_CHAN_FLAG_BATCHREAD;
- if (offer->chm_flags1 & VMBUS_CHOFFER_FLAG1_HASMNF)
- new_channel->ch_flags |= VMBUS_CHAN_FLAG_HASMNF;
+ chan->ch_flags |= VMBUS_CHAN_FLAG_BATCHREAD;
- new_channel->ch_monprm->mp_connid = VMBUS_CONNID_EVENT;
+ chan->ch_monprm->mp_connid = VMBUS_CONNID_EVENT;
if (sc->vmbus_version != VMBUS_VERSION_WS2008)
- new_channel->ch_monprm->mp_connid = offer->chm_connid;
+ chan->ch_monprm->mp_connid = offer->chm_connid;
- if (new_channel->ch_flags & VMBUS_CHAN_FLAG_HASMNF) {
- new_channel->ch_montrig_idx =
- offer->chm_montrig / VMBUS_MONTRIG_LEN;
- if (new_channel->ch_montrig_idx >= VMBUS_MONTRIGS_MAX)
+ if (offer->chm_flags1 & VMBUS_CHOFFER_FLAG1_HASMNF) {
+ /*
+ * 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)
panic("invalid monitor trigger %u", offer->chm_montrig);
- new_channel->ch_montrig_mask =
+ chan->ch_montrig_mask =
1 << (offer->chm_montrig % VMBUS_MONTRIG_LEN);
}
/* Select default cpu for this channel. */
- vmbus_channel_select_defcpu(new_channel);
+ vmbus_chan_cpu_default(chan);
- error = vmbus_chan_add(new_channel);
+ error = vmbus_chan_add(chan);
if (error) {
device_printf(sc->vmbus_dev, "add chan%u failed: %d\n",
- new_channel->ch_id, error);
- vmbus_chan_free(new_channel);
+ chan->ch_id, error);
+ vmbus_chan_free(chan);
return;
}
- if (HV_VMBUS_CHAN_ISPRIMARY(new_channel)) {
+ if (HV_VMBUS_CHAN_ISPRIMARY(chan)) {
/*
* Add device for this primary channel.
*
@@ -319,7 +317,7 @@
* Error is ignored here; don't have much to do if error
* really happens.
*/
- hv_vmbus_child_device_register(new_channel);
+ hv_vmbus_child_device_register(chan);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 10, 12:41 AM (6 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31182756
Default Alt Text
D7104.id18137.diff (3 KB)
Attached To
Mode
D7104: hyperv/vmbus: Cleanup vmbus_chan_msgproc_choffer
Attached
Detach File
Event Timeline
Log In to Comment