Lines Matching defs:channel
127 static u8 channel_monitor_group(const struct vmbus_channel *channel)
129 return (u8)channel->offermsg.monitorid / 32;
132 static u8 channel_monitor_offset(const struct vmbus_channel *channel)
134 return (u8)channel->offermsg.monitorid % 32;
137 static u32 channel_pending(const struct vmbus_channel *channel,
140 u8 monitor_group = channel_monitor_group(channel);
145 static u32 channel_latency(const struct vmbus_channel *channel,
148 u8 monitor_group = channel_monitor_group(channel);
149 u8 monitor_offset = channel_monitor_offset(channel);
154 static u32 channel_conn_id(struct vmbus_channel *channel,
157 u8 monitor_group = channel_monitor_group(channel);
158 u8 monitor_offset = channel_monitor_offset(channel);
167 if (!hv_dev->channel)
169 return sprintf(buf, "%d\n", hv_dev->channel->offermsg.child_relid);
178 if (!hv_dev->channel)
180 return sprintf(buf, "%d\n", hv_dev->channel->state);
189 if (!hv_dev->channel)
191 return sprintf(buf, "%d\n", hv_dev->channel->offermsg.monitorid);
200 if (!hv_dev->channel)
203 &hv_dev->channel->offermsg.offer.if_type);
212 if (!hv_dev->channel)
215 &hv_dev->channel->offermsg.offer.if_instance);
234 if (!hv_dev->channel)
237 return sprintf(buf, "%d\n", cpu_to_node(hv_dev->channel->target_cpu));
248 if (!hv_dev->channel)
251 channel_pending(hv_dev->channel,
262 if (!hv_dev->channel)
265 channel_pending(hv_dev->channel,
276 if (!hv_dev->channel)
279 channel_latency(hv_dev->channel,
290 if (!hv_dev->channel)
293 channel_latency(hv_dev->channel,
304 if (!hv_dev->channel)
307 channel_conn_id(hv_dev->channel,
318 if (!hv_dev->channel)
321 channel_conn_id(hv_dev->channel,
333 if (!hv_dev->channel)
336 ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound,
352 if (!hv_dev->channel)
355 ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound,
371 if (!hv_dev->channel)
374 ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound,
390 if (!hv_dev->channel)
393 ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound,
409 if (!hv_dev->channel)
412 ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound,
427 if (!hv_dev->channel)
430 ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
445 if (!hv_dev->channel)
448 ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
463 if (!hv_dev->channel)
466 ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
482 if (!hv_dev->channel)
485 ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
501 if (!hv_dev->channel)
504 ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
517 struct vmbus_channel *channel = hv_dev->channel, *cur_sc;
521 if (!channel)
527 channel->offermsg.child_relid, channel->target_cpu);
529 list_for_each(cur, &channel->sc_list) {
659 if (!hv_dev->channel->offermsg.monitor_allocated &&
864 if (is_hvsock_channel(hv_dev->channel))
985 struct vmbus_channel *channel = hv_dev->channel;
990 hv_process_channel_removal(channel);
1124 * which tries to open the channel by sending an
1127 * rescinded the channel before it receives the
1140 * The host sends the offer message of a given channel
1142 * channel. These messages are sent to the guest's
1179 static void vmbus_force_channel_rescinded(struct vmbus_channel *channel)
1184 WARN_ON(!is_hvsock_channel(channel));
1203 rescind->child_relid = channel->offermsg.child_relid;
1225 * can be directly checked to get the id of the channel
1242 struct vmbus_channel *channel;
1247 /* Special case - vmbus channel protocol msg */
1253 * Guarantees that the channel data structure doesn't
1254 * get freed while the channel pointer below is being
1259 /* Find channel based on relid */
1260 channel = relid2channel(relid);
1261 if (channel == NULL)
1264 if (channel->rescind)
1270 * for the channel's onchannel_callback being NULL within a
1274 spin_lock(&channel->sched_lock);
1276 callback_fn = channel->onchannel_callback;
1280 trace_vmbus_chan_sched(channel);
1282 ++channel->interrupts;
1284 switch (channel->callback_mode) {
1286 (*callback_fn)(channel->channel_callback_context);
1290 hv_begin_read(&channel->inbound);
1293 tasklet_schedule(&channel->callback_event);
1297 spin_unlock(&channel->sched_lock);
1333 * If bit n is set then we have an interrup on the channel
1421 * - retrieve the channel offers
1498 * the VMbus channel connection to prevent any VMbus
1577 * Called when last reference to channel is gone.
1581 struct vmbus_channel *channel
1584 kfree_rcu(channel, rcu);
1637 static ssize_t out_mask_show(struct vmbus_channel *channel, char *buf)
1639 struct hv_ring_buffer_info *rbi = &channel->outbound;
1654 static ssize_t in_mask_show(struct vmbus_channel *channel, char *buf)
1656 struct hv_ring_buffer_info *rbi = &channel->inbound;
1671 static ssize_t read_avail_show(struct vmbus_channel *channel, char *buf)
1673 struct hv_ring_buffer_info *rbi = &channel->inbound;
1688 static ssize_t write_avail_show(struct vmbus_channel *channel, char *buf)
1690 struct hv_ring_buffer_info *rbi = &channel->outbound;
1705 static ssize_t target_cpu_show(struct vmbus_channel *channel, char *buf)
1707 return sprintf(buf, "%u\n", channel->target_cpu);
1709 static ssize_t target_cpu_store(struct vmbus_channel *channel,
1734 * Synchronizes target_cpu_store() and channel closure:
1752 * Note. The host processes the channel messages "sequentially", in
1761 if (channel->state != CHANNEL_OPENED_STATE) {
1766 origin_cpu = channel->target_cpu;
1770 if (vmbus_send_modifychannel(channel->offermsg.child_relid,
1785 * lags. It will function correctly even if a channel interrupt comes
1786 * in on a CPU that is different from the channel target_cpu value.
1789 channel->target_cpu = target_cpu;
1792 if (hv_is_perf_channel(channel))
1796 if (channel->change_target_cpu_callback) {
1797 (*channel->change_target_cpu_callback)(channel,
1808 static ssize_t channel_pending_show(struct vmbus_channel *channel,
1812 channel_pending(channel,
1817 static ssize_t channel_latency_show(struct vmbus_channel *channel,
1821 channel_latency(channel,
1826 static ssize_t channel_interrupts_show(struct vmbus_channel *channel, char *buf)
1828 return sprintf(buf, "%llu\n", channel->interrupts);
1832 static ssize_t channel_events_show(struct vmbus_channel *channel, char *buf)
1834 return sprintf(buf, "%llu\n", channel->sig_events);
1838 static ssize_t channel_intr_in_full_show(struct vmbus_channel *channel,
1842 (unsigned long long)channel->intr_in_full);
1846 static ssize_t channel_intr_out_empty_show(struct vmbus_channel *channel,
1850 (unsigned long long)channel->intr_out_empty);
1854 static ssize_t channel_out_full_first_show(struct vmbus_channel *channel,
1858 (unsigned long long)channel->out_full_first);
1862 static ssize_t channel_out_full_total_show(struct vmbus_channel *channel,
1866 (unsigned long long)channel->out_full_total);
1870 static ssize_t subchannel_monitor_id_show(struct vmbus_channel *channel,
1873 return sprintf(buf, "%u\n", channel->offermsg.monitorid);
1877 static ssize_t subchannel_id_show(struct vmbus_channel *channel,
1881 channel->offermsg.offer.sub_channel_index);
1911 const struct vmbus_channel *channel =
1915 if (!channel->offermsg.monitor_allocated &&
1937 int vmbus_add_channel_kobj(struct hv_device *dev, struct vmbus_channel *channel)
1940 struct kobject *kobj = &channel->kobj;
1941 u32 relid = channel->offermsg.child_relid;
1957 * empty channel directory.
1960 dev_err(device, "Unable to set up channel sysfs files\n");
1970 * vmbus_remove_channel_attr_group - remove the channel's attribute group
1972 void vmbus_remove_channel_attr_group(struct vmbus_channel *channel)
1974 sysfs_remove_group(&channel->kobj, &vmbus_chan_group);
1983 struct vmbus_channel *channel)
1993 child_device_obj->channel = channel;
2010 &child_device_obj->channel->offermsg.offer.if_instance);
2035 child_device_obj->channel);
2385 struct vmbus_channel *channel, *sc;
2389 * We wait here until the completion of any channel
2396 list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
2397 if (!is_hvsock_channel(channel))
2400 vmbus_force_channel_rescinded(channel);
2409 * a hv_sock channel of an established hv_sock connection can not be
2411 * application, so we just force the hv_sock channel to be rescinded
2413 * will thoroughly destroy the channel after hibernation.
2416 * the VM has no sub-channel and hv_sock channel, e.g. a 1-vCPU VM.
2428 list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
2430 * Remove the channel from the array of channels and invalidate
2431 * the channel's relid. Upon resume, vmbus_onoffer() will fix
2433 * channel back to the array.
2435 vmbus_channel_unmap_relid(channel);
2436 channel->offermsg.child_relid = INVALID_RELID;
2438 if (is_hvsock_channel(channel)) {
2439 if (!channel->rescind) {
2440 pr_err("hv_sock channel not rescinded!\n");
2446 list_for_each_entry(sc, &channel->sc_list, sc_list) {
2447 pr_err("Sub-channel not deleted!\n");