diff options
Diffstat (limited to 'tools/virtio/ringtest/noring.c')
-rw-r--r-- | tools/virtio/ringtest/noring.c | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/tools/virtio/ringtest/noring.c b/tools/virtio/ringtest/noring.c new file mode 100644 index 000000000000..eda2f4824130 --- /dev/null +++ b/tools/virtio/ringtest/noring.c | |||
@@ -0,0 +1,69 @@ | |||
1 | #define _GNU_SOURCE | ||
2 | #include "main.h" | ||
3 | #include <assert.h> | ||
4 | |||
5 | /* stub implementation: useful for measuring overhead */ | ||
6 | void alloc_ring(void) | ||
7 | { | ||
8 | } | ||
9 | |||
10 | /* guest side */ | ||
11 | int add_inbuf(unsigned len, void *buf, void *datap) | ||
12 | { | ||
13 | return 0; | ||
14 | } | ||
15 | |||
16 | /* | ||
17 | * skb_array API provides no way for producer to find out whether a given | ||
18 | * buffer was consumed. Our tests merely require that a successful get_buf | ||
19 | * implies that add_inbuf succeed in the past, and that add_inbuf will succeed, | ||
20 | * fake it accordingly. | ||
21 | */ | ||
22 | void *get_buf(unsigned *lenp, void **bufp) | ||
23 | { | ||
24 | return "Buffer"; | ||
25 | } | ||
26 | |||
27 | void poll_used(void) | ||
28 | { | ||
29 | } | ||
30 | |||
31 | void disable_call() | ||
32 | { | ||
33 | assert(0); | ||
34 | } | ||
35 | |||
36 | bool enable_call() | ||
37 | { | ||
38 | assert(0); | ||
39 | } | ||
40 | |||
41 | void kick_available(void) | ||
42 | { | ||
43 | assert(0); | ||
44 | } | ||
45 | |||
46 | /* host side */ | ||
47 | void disable_kick() | ||
48 | { | ||
49 | assert(0); | ||
50 | } | ||
51 | |||
52 | bool enable_kick() | ||
53 | { | ||
54 | assert(0); | ||
55 | } | ||
56 | |||
57 | void poll_avail(void) | ||
58 | { | ||
59 | } | ||
60 | |||
61 | bool use_buf(unsigned *lenp, void **bufp) | ||
62 | { | ||
63 | return true; | ||
64 | } | ||
65 | |||
66 | void call_used(void) | ||
67 | { | ||
68 | assert(0); | ||
69 | } | ||