summaryrefslogtreecommitdiff
path: root/zebra/zebra_vxlan.c
diff options
context:
space:
mode:
authorAmeya Dharkar <adharkar@vmware.com>2021-01-11 11:08:43 -0800
committerAmeya Dharkar <adharkar@vmware.com>2021-06-07 17:59:45 -0700
commit1b09e77e4d0752e6e29affbd440dbb82dcee5044 (patch)
treee53e1ac7f1d0b54fe857b07d26138367a262c2e1 /zebra/zebra_vxlan.c
parentdc6cef732ecb72e4e3d112ed8ddfd859f35ac465 (diff)
Zebra: FPM support for gateway IP overlay Index
FPM sends VNI to the data plane with the EVPN prefix. For pure type-5 EVPN route, nexthop interface of EVPN prefix is L3VNI SVI. Thus, we encode L3VNI corresponding to the nexthop vrf with rtmsg for this prefix. For EVPN type-5 route with gateway IP overlay index, we supporting asymmetric IRB. Thus, nexthop interface is L2VNI SVI. So, instead of fetching vrf VNI, fetch VNI corresponding to the nexthop SVI and encode it in the rtmsg for EVPN prefix. Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
Diffstat (limited to 'zebra/zebra_vxlan.c')
-rw-r--r--zebra/zebra_vxlan.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c
index 99df49a46b..2f3ea7475a 100644
--- a/zebra/zebra_vxlan.c
+++ b/zebra/zebra_vxlan.c
@@ -1842,6 +1842,27 @@ static zebra_l3vni_t *zl3vni_from_svi(struct interface *ifp,
return zl3vni;
}
+vni_t vni_id_from_svi(struct interface *ifp, struct interface *br_if)
+{
+ vni_t vni = 0;
+ zebra_evpn_t *zevpn = NULL;
+ zebra_l3vni_t *zl3vni = NULL;
+
+ /* Check if an L3VNI belongs to this SVI interface.
+ * If not, check if an L2VNI belongs to this SVI interface.
+ */
+ zl3vni = zl3vni_from_svi(ifp, br_if);
+ if (zl3vni)
+ vni = zl3vni->vni;
+ else {
+ zevpn = zebra_evpn_from_svi(ifp, br_if);
+ if (zevpn)
+ vni = zevpn->vni;
+ }
+
+ return vni;
+}
+
static inline void zl3vni_get_vrr_rmac(zebra_l3vni_t *zl3vni,
struct ethaddr *rmac)
{