vmxnet3: use explicit types in api
[vpp.git] / src / plugins / vmxnet3 / vmxnet3.api
1 /*
2  *------------------------------------------------------------------
3  * Copyright (c) 2018 Cisco and/or its affiliates.
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *------------------------------------------------------------------
16  */
17
18 option version = "1.1.0";
19 import "vnet/interface_types.api";
20 import "vnet/ethernet/ethernet_types.api";
21
22 /** \brief
23     @param client_index - opaque cookie to identify the sender
24     @param context - sender context, to match reply w/ request
25     @param pci_addr - pci address as unsigned 32bit integer:
26                       0-15 domain, 16-23 bus, 24-28 slot, 29-31 function 
27                       ddddddddddddddddbbbbbbbbsssssfff
28     @param enable_elog - turn on elog (optional - default is off)
29     @param rxq_size - receive queue size (optional - default is 1024)
30     @param rxq_num - number of receive queues (optional - default is 1)
31     @param txq_size - transmit queue size (optional - default is 1024)
32     @param txq_num - number of transmit queues (optional - default is 1)
33     @param bind - automatically bind PCI to vfio-pci module
34                       (optional - default is 0)
35     @param enable_gso - enable gso (optional - default is 0)
36 */
37
38 define vmxnet3_create
39 {
40   u32 client_index;
41   u32 context;
42
43   u32 pci_addr;
44   i32 enable_elog;
45   u16 rxq_size;
46   u16 rxq_num;
47   u16 txq_size;
48   u16 txq_num;
49   u8 bind;
50   bool enable_gso;
51   option vat_help = "<pci-address> [rx-queue-size <size>] [tx-queue-size <size>] [num-tx-queues <num>] [num-rx-queues <num>] [bind] [gso]";
52 };
53
54 /** \brief
55     @param context - sender context, to match reply w/ request
56     @param retval - return value for request
57     @param sw_if_index - software index for the new vmxnet3 interface
58 */
59
60 define vmxnet3_create_reply
61 {
62   u32 context;
63   i32 retval;
64   vl_api_interface_index_t sw_if_index;
65 };
66
67 /** \brief
68     @param client_index - opaque cookie to identify the sender
69     @param context - sender context, to match reply w/ request
70     @param sw_if_index - interface index
71 */
72
73 autoreply define vmxnet3_delete
74 {
75   u32 client_index;
76   u32 context;
77
78   vl_api_interface_index_t sw_if_index;
79   option vat_help = "sw_if_index <sw_if_index>";
80 };
81
82 /** \brief vmxnet3_tx_list structure
83     @param tx_qsize - tx queue size
84     @param tx_next - tx next index
85     @param tx_produce - tx produce index
86     @param tx_consume - tx consume index
87 */
88
89 typedef vmxnet3_tx_list
90 {
91   u16 tx_qsize;
92   u16 tx_next;
93   u16 tx_produce;
94   u16 tx_consume;
95 };
96
97 /** \brief vmxnet3_rx_list structure
98     @param rx_qsize - rx queue size
99     @param rx_fill - rx fill count
100     @param rx_next - rx next index
101     @param rx_produce - rx produce index
102     @param rx_consume - rx consume index
103 */
104
105 typedef vmxnet3_rx_list
106 {
107   u16 rx_qsize;
108   u16 rx_fill[2];
109   u16 rx_next;
110   u16 rx_produce[2];
111   u16 rx_consume[2];
112 };
113
114 /** \brief Memory interface details structure
115     @param context - sender context, to match reply w/ request (memif_dump)
116     @param sw_if_index - index of the interface
117     @param if_name - name of the interface
118     @param hw_addr - interface MAC address
119     @param pci_addr - pci address of the interface
120     @param version - vmxnet3 hardware version
121     @param admin_up_down - interface administrative status
122     @param rx_count - number of elements in rx_list
123     @param rx_list - list of vmxnet3_rx_list
124     @param tx_count - number of elements in tx_list
125     @param tx_list - list of vmnxnet3_tx_list
126 */
127 define vmxnet3_details
128 {
129   u32 context;
130
131   vl_api_interface_index_t sw_if_index;
132   string if_name[64];
133   vl_api_mac_address_t hw_addr;
134   u32 pci_addr;
135   u8 version;
136   bool admin_up_down;
137
138   u8 rx_count;
139   vl_api_vmxnet3_rx_list_t rx_list[16];
140
141   u8 tx_count;
142   vl_api_vmxnet3_tx_list_t tx_list[8];
143 };
144
145 /** \brief Dump all vmxnet3 interfaces
146     @param client_index - opaque cookie to identify the sender
147     @param context - sender context, to match reply w/ request
148 */
149 define vmxnet3_dump
150 {
151   u32 client_index;
152   u32 context;
153 };
154
155 /*
156  * Local Variables:
157  * eval: (c-set-style "gnu")
158  * End:
159  */