mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
52a42c2a90
commit
ae6935ed7d
3 changed files with 169 additions and 122 deletions
|
@ -741,6 +741,7 @@ struct vmbus_channel {
|
|||
/* Allocated memory for ring buffer */
|
||||
struct page *ringbuffer_page;
|
||||
u32 ringbuffer_pagecount;
|
||||
u32 ringbuffer_send_offset;
|
||||
struct hv_ring_buffer_info outbound; /* send to parent */
|
||||
struct hv_ring_buffer_info inbound; /* receive from parent */
|
||||
|
||||
|
@ -1021,6 +1022,14 @@ struct vmbus_packet_mpb_array {
|
|||
struct hv_mpb_array range;
|
||||
} __packed;
|
||||
|
||||
int vmbus_alloc_ring(struct vmbus_channel *channel,
|
||||
u32 send_size, u32 recv_size);
|
||||
void vmbus_free_ring(struct vmbus_channel *channel);
|
||||
|
||||
int vmbus_connect_ring(struct vmbus_channel *channel,
|
||||
void (*onchannel_callback)(void *context),
|
||||
void *context);
|
||||
int vmbus_disconnect_ring(struct vmbus_channel *channel);
|
||||
|
||||
extern int vmbus_open(struct vmbus_channel *channel,
|
||||
u32 send_ringbuffersize,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue