bonding: add support for numa-only in lacp mode
[vpp.git] / src / vnet / bonding / bond.api
1 /*
2  * Copyright (c) 2017 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 /** \file
17
18     This file defines vpe control-plane API messages for
19     the bonding device driver
20 */
21
22 option version = "1.0.1";
23
24 /** \brief Initialize a new bond interface with the given paramters
25     @param client_index - opaque cookie to identify the sender
26     @param context - sender context, to match reply w/ request
27     @param id - if non-~0, specifies a custom interface ID
28     @param use_custom_mac - if set, mac_address is valid
29     @param mac_address - mac addr to assign to the interface if use_custom_mac is set
30     @param mode - mode, required (1=round-robin, 2=active-backup, 3=xor, 4=broadcastcast, 5=lacp)
31     @param lb - load balance, optional (0=l2, 1=l34, 2=l23) valid for xor and lacp modes. Otherwise ignored
32     @param numa_only - if numa_only is set, pkts will be transmitted by LAG members on local numa node only if have at least one, otherwise it works as usual.
33 */
34 define bond_create
35 {
36   u32 client_index;
37   u32 context;
38   u32 id;
39   u8 use_custom_mac;
40   u8 mac_address[6];
41   u8 mode;
42   u8 lb;
43   u8 numa_only;
44 };
45
46 /** \brief Reply for bond 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 tap interface
50 */
51 define bond_create_reply
52 {
53   u32 context;
54   i32 retval;
55   u32 sw_if_index;
56 };
57
58 /** \brief Delete bond interface
59     @param client_index - opaque cookie to identify the sender
60     @param context - sender context, to match reply w/ request
61     @param sw_if_index - interface index of slave interface
62 */
63 autoreply define bond_delete
64 {
65   u32 client_index;
66   u32 context;
67   u32 sw_if_index;
68 };
69
70 /** \brief Initialize a new bond interface with the given paramters
71     @param client_index - opaque cookie to identify the sender
72     @param context - sender context, to match reply w/ request
73     @param sw_if_index - slave sw_if_index
74     @param bond_sw_if_index - bond sw_if_index
75     @param is_passive - interface does not initiate the lacp protocol, remote must be active speaker
76     @param is_long_timeout - 90 seconds vs default 3 seconds neighbor timeout
77 */
78 define bond_enslave
79 {
80   u32 client_index;
81   u32 context;
82   u32 sw_if_index;
83   u32 bond_sw_if_index;
84   u8 is_passive;
85   u8 is_long_timeout;
86 };
87
88 /** \brief Reply for bond enslave reply
89     @param context - returned sender context, to match reply w/ request
90     @param retval - return code
91 */
92 define bond_enslave_reply
93 {
94   u32 context;
95   i32 retval;
96 };
97
98 /** \brief bond detach slave
99     @param client_index - opaque cookie to identify the sender
100     @param context - sender context, to match reply w/ request
101     @param sw_if_index - interface index of slave interface
102 */
103 autoreply define bond_detach_slave
104 {
105   u32 client_index;
106   u32 context;
107   u32 sw_if_index;
108 };
109
110 /** \brief Dump bond interfaces request */
111 define sw_interface_bond_dump
112 {
113   u32 client_index;
114   u32 context;
115 };
116
117 /** \brief Reply for bond dump request
118     @param sw_if_index - software index of bond interface
119     @param id - ID of interface
120     @param interface_name - name of interface
121     @param mode - bonding mode
122     @param lb - load balance algo
123     @param numa_only - enable local numa TX for lacp mode
124     @param active_slaves - active slaves count
125     @param slaves - config slave count
126 */
127 define sw_interface_bond_details
128 {
129   u32 context;
130   u32 sw_if_index;
131   u32 id;
132   u8 interface_name[64];
133   u8 mode;
134   u8 lb;
135   u8 numa_only;
136   u32 active_slaves;
137   u32 slaves;
138 };
139
140 /** \brief bond slave dump
141     @param client_index - opaque cookie to identify the sender
142     @param context - sender context, to match reply w/ request
143     @param sw_if_index - interface index of bond interface
144 */
145 define sw_interface_slave_dump
146 {
147   u32 client_index;
148   u32 context;
149   u32 sw_if_index;
150 };
151
152 /** \brief Reply for slave dump request
153     @param sw_if_index - software index of slave interface
154     @param interface_name - name of interface
155     @param is_passve - interface does not initiate the lacp protocol, remote must be active speaker
156     @param is_long_timeout - 90 seconds vs default 3 seconds neighbor timeout
157 */
158 define sw_interface_slave_details
159 {
160   u32 context;
161   u32 sw_if_index;
162   u8 interface_name[64];
163   u8 is_passive;
164   u8 is_long_timeout;
165 };
166
167 /*
168  * Local Variables:
169  * eval: (c-set-style "gnu")
170  * End:
171  */