blob: bbe2341a00197e3b326cef913f5b0a9d723dbc37 [file] [log] [blame]
Mohsin Kazmid6c15af2018-10-23 18:00:47 +02001/*
2 * Copyright (c) 2018 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
Mohsin Kazmi518251b2020-09-01 17:17:44 +000016option version = "3.0.0";
Jakub Grajciar2c504f82019-09-26 10:34:41 +020017
18import "vnet/interface_types.api";
19import "vnet/ethernet/ethernet_types.api";
Jakub Grajciar53f06a02020-03-30 08:12:57 +020020import "vlib/pci/pci_types.api";
Jakub Grajciar2c504f82019-09-26 10:34:41 +020021
Mohsin Kazmid6c15af2018-10-23 18:00:47 +020022
Paul Vinciguerra97c998c2019-10-29 16:11:09 -040023/** \brief Initialize a new virtio pci interface with the given parameters
Mohsin Kazmid6c15af2018-10-23 18:00:47 +020024 @param client_index - opaque cookie to identify the sender
25 @param context - sender context, to match reply w/ request
Jakub Grajciar2c504f82019-09-26 10:34:41 +020026 @param pci_addr - pci address
Mohsin Kazmid6c15af2018-10-23 18:00:47 +020027 @param use_random_mac - let the system generate a unique mac address
Paul Vinciguerra97c998c2019-10-29 16:11:09 -040028 @param mac_address - mac addr to assign to the interface if use_random not set
Mohsin Kazmibbd6b742019-05-02 13:54:59 +020029 @param gso_enabled - enable gso feature if available, 1 to enable
Mohsin Kazmi6d4af892020-01-03 15:11:53 +000030 @param checksum_offload_enabled - enable checksum feature if available, 1 to enable
Mohsin Kazmid6c15af2018-10-23 18:00:47 +020031 @param features - the virtio features which driver should negotiate with device
32*/
33define virtio_pci_create
34{
Ole Troanf9164142020-09-15 11:37:16 +020035 option deprecated;
Mohsin Kazmid6c15af2018-10-23 18:00:47 +020036 u32 client_index;
37 u32 context;
Jakub Grajciar2c504f82019-09-26 10:34:41 +020038 vl_api_pci_address_t pci_addr;
39 bool use_random_mac;
40 vl_api_mac_address_t mac_address;
41 bool gso_enabled;
Mohsin Kazmi6d4af892020-01-03 15:11:53 +000042 bool checksum_offload_enabled;
Mohsin Kazmid6c15af2018-10-23 18:00:47 +020043 u64 features;
44};
45
46/** \brief Reply for virtio pci create reply
47 @param context - returned sender context, to match reply w/ request
48 @param retval - return code
49 @param sw_if_index - software index allocated for the new virtio pci interface
50*/
51define virtio_pci_create_reply
52{
Ole Troanf9164142020-09-15 11:37:16 +020053 option deprecated;
Mohsin Kazmi518251b2020-09-01 17:17:44 +000054 u32 context;
55 i32 retval;
56 vl_api_interface_index_t sw_if_index;
57};
58
59enum virtio_flags {
60 VIRTIO_API_FLAG_GSO = 1, /* enable gso on the interface */
61 VIRTIO_API_FLAG_CSUM_OFFLOAD = 2, /* enable checksum offload without gso on the interface */
62 VIRTIO_API_FLAG_GRO_COALESCE = 4, /* enable packet coalescing on tx side, provided gso enabled */
63 VIRTIO_API_FLAG_PACKED = 8, /* enable packed ring support, provided it is available from backend */
64 VIRTIO_API_FLAG_IN_ORDER = 16, /* enable in order support, provided it is available from backend */
Mohsin Kazmie347acb2020-09-28 10:26:33 +000065 VIRTIO_API_FLAG_BUFFERING = 32 [backwards_compatible], /* enable buffering to handle backend jitter/delays */
Mohsin Kazmi518251b2020-09-01 17:17:44 +000066};
67
68/** \brief Initialize a new virtio pci interface with the given parameters
69 @param client_index - opaque cookie to identify the sender
70 @param context - sender context, to match reply w/ request
71 @param pci_addr - pci address
72 @param use_random_mac - let the system generate a unique mac address
73 @param mac_address - mac addr to assign to the interface if use_random not set
74 @param virtio_flags - feature flags to enable
75 @param features - the virtio features which driver should negotiate with device
76*/
77define virtio_pci_create_v2
78{
79 u32 client_index;
80 u32 context;
81 vl_api_pci_address_t pci_addr;
82 bool use_random_mac;
83 vl_api_mac_address_t mac_address;
84 vl_api_virtio_flags_t virtio_flags;
85 u64 features;
86};
87
88/** \brief Reply for virtio pci create reply
89 @param context - returned sender context, to match reply w/ request
90 @param retval - return code
91 @param sw_if_index - software index allocated for the new virtio pci interface
92*/
93define virtio_pci_create_v2_reply
94{
Mohsin Kazmid6c15af2018-10-23 18:00:47 +020095 u32 context;
96 i32 retval;
Jakub Grajciar2c504f82019-09-26 10:34:41 +020097 vl_api_interface_index_t sw_if_index;
Mohsin Kazmid6c15af2018-10-23 18:00:47 +020098};
99
100/** \brief Delete virtio pci interface
101 @param client_index - opaque cookie to identify the sender
102 @param context - sender context, to match reply w/ request
103 @param sw_if_index - interface index of existing virtio pci interface
104*/
105autoreply define virtio_pci_delete
106{
107 u32 client_index;
108 u32 context;
Jakub Grajciar2c504f82019-09-26 10:34:41 +0200109 vl_api_interface_index_t sw_if_index;
Mohsin Kazmid6c15af2018-10-23 18:00:47 +0200110};
111
112/** \brief Dump virtio pci interfaces request */
113define sw_interface_virtio_pci_dump
114{
115 u32 client_index;
116 u32 context;
117};
118
119/** \brief Reply for virtio pci interface dump request
120 @param sw_if_index - software index of virtio pci interface
Jakub Grajciar2c504f82019-09-26 10:34:41 +0200121 @param pci_addr - pci address
Mohsin Kazmid6c15af2018-10-23 18:00:47 +0200122 @param mac_addr - native virtio device mac address
123 @param tx_ring_sz - the number of entries of TX ring
124 @param rx_ring_sz - the number of entries of RX ring
125 @param features - the virtio features which driver have negotiated with device
126*/
127define sw_interface_virtio_pci_details
128{
129 u32 context;
Jakub Grajciar2c504f82019-09-26 10:34:41 +0200130 vl_api_interface_index_t sw_if_index;
131 vl_api_pci_address_t pci_addr;
132 vl_api_mac_address_t mac_addr;
Mohsin Kazmid6c15af2018-10-23 18:00:47 +0200133 u16 tx_ring_sz;
134 u16 rx_ring_sz;
135 u64 features;
136};
137
138/*
139 * Local Variables:
140 * eval: (c-set-style "gnu")
141 * End:
142 */