Drivers: hv: vmbus: Replace the per-CPU channel lists with a global array of channels
[sfrench/cifs-2.6.git] / drivers / hv / hyperv_vmbus.h
index 000740d053a2e1df6ed12defaf1bf0af333c6a8b..3edf993b0fd9b0240ee10dc5f1c173d9e65fe154 100644 (file)
@@ -132,12 +132,6 @@ struct hv_per_cpu_context {
         * basis.
         */
        struct tasklet_struct msg_dpc;
-
-       /*
-        * To optimize the mapping of relid to channel, maintain
-        * per-cpu list of the channels based on their CPU affinity.
-        */
-       struct list_head chan_list;
 };
 
 struct hv_context {
@@ -202,6 +196,8 @@ int hv_ringbuffer_read(struct vmbus_channel *channel,
 /* TODO: Need to make this configurable */
 #define MAX_NUM_CHANNELS_SUPPORTED     256
 
+#define MAX_CHANNEL_RELIDS                                     \
+       max(MAX_NUM_CHANNELS_SUPPORTED, HV_EVENT_FLAGS_COUNT)
 
 enum vmbus_connect_state {
        DISCONNECTED,
@@ -251,6 +247,9 @@ struct vmbus_connection {
        struct list_head chn_list;
        struct mutex channel_mutex;
 
+       /* Array of channels */
+       struct vmbus_channel **channels;
+
        /*
         * An offer message is handled first on the work_queue, and then
         * is further handled on handle_primary_chan_wq or
@@ -338,6 +337,9 @@ int vmbus_add_channel_kobj(struct hv_device *device_obj,
 
 void vmbus_remove_channel_attr_group(struct vmbus_channel *channel);
 
+void vmbus_channel_map_relid(struct vmbus_channel *channel);
+void vmbus_channel_unmap_relid(struct vmbus_channel *channel);
+
 struct vmbus_channel *relid2channel(u32 relid);
 
 void vmbus_free_channels(void);