diff options
author | Stephen Hemminger <stephen@networkplumber.org> | 2018-09-14 12:10:17 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-25 14:33:24 -0400 |
commit | ae6935ed7d424ffa74d634da00767e7b03c98fd3 (patch) | |
tree | d26a4096301a8555277b50eb9741bcb978a308b2 /include/linux/hyperv.h | |
parent | 52a42c2a90226dc61c99bbd0cb096deeb52c334b (diff) |
vmbus: split ring buffer allocation from open
The UIO driver needs the ring buffer to be persistent(reused)
across open/close. Split the allocation and setup of ring buffer
out of vmbus_open. For normal usage vmbus_open/vmbus_close there
are no changes; only impacts uio_hv_generic which needs to keep
ring buffer memory and reuse when application restarts.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/hyperv.h')
-rw-r--r-- | include/linux/hyperv.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index a6c32d2d090b..b3e24368930a 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h | |||
@@ -741,6 +741,7 @@ struct vmbus_channel { | |||
741 | /* Allocated memory for ring buffer */ | 741 | /* Allocated memory for ring buffer */ |
742 | struct page *ringbuffer_page; | 742 | struct page *ringbuffer_page; |
743 | u32 ringbuffer_pagecount; | 743 | u32 ringbuffer_pagecount; |
744 | u32 ringbuffer_send_offset; | ||
744 | struct hv_ring_buffer_info outbound; /* send to parent */ | 745 | struct hv_ring_buffer_info outbound; /* send to parent */ |
745 | struct hv_ring_buffer_info inbound; /* receive from parent */ | 746 | struct hv_ring_buffer_info inbound; /* receive from parent */ |
746 | 747 | ||
@@ -1021,6 +1022,14 @@ struct vmbus_packet_mpb_array { | |||
1021 | struct hv_mpb_array range; | 1022 | struct hv_mpb_array range; |
1022 | } __packed; | 1023 | } __packed; |
1023 | 1024 | ||
1025 | int vmbus_alloc_ring(struct vmbus_channel *channel, | ||
1026 | u32 send_size, u32 recv_size); | ||
1027 | void vmbus_free_ring(struct vmbus_channel *channel); | ||
1028 | |||
1029 | int vmbus_connect_ring(struct vmbus_channel *channel, | ||
1030 | void (*onchannel_callback)(void *context), | ||
1031 | void *context); | ||
1032 | int vmbus_disconnect_ring(struct vmbus_channel *channel); | ||
1024 | 1033 | ||
1025 | extern int vmbus_open(struct vmbus_channel *channel, | 1034 | extern int vmbus_open(struct vmbus_channel *channel, |
1026 | u32 send_ringbuffersize, | 1035 | u32 send_ringbuffersize, |