2 *------------------------------------------------------------------
3 * Copyright (c) 2019 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:
8 * http://www.apache.org/licenses/LICENSE-2.0
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 *------------------------------------------------------------------
18 option version = "1.0.0";
19 import "vnet/interface_types.api";
23 AF_XDP_API_MODE_AUTO = 0,
24 AF_XDP_API_MODE_COPY = 1,
25 AF_XDP_API_MODE_ZERO_COPY = 2,
28 enumflag af_xdp_flag : u8
30 AF_XDP_API_FLAGS_NO_SYSCALL_LOCK = 1,
34 @param client_index - opaque cookie to identify the sender
35 @param context - sender context, to match reply w/ request
36 @param host_if - Linux netdev interface name
37 @param name - new af_xdp interface name (optional)
38 @param rxq_num - number of receive queues. 65535 can be used as special value to request all available queues (optional)
39 @param rxq_size - receive queue size (optional)
40 @param txq_size - transmit queue size (optional)
41 @param mode - operation mode (optional)
42 @param flags - flags (optional)
43 @param prog - eBPF program path (optional)
53 u16 rxq_num [default=1];
54 u16 rxq_size [default=0];
55 u16 txq_size [default=0];
56 vl_api_af_xdp_mode_t mode [default=0];
57 vl_api_af_xdp_flag_t flags [default=0];
59 option vat_help = "<host-if linux-ifname> [name ifname] [rx-queue-size size] [tx-queue-size size] [num-rx-queues <num|all>] [prog pathname] [zero-copy|no-zero-copy] [no-syscall-lock]";
64 @param client_index - opaque cookie to identify the sender
65 @param context - sender context, to match reply w/ request
66 @param host_if - Linux netdev interface name
67 @param name - new af_xdp interface name (optional)
68 @param rxq_num - number of receive queues. 65535 can be used as special value to request all available queues (optional)
69 @param rxq_size - receive queue size (optional)
70 @param txq_size - transmit queue size (optional)
71 @param mode - operation mode (optional)
72 @param flags - flags (optional)
73 @param prog - eBPF program path (optional)
74 @param namespace - netns of nic (optional)
77 define af_xdp_create_v2
84 u16 rxq_num [default=1];
85 u16 rxq_size [default=0];
86 u16 txq_size [default=0];
87 vl_api_af_xdp_mode_t mode [default=0];
88 vl_api_af_xdp_flag_t flags [default=0];
91 option vat_help = "<host-if linux-ifname> [name ifname] [rx-queue-size size] [tx-queue-size size] [num-rx-queues <num|all>] [prog pathname] [netns ns] [zero-copy|no-zero-copy] [no-syscall-lock]";
96 @param context - sender context, to match reply w/ request
97 @param retval - return value for request
98 @param sw_if_index - software index for the new af_xdp interface
101 define af_xdp_create_reply
105 vl_api_interface_index_t sw_if_index;
110 @param context - sender context, to match reply w/ request
111 @param retval - return value for request
112 @param sw_if_index - software index for the new af_xdp interface
115 define af_xdp_create_v2_reply
119 vl_api_interface_index_t sw_if_index;
124 @param client_index - opaque cookie to identify the sender
125 @param context - sender context, to match reply w/ request
126 @param sw_if_index - interface index
130 @param client_index - opaque cookie to identify the sender
131 @param context - sender context, to match reply w/ request
132 @param host_if - Linux netdev interface name
133 @param name - new af_xdp interface name (optional)
134 @param rxq_num - number of receive queues. 65535 can be used as special value to request all available queues (optional)
135 @param rxq_size - receive queue size (optional)
136 @param txq_size - transmit queue size (optional)
137 @param mode - operation mode (optional)
138 @param flags - flags (optional)
139 @param prog - eBPF program path (optional)
140 @param netns - netns of nic (optional)
143 autoendian define af_xdp_create_v3
150 u16 rxq_num [default=1];
151 u16 rxq_size [default=0];
152 u16 txq_size [default=0];
153 vl_api_af_xdp_mode_t mode [default=0];
154 vl_api_af_xdp_flag_t flags [default=0];
157 option vat_help = "<host-if linux-ifname> [name ifname] [rx-queue-size size] [tx-queue-size size] [num-rx-queues <num|all>] [prog pathname] [netns ns] [zero-copy|no-zero-copy] [no-syscall-lock]";
161 @param context - sender context, to match reply w/ request
162 @param retval - return value for request
163 @param sw_if_index - software index for the new af_xdp interface
166 autoendian define af_xdp_create_v3_reply
170 vl_api_interface_index_t sw_if_index;
173 autoreply define af_xdp_delete
178 vl_api_interface_index_t sw_if_index;
179 option vat_help = "<sw_if_index index>";
184 * eval: (c-set-style "gnu")