History

bridge: mrp: Rework the MRP netlink interface

This patch reworks the MRP netlink interface. Before, each attribute represented a binary structure which made it hard to be extended. Therefore update the MRP netlink interface such that each existing attribute to be a nested attribute which contains the fields of the binary structures. In this way the MRP netlink interface can be extended without breaking the backwards compatibility. It is also using strict checking for attributes under the MRP top attribute.

Horatiu Vultur committed 6 years ago

Commit 20f6a051 parent 9f01a714 files · +290 −50Browse files

Showing the changes to include/uapi/linux (1 of 4 files). Show all

Unified · Split

include/uapi/linux/if_bridge.h+57−7
@@ -169,17 +169,69 @@ enum { · 168 unmodified lines
169 __IFLA_BRIDGE_MRP_MAX,169 __IFLA_BRIDGE_MRP_MAX,
170};170};
171 171
172#define IFLA_BRIDGE_MRP_MAX (__IFLA_BRIDGE_MRP_MAX - 1)
173
174enum {
175 IFLA_BRIDGE_MRP_INSTANCE_UNSPEC,
176 IFLA_BRIDGE_MRP_INSTANCE_RING_ID,
177 IFLA_BRIDGE_MRP_INSTANCE_P_IFINDEX,
178 IFLA_BRIDGE_MRP_INSTANCE_S_IFINDEX,
179 __IFLA_BRIDGE_MRP_INSTANCE_MAX,
180};
181
182#define IFLA_BRIDGE_MRP_INSTANCE_MAX (__IFLA_BRIDGE_MRP_INSTANCE_MAX - 1)
183
184enum {
185 IFLA_BRIDGE_MRP_PORT_STATE_UNSPEC,
186 IFLA_BRIDGE_MRP_PORT_STATE_STATE,
187 __IFLA_BRIDGE_MRP_PORT_STATE_MAX,
188};
189
190#define IFLA_BRIDGE_MRP_PORT_STATE_MAX (__IFLA_BRIDGE_MRP_PORT_STATE_MAX - 1)
191
192enum {
193 IFLA_BRIDGE_MRP_PORT_ROLE_UNSPEC,
194 IFLA_BRIDGE_MRP_PORT_ROLE_ROLE,
195 __IFLA_BRIDGE_MRP_PORT_ROLE_MAX,
196};
197
198#define IFLA_BRIDGE_MRP_PORT_ROLE_MAX (__IFLA_BRIDGE_MRP_PORT_ROLE_MAX - 1)
199
200enum {
201 IFLA_BRIDGE_MRP_RING_STATE_UNSPEC,
202 IFLA_BRIDGE_MRP_RING_STATE_RING_ID,
203 IFLA_BRIDGE_MRP_RING_STATE_STATE,
204 __IFLA_BRIDGE_MRP_RING_STATE_MAX,
205};
206
207#define IFLA_BRIDGE_MRP_RING_STATE_MAX (__IFLA_BRIDGE_MRP_RING_STATE_MAX - 1)
208
209enum {
210 IFLA_BRIDGE_MRP_RING_ROLE_UNSPEC,
211 IFLA_BRIDGE_MRP_RING_ROLE_RING_ID,
212 IFLA_BRIDGE_MRP_RING_ROLE_ROLE,
213 __IFLA_BRIDGE_MRP_RING_ROLE_MAX,
214};
215
216#define IFLA_BRIDGE_MRP_RING_ROLE_MAX (__IFLA_BRIDGE_MRP_RING_ROLE_MAX - 1)
217
218enum {
219 IFLA_BRIDGE_MRP_START_TEST_UNSPEC,
220 IFLA_BRIDGE_MRP_START_TEST_RING_ID,
221 IFLA_BRIDGE_MRP_START_TEST_INTERVAL,
222 IFLA_BRIDGE_MRP_START_TEST_MAX_MISS,
223 IFLA_BRIDGE_MRP_START_TEST_PERIOD,
224 __IFLA_BRIDGE_MRP_START_TEST_MAX,
225};
226
227#define IFLA_BRIDGE_MRP_START_TEST_MAX (__IFLA_BRIDGE_MRP_START_TEST_MAX - 1)
228
172struct br_mrp_instance {229struct br_mrp_instance {
173 __u32 ring_id;230 __u32 ring_id;
174 __u32 p_ifindex;231 __u32 p_ifindex;
175 __u32 s_ifindex;232 __u32 s_ifindex;
176};233};
177 234
178struct br_mrp_port_role {
179 __u32 ring_id;
180 __u32 role;
181};
182
183struct br_mrp_ring_state {235struct br_mrp_ring_state {
184 __u32 ring_id;236 __u32 ring_id;
185 __u32 ring_state;237 __u32 ring_state;
@@ -197,8 +249,6 @@ struct br_mrp_start_test { · 11 unmodified lines
197 __u32 period;249 __u32 period;
198};250};
199 251
200#define IFLA_BRIDGE_MRP_MAX (__IFLA_BRIDGE_MRP_MAX - 1)
201
202struct bridge_stp_xstats {252struct bridge_stp_xstats {
203 __u64 transition_blk;253 __u64 transition_blk;
204 __u64 transition_fwd;254 __u64 transition_fwd;