summaryrefslogtreecommitdiff
path: root/zebra/zebra_l2.h
diff options
context:
space:
mode:
authorSharath Ramamurthy <sramamurthy@nvidia.com>2021-07-27 13:17:52 +0530
committerStephen Worley <sworley@nvidia.com>2023-02-13 18:12:04 -0500
commit784d88aa14c115411ed21f6ac518ab1a8f9d27b7 (patch)
tree86c103be00f0442b205027ca2cc2f852275eac94 /zebra/zebra_l2.h
parent8d30ff3b5ef815ad5cab092f2ce6dc28ab5e3421 (diff)
zebra: multiple vlan aware bridge datastructure changes and vxlan device iftype derivation from netlink
This change set introduces data structure changes required for multiple vlan aware bridge functionality. A new structure zebra_l2_bridge_if encapsulates the vlan to access_bd association of the bridge. A vlan_table hash_table is used to record each instance of the vlan to access_bd of the bridge via zebra_l2_bridge_vlan structure. vxlan iftype derivation: netlink attribute IFLA_VXLAN_COLLECT_METADATA is used to derive the iftype of the vxlan device. If the attribute is present, then the vxlan interface is treated as single vxlan device, otherwise it would default to traditional vxlan device. zebra_vxlan_check_readd_vtep, zebra_vxlan_dp_network_mac_add/del is modified to be vni aware. mac_fdb_read_for_bridge - is modified to be (vlan, bridge) aware Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
Diffstat (limited to 'zebra/zebra_l2.h')
-rw-r--r--zebra/zebra_l2.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/zebra/zebra_l2.h b/zebra/zebra_l2.h
index 0df75ac07b..01084a09a9 100644
--- a/zebra/zebra_l2.h
+++ b/zebra/zebra_l2.h
@@ -49,9 +49,29 @@ struct zebra_l2info_bond {
struct list *mbr_zifs; /* slaves using this bond as a master */
};
+struct zebra_l2_bridge_vlan {
+ vlanid_t vid;
+ struct zebra_evpn_access_bd *access_bd;
+};
+
+struct zebra_l2_bridge_if_ctx {
+ /* input */
+ struct zebra_if *zif;
+ int (*func)(struct zebra_if *, struct zebra_l2_bridge_vlan *, void *);
+
+ /* input-output */
+ void *arg;
+};
+
+struct zebra_l2_bridge_if {
+ uint8_t vlan_aware;
+ struct zebra_if *br_zif;
+ struct hash *vlan_table;
+};
+
/* zebra L2 interface information - bridge interface */
struct zebra_l2info_bridge {
- uint8_t vlan_aware; /* VLAN-aware bridge? */
+ struct zebra_l2_bridge_if bridge;
};
/* zebra L2 interface information - VLAN interface */
@@ -138,7 +158,9 @@ union zebra_l2if_info {
((zif)->l2info.vxl.vni_info.iftype == ZEBRA_VXLAN_IF_VNI)
#define VLAN_ID_FROM_ZEBRA_IF(zif) (zif)->l2info.vl.vid
-#define IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(zif) ((zif)->l2info.br.vlan_aware == 1)
+#define BRIDGE_FROM_ZEBRA_IF(zif) (&((zif)->l2info.br.bridge))
+#define IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(zif) \
+ ((zif)->l2info.br.bridge.vlan_aware == 1)
extern void zebra_l2_map_slave_to_bridge(struct zebra_l2info_brslave *br_slave,
struct zebra_ns *zns);