]>
Commit | Line | Data |
---|---|---|
cc90b958 BS |
1 | From: plc@novell.com |
2 | Subject: add support for new operation type BLKIF_OP_PACKET | |
3 | Patch-mainline: obsolete | |
4 | References: fate#300964 | |
5 | ||
00e5a55c BS |
6 | --- sle11-2009-06-04.orig/drivers/xen/blkback/blkback.c 2009-06-04 10:20:39.000000000 +0200 |
7 | +++ sle11-2009-06-04/drivers/xen/blkback/blkback.c 2009-06-04 10:46:54.000000000 +0200 | |
cc90b958 BS |
8 | @@ -192,13 +192,15 @@ static void fast_flush_area(pending_req_ |
9 | ||
10 | static void print_stats(blkif_t *blkif) | |
11 | { | |
12 | - printk(KERN_DEBUG "%s: oo %3d | rd %4d | wr %4d | br %4d\n", | |
13 | + printk(KERN_DEBUG "%s: oo %3d | rd %4d | wr %4d | br %4d | pk %4d\n", | |
14 | current->comm, blkif->st_oo_req, | |
15 | - blkif->st_rd_req, blkif->st_wr_req, blkif->st_br_req); | |
16 | + blkif->st_rd_req, blkif->st_wr_req, blkif->st_br_req, | |
17 | + blkif->st_pk_req); | |
18 | blkif->st_print = jiffies + msecs_to_jiffies(10 * 1000); | |
19 | blkif->st_rd_req = 0; | |
20 | blkif->st_wr_req = 0; | |
21 | blkif->st_oo_req = 0; | |
22 | + blkif->st_pk_req = 0; | |
23 | } | |
24 | ||
25 | int blkif_schedule(void *arg) | |
26 | @@ -358,6 +360,13 @@ static int do_block_io_op(blkif_t *blkif | |
27 | blkif->st_wr_req++; | |
28 | dispatch_rw_block_io(blkif, &req, pending_req); | |
29 | break; | |
30 | + case BLKIF_OP_PACKET: | |
31 | + DPRINTK("error: block operation BLKIF_OP_PACKET not implemented\n"); | |
32 | + blkif->st_pk_req++; | |
33 | + make_response(blkif, req.id, req.operation, | |
34 | + BLKIF_RSP_ERROR); | |
35 | + free_req(pending_req); | |
36 | + break; | |
37 | default: | |
38 | /* A good sign something is wrong: sleep for a while to | |
39 | * avoid excessive CPU consumption by a bad guest. */ | |
00e5a55c BS |
40 | --- sle11-2009-06-04.orig/drivers/xen/blkback/common.h 2009-06-04 10:46:52.000000000 +0200 |
41 | +++ sle11-2009-06-04/drivers/xen/blkback/common.h 2009-06-04 10:46:54.000000000 +0200 | |
cc90b958 BS |
42 | @@ -87,6 +87,7 @@ typedef struct blkif_st { |
43 | int st_wr_req; | |
44 | int st_oo_req; | |
45 | int st_br_req; | |
46 | + int st_pk_req; | |
47 | int st_rd_sect; | |
48 | int st_wr_sect; | |
49 | ||
00e5a55c BS |
50 | --- sle11-2009-06-04.orig/drivers/xen/blkfront/blkfront.c 2009-06-04 10:21:09.000000000 +0200 |
51 | +++ sle11-2009-06-04/drivers/xen/blkfront/blkfront.c 2009-06-04 10:46:54.000000000 +0200 | |
52 | @@ -626,6 +626,8 @@ static int blkif_queue_request(struct re | |
cc90b958 BS |
53 | BLKIF_OP_WRITE : BLKIF_OP_READ; |
54 | if (blk_barrier_rq(req)) | |
55 | ring_req->operation = BLKIF_OP_WRITE_BARRIER; | |
56 | + if (blk_pc_request(req)) | |
57 | + ring_req->operation = BLKIF_OP_PACKET; | |
58 | ||
00e5a55c BS |
59 | ring_req->nr_segments = blk_rq_map_sg(req->q, req, info->sg); |
60 | BUG_ON(ring_req->nr_segments > BLKIF_MAX_SEGMENTS_PER_REQUEST); | |
61 | @@ -677,7 +679,7 @@ void do_blkif_request(struct request_que | |
cc90b958 BS |
62 | |
63 | while ((req = elv_next_request(rq)) != NULL) { | |
64 | info = req->rq_disk->private_data; | |
65 | - if (!blk_fs_request(req)) { | |
66 | + if (!blk_fs_request(req) && !blk_pc_request(req)) { | |
67 | end_request(req, 0); | |
68 | continue; | |
69 | } | |
00e5a55c | 70 | @@ -754,6 +756,7 @@ static irqreturn_t blkif_int(int irq, vo |
cc90b958 BS |
71 | /* fall through */ |
72 | case BLKIF_OP_READ: | |
73 | case BLKIF_OP_WRITE: | |
74 | + case BLKIF_OP_PACKET: | |
75 | if (unlikely(bret->status != BLKIF_RSP_OKAY)) | |
76 | DPRINTK("Bad return from blkdev data " | |
77 | "request: %x\n", bret->status); | |
00e5a55c BS |
78 | --- sle11-2009-06-04.orig/drivers/xen/blktap/blktap.c 2009-06-04 10:46:52.000000000 +0200 |
79 | +++ sle11-2009-06-04/drivers/xen/blktap/blktap.c 2009-06-04 10:46:54.000000000 +0200 | |
80 | @@ -1087,13 +1087,14 @@ static void fast_flush_area(pending_req_ | |
cc90b958 BS |
81 | |
82 | static void print_stats(blkif_t *blkif) | |
83 | { | |
84 | - printk(KERN_DEBUG "%s: oo %3d | rd %4d | wr %4d\n", | |
85 | + printk(KERN_DEBUG "%s: oo %3d | rd %4d | wr %4d | pk %4d\n", | |
86 | current->comm, blkif->st_oo_req, | |
87 | - blkif->st_rd_req, blkif->st_wr_req); | |
88 | + blkif->st_rd_req, blkif->st_wr_req, blkif->st_pk_req); | |
89 | blkif->st_print = jiffies + msecs_to_jiffies(10 * 1000); | |
90 | blkif->st_rd_req = 0; | |
91 | blkif->st_wr_req = 0; | |
92 | blkif->st_oo_req = 0; | |
93 | + blkif->st_pk_req = 0; | |
94 | } | |
95 | ||
96 | int tap_blkif_schedule(void *arg) | |
00e5a55c | 97 | @@ -1329,6 +1330,11 @@ static int do_block_io_op(blkif_t *blkif |
cc90b958 BS |
98 | dispatch_rw_block_io(blkif, &req, pending_req); |
99 | break; | |
100 | ||
101 | + case BLKIF_OP_PACKET: | |
102 | + blkif->st_pk_req++; | |
103 | + dispatch_rw_block_io(blkif, &req, pending_req); | |
104 | + break; | |
105 | + | |
106 | default: | |
107 | /* A good sign something is wrong: sleep for a while to | |
108 | * avoid excessive CPU consumption by a bad guest. */ | |
00e5a55c | 109 | @@ -1368,6 +1374,8 @@ static void dispatch_rw_block_io(blkif_t |
cc90b958 BS |
110 | struct mm_struct *mm; |
111 | ||
112 | switch (req->operation) { | |
113 | + case BLKIF_OP_PACKET: | |
114 | + /* Fall through */ | |
115 | case BLKIF_OP_READ: | |
116 | operation = READ; | |
117 | break; | |
00e5a55c BS |
118 | --- sle11-2009-06-04.orig/drivers/xen/blktap/common.h 2009-06-04 10:20:18.000000000 +0200 |
119 | +++ sle11-2009-06-04/drivers/xen/blktap/common.h 2009-06-04 10:46:54.000000000 +0200 | |
cc90b958 BS |
120 | @@ -75,6 +75,7 @@ typedef struct blkif_st { |
121 | int st_rd_req; | |
122 | int st_wr_req; | |
123 | int st_oo_req; | |
124 | + int st_pk_req; | |
125 | int st_rd_sect; | |
126 | int st_wr_sect; | |
127 | ||
00e5a55c BS |
128 | --- sle11-2009-06-04.orig/include/xen/interface/io/blkif.h 2009-06-04 10:18:38.000000000 +0200 |
129 | +++ sle11-2009-06-04/include/xen/interface/io/blkif.h 2009-06-04 10:46:54.000000000 +0200 | |
cc90b958 BS |
130 | @@ -76,6 +76,10 @@ |
131 | * "feature-flush-cache" node! | |
132 | */ | |
133 | #define BLKIF_OP_FLUSH_DISKCACHE 3 | |
134 | +/* | |
135 | + * Device specific command packet contained within the request | |
136 | + */ | |
137 | +#define BLKIF_OP_PACKET 4 | |
138 | ||
139 | /* | |
140 | * Maximum scatter/gather segments per request. |