fate#314663 hyper-v memory ballooning support
[opensuse:kernel-source.git] / patches.suse / suse-hv-fate314665-0008-Drivers-hv-Update-the-ring-buffer-structure-to-match.patch
1 Patch-mainline: submitted
2 From: <ohering@suse.de>
3 Date: Sat, 1 Dec 2012 06:46:39 -0800
4 Subject: [PATCH 08/28] Drivers: hv: Update the ring buffer structure to match
5  win8 functionality
6
7 Update the ringbuffer structure to support win8 functionality.
8
9 Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
10 Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
11 ---
12  include/linux/hyperv.h | 28 +++++++++++++++++++++-------
13  1 file changed, 21 insertions(+), 7 deletions(-)
14
15 diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
16 index b097bf9..2b54801 100644
17 --- a/include/linux/hyperv.h
18 +++ b/include/linux/hyperv.h
19 @@ -325,14 +325,28 @@ struct hv_ring_buffer {
20  
21         u32 interrupt_mask;
22  
23 -       /* Pad it to PAGE_SIZE so that data starts on page boundary */
24 -       u8      reserved[4084];
25 -
26 -       /* NOTE:
27 -        * The interrupt_mask field is used only for channels but since our
28 -        * vmbus connection also uses this data structure and its data starts
29 -        * here, we commented out this field.
30 +       /*
31 +        * Win8 uses some of the reserved bits to implement
32 +        * interrupt driven flow management. On the send side
33 +        * we can request that the receiver interrupt the sender
34 +        * when the ring transitions from being full to being able
35 +        * to handle a message of size "pending_send_sz".
36 +        *
37 +        * Add necessary state for this enhancement.
38          */
39 +       u32 pending_send_sz;
40 +
41 +       u32 reserved1[12];
42 +
43 +       union {
44 +               struct {
45 +                       u32 feat_pending_send_sz:1;
46 +               };
47 +               u32 value;
48 +       } feature_bits;
49 +
50 +       /* Pad it to PAGE_SIZE so that data starts on page boundary */
51 +       u8      reserved2[4028];
52  
53         /*
54          * Ring data starts here + RingDataStartOffset
55 -- 
56 1.8.0.1
57