af_xdp: mark API as stable
[vpp.git] / src / plugins / af_xdp / af_xdp.api
1 /*
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:
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.0.0";
19 import "vnet/interface_types.api";
20
21 enum af_xdp_mode
22 {
23   AF_XDP_API_MODE_AUTO = 0,
24   AF_XDP_API_MODE_COPY = 1,
25   AF_XDP_API_MODE_ZERO_COPY = 2,
26 };
27
28 enumflag af_xdp_flag : u8
29 {
30   AF_XDP_API_FLAGS_NO_SYSCALL_LOCK = 1,
31 };
32
33 /** \brief
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)
44 */
45
46 define af_xdp_create
47 {
48   u32 client_index;
49   u32 context;
50
51   string host_if[64];
52   string name[64];
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];
58   string prog[256];
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]";
60 };
61
62 /** \brief
63     @param client_index - opaque cookie to identify the sender
64     @param context - sender context, to match reply w/ request
65     @param host_if - Linux netdev interface name
66     @param name - new af_xdp interface name (optional)
67     @param rxq_num - number of receive queues. 65535 can be used as special value to request all available queues (optional)
68     @param rxq_size - receive queue size (optional)
69     @param txq_size - transmit queue size (optional)
70     @param mode - operation mode (optional)
71     @param flags - flags (optional)
72     @param prog - eBPF program path (optional)
73     @param namespace - netns of nic (optional)
74 */
75
76 define af_xdp_create_v2
77 {
78   u32 client_index;
79   u32 context;
80
81   string host_if[64];
82   string name[64];
83   u16 rxq_num [default=1];
84   u16 rxq_size [default=0];
85   u16 txq_size [default=0];
86   vl_api_af_xdp_mode_t mode [default=0];
87   vl_api_af_xdp_flag_t flags [default=0];
88   string prog[256];
89   string namespace[64];
90   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]";
91 };
92
93 /** \brief
94     @param context - sender context, to match reply w/ request
95     @param retval - return value for request
96     @param sw_if_index - software index for the new af_xdp interface
97 */
98
99 define af_xdp_create_reply
100 {
101   u32 context;
102   i32 retval;
103   vl_api_interface_index_t sw_if_index;
104 };
105
106 /** \brief
107     @param context - sender context, to match reply w/ request
108     @param retval - return value for request
109     @param sw_if_index - software index for the new af_xdp interface
110 */
111
112 define af_xdp_create_v2_reply
113 {
114   u32 context;
115   i32 retval;
116   vl_api_interface_index_t sw_if_index;
117 };
118
119 /** \brief
120     @param client_index - opaque cookie to identify the sender
121     @param context - sender context, to match reply w/ request
122     @param sw_if_index - interface index
123 */
124
125 autoreply define af_xdp_delete
126 {
127   u32 client_index;
128   u32 context;
129
130   vl_api_interface_index_t sw_if_index;
131   option vat_help = "<sw_if_index index>";
132 };
133
134 /*
135  * Local Variables:
136  * eval: (c-set-style "gnu")
137  * End:
138  */