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
169169 __IFLA_BRIDGE_MRP_MAX,
170170 };
171171
172+#define IFLA_BRIDGE_MRP_MAX (__IFLA_BRIDGE_MRP_MAX - 1)
173+
174+enum {
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+
184+enum {
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+
192+enum {
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+
200+enum {
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+
209+enum {
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+
218+enum {
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+
172229 struct br_mrp_instance {
173230 __u32 ring_id;
174231 __u32 p_ifindex;
175232 __u32 s_ifindex;
176233 };
177234
178−struct br_mrp_port_role {
179− __u32 ring_id;
180− __u32 role;
181−};
182−
183235 struct br_mrp_ring_state {
184236 __u32 ring_id;
185237 __u32 ring_state;
@@ -197,8 +249,6 @@ struct br_mrp_start_test { · 11 unmodified lines
197249 __u32 period;
198250 };
199251
200−#define IFLA_BRIDGE_MRP_MAX (__IFLA_BRIDGE_MRP_MAX - 1)
201−
202252 struct bridge_stp_xstats {
203253 __u64 transition_blk;
204254 __u64 transition_fwd;