Lines Matching refs:channel

35 static void init_vp_index(struct vmbus_channel *channel,
140 struct vmbus_channel *channel; in alloc_channel() local
142 channel = kzalloc(sizeof(*channel), GFP_ATOMIC); in alloc_channel()
143 if (!channel) in alloc_channel()
146 channel->id = atomic_inc_return(&chan_num); in alloc_channel()
147 spin_lock_init(&channel->inbound_lock); in alloc_channel()
148 spin_lock_init(&channel->lock); in alloc_channel()
150 INIT_LIST_HEAD(&channel->sc_list); in alloc_channel()
151 INIT_LIST_HEAD(&channel->percpu_list); in alloc_channel()
153 return channel; in alloc_channel()
159 static void free_channel(struct vmbus_channel *channel) in free_channel() argument
161 kfree(channel); in free_channel()
166 struct vmbus_channel *channel = arg; in percpu_channel_enq() local
169 list_add_tail(&channel->percpu_list, &hv_context.percpu_list[cpu]); in percpu_channel_enq()
174 struct vmbus_channel *channel = arg; in percpu_channel_deq() local
176 list_del(&channel->percpu_list); in percpu_channel_deq()
180 void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid) in hv_process_channel_removal() argument
191 if (channel == NULL) in hv_process_channel_removal()
194 if (channel->target_cpu != get_cpu()) { in hv_process_channel_removal()
196 smp_call_function_single(channel->target_cpu, in hv_process_channel_removal()
197 percpu_channel_deq, channel, true); in hv_process_channel_removal()
199 percpu_channel_deq(channel); in hv_process_channel_removal()
203 if (channel->primary_channel == NULL) { in hv_process_channel_removal()
205 list_del(&channel->listentry); in hv_process_channel_removal()
208 primary_channel = channel; in hv_process_channel_removal()
210 primary_channel = channel->primary_channel; in hv_process_channel_removal()
212 list_del(&channel->sc_list); in hv_process_channel_removal()
221 cpumask_clear_cpu(channel->target_cpu, in hv_process_channel_removal()
224 free_channel(channel); in hv_process_channel_removal()
229 struct vmbus_channel *channel, *tmp; in vmbus_free_channels() local
231 list_for_each_entry_safe(channel, tmp, &vmbus_connection.chn_list, in vmbus_free_channels()
236 channel->rescind = true; in vmbus_free_channels()
238 vmbus_device_unregister(channel->device_obj); in vmbus_free_channels()
248 struct vmbus_channel *channel; in vmbus_process_offer() local
255 list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) { in vmbus_process_offer()
256 if (!uuid_le_cmp(channel->offermsg.offer.if_type, in vmbus_process_offer()
258 !uuid_le_cmp(channel->offermsg.offer.if_instance, in vmbus_process_offer()
279 newchannel->primary_channel = channel; in vmbus_process_offer()
280 spin_lock_irqsave(&channel->lock, flags); in vmbus_process_offer()
281 list_add_tail(&newchannel->sc_list, &channel->sc_list); in vmbus_process_offer()
282 channel->num_sc++; in vmbus_process_offer()
283 spin_unlock_irqrestore(&channel->lock, flags); in vmbus_process_offer()
308 if (channel->sc_creation_callback != NULL) in vmbus_process_offer()
309 channel->sc_creation_callback(newchannel); in vmbus_process_offer()
397 static void init_vp_index(struct vmbus_channel *channel, const uuid_le *type_guid) in init_vp_index() argument
402 struct vmbus_channel *primary = channel->primary_channel; in init_vp_index()
422 channel->numa_node = 0; in init_vp_index()
423 channel->target_cpu = 0; in init_vp_index()
424 channel->target_vp = hv_context.vp_index[0]; in init_vp_index()
444 channel->numa_node = next_node; in init_vp_index()
445 primary = channel; in init_vp_index()
487 channel->target_cpu = cur_cpu; in init_vp_index()
488 channel->target_vp = hv_context.vp_index[cur_cpu]; in init_vp_index()
580 struct vmbus_channel *channel; in vmbus_onoffer_rescind() local
585 channel = relid2channel(rescind->child_relid); in vmbus_onoffer_rescind()
587 if (channel == NULL) { in vmbus_onoffer_rescind()
592 spin_lock_irqsave(&channel->lock, flags); in vmbus_onoffer_rescind()
593 channel->rescind = true; in vmbus_onoffer_rescind()
594 spin_unlock_irqrestore(&channel->lock, flags); in vmbus_onoffer_rescind()
596 if (channel->device_obj) { in vmbus_onoffer_rescind()
601 dev = get_device(&channel->device_obj->device); in vmbus_onoffer_rescind()
603 vmbus_device_unregister(channel->device_obj); in vmbus_onoffer_rescind()
607 hv_process_channel_removal(channel, in vmbus_onoffer_rescind()
608 channel->offermsg.child_relid); in vmbus_onoffer_rescind()