vhost: Add event index for interrupt notification to driver
[vpp.git] / src / vnet / devices / virtio / vhost_user.api
1 /*
2  * Copyright (c) 2015-2016 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 option version = "4.1.1";
17
18 import "vnet/interface_types.api";
19 import "vnet/ethernet/ethernet_types.api";
20 import "vnet/devices/virtio/virtio_types.api";
21
22 /** \brief vhost-user interface create request
23     @param client_index - opaque cookie to identify the sender
24     @param is_server - our side is socket server
25     @param sock_filename - unix socket filename, used to speak with frontend
26     @param use_custom_mac - enable or disable the use of the provided hardware address
27     @param disable_mrg_rxbuf - disable the use of merge receive buffers
28     @param disable_indirect_desc - disable the use of indirect descriptors which driver can use
29     @param enable_gso - enable gso support (default 0)
30     @param enable_packed - enable packed ring support (default 0)
31     @param mac_address - hardware address to use if 'use_custom_mac' is set
32 */
33 define create_vhost_user_if
34 {
35   option deprecated;
36   u32 client_index;
37   u32 context;
38   bool is_server;
39   string sock_filename[256];
40   bool renumber;
41   bool disable_mrg_rxbuf;
42   bool disable_indirect_desc;
43   bool enable_gso;
44   bool enable_packed;
45   u32 custom_dev_instance;
46   bool use_custom_mac;
47   vl_api_mac_address_t mac_address;
48   string tag[64];
49 };
50
51 /** \brief vhost-user interface create response
52     @param context - sender context, to match reply w/ request
53     @param retval - return code for the request
54     @param sw_if_index - interface the operation is applied to
55 */
56 define create_vhost_user_if_reply
57 {
58   option deprecated;
59   u32 context;
60   i32 retval;
61   vl_api_interface_index_t sw_if_index;
62 };
63
64 /** \brief vhost-user interface modify request
65     @param client_index - opaque cookie to identify the sender
66     @param is_server - our side is socket server
67     @param sock_filename - unix socket filename, used to speak with frontend
68     @param enable_gso - enable gso support (default 0)
69     @param enable_packed - enable packed ring support (default 0)
70 */
71 autoreply define modify_vhost_user_if
72 {
73   option deprecated;
74   u32 client_index;
75   u32 context;
76   vl_api_interface_index_t sw_if_index;
77   bool is_server;
78   string sock_filename[256];
79   bool renumber;
80   bool enable_gso;
81   bool enable_packed;
82   u32 custom_dev_instance;
83 };
84
85 /** \brief vhost-user interface create request
86     @param client_index - opaque cookie to identify the sender
87     @param is_server - our side is socket server
88     @param sock_filename - unix socket filename, used to speak with frontend
89     @param use_custom_mac - enable or disable the use of the provided hardware address
90     @param disable_mrg_rxbuf - disable the use of merge receive buffers
91     @param disable_indirect_desc - disable the use of indirect descriptors which driver can use
92     @param enable_gso - enable gso support (default 0)
93     @param enable_packed - enable packed ring support (default 0)
94     @param enable_event_idx - enable event_idx support (default 0)
95     @param mac_address - hardware address to use if 'use_custom_mac' is set
96     @param renumber - if true, use custom_dev_instance is valid
97     @param custom_dev_instance - custom device instance number
98 */
99 define create_vhost_user_if_v2
100 {
101   u32 client_index;
102   u32 context;
103   bool is_server;
104   string sock_filename[256];
105   bool renumber;
106   bool disable_mrg_rxbuf;
107   bool disable_indirect_desc;
108   bool enable_gso;
109   bool enable_packed;
110   bool enable_event_idx;
111   u32 custom_dev_instance;
112   bool use_custom_mac;
113   vl_api_mac_address_t mac_address;
114   string tag[64];
115 };
116
117 /** \brief vhost-user interface create response
118     @param context - sender context, to match reply w/ request
119     @param retval - return code for the request
120     @param sw_if_index - interface the operation is applied to
121 */
122 define create_vhost_user_if_v2_reply
123 {
124   u32 context;
125   i32 retval;
126   vl_api_interface_index_t sw_if_index;
127 };
128
129 /** \brief vhost-user interface modify request
130     @param client_index - opaque cookie to identify the sender
131     @param is_server - our side is socket server
132     @param sock_filename - unix socket filename, used to speak with frontend
133     @param enable_gso - enable gso support (default 0)
134     @param enable_packed - enable packed ring support (default 0)
135     @param enable_event_idx - enable event idx support (default 0)
136     @param renumber - if true, use custom_dev_instance is valid
137     @param custom_dev_instance - custom device instance number
138 */
139 autoreply define modify_vhost_user_if_v2
140 {
141   u32 client_index;
142   u32 context;
143   vl_api_interface_index_t sw_if_index;
144   bool is_server;
145   string sock_filename[256];
146   bool renumber;
147   bool enable_gso;
148   bool enable_packed;
149   bool enable_event_idx;
150   u32 custom_dev_instance;
151 };
152
153 /** \brief vhost-user interface delete request
154     @param client_index - opaque cookie to identify the sender
155 */
156 autoreply define delete_vhost_user_if
157 {
158   u32 client_index;
159   u32 context;
160   vl_api_interface_index_t sw_if_index;
161 };
162
163 /** \brief Vhost-user interface details structure (fix this)
164     @param sw_if_index - index of the interface
165     @param interface_name - name of interface
166     @param virtio_net_hdr_sz - net header size
167     @param features_first_32 - interface features, first 32 bits
168     @param features_last_32 - interface features, last 32 bits
169     @param is_server - vhost-user server socket
170     @param sock_filename - socket filename
171     @param num_regions - number of used memory regions
172     @param sock_errno - socket errno
173 */
174 define sw_interface_vhost_user_details
175 {
176   u32 context;
177   vl_api_interface_index_t sw_if_index;
178   string interface_name[64];
179   u32 virtio_net_hdr_sz;
180   vl_api_virtio_net_features_first_32_t features_first_32;
181   vl_api_virtio_net_features_last_32_t features_last_32;
182   bool is_server;
183   string sock_filename[256];
184   u32 num_regions;
185   i32 sock_errno;
186 };
187
188 /** \brief Vhost-user interface dump request
189     @param sw_if_index - filter by sw_if_index
190 */
191 define sw_interface_vhost_user_dump
192 {
193   u32 client_index;
194   u32 context;
195   vl_api_interface_index_t sw_if_index [default=0xffffffff];
196 };
197 /*
198  * Local Variables:
199  * eval: (c-set-style "gnu")
200  * End:
201  */