Skip to content

Commit

Permalink
Merge "Forcing L3 processing for Ecmp"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jul 27, 2015
2 parents 92a5453 + a4069fa commit 0ecae3d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
16 changes: 12 additions & 4 deletions dp-core/vr_ip_mtrie.c
Expand Up @@ -852,16 +852,22 @@ mtrie_lookup(unsigned int vrf_id, struct vr_route_req *rt)

/* we do not support any thing other than /32 route lookup */
if ((rt->rtr_req.rtr_family == AF_INET) &&
(rt->rtr_req.rtr_prefix_len != IP4_PREFIX_LEN))
(rt->rtr_req.rtr_prefix_len != IP4_PREFIX_LEN)) {
rt->rtr_nh = default_nh;
return default_nh;
}

if ((rt->rtr_req.rtr_family == AF_INET6) &&
(rt->rtr_req.rtr_prefix_len != IP6_PREFIX_LEN))
(rt->rtr_req.rtr_prefix_len != IP6_PREFIX_LEN)) {
rt->rtr_nh = default_nh;
return default_nh;
}

table = vrfid_to_mtrie(vrf_id, rt->rtr_req.rtr_family);
if (!table)
if (!table) {
rt->rtr_nh = default_nh;
return default_nh;
}

ent = &table->root;

Expand All @@ -882,8 +888,10 @@ mtrie_lookup(unsigned int vrf_id, struct vr_route_req *rt)
}

bkt = PTR_TO_BUCKET(ptr);
if (!bkt)
if (!bkt) {
rt->rtr_nh = default_nh;
return default_nh;
}

for (level = 0; level < ip_bkt_get_max_level(rt->rtr_req.rtr_family); level++) {
index = rt_to_index(rt, level);
Expand Down
19 changes: 18 additions & 1 deletion dp-core/vr_proto_ip.c
Expand Up @@ -1003,11 +1003,28 @@ vm_arp_request(struct vr_interface *vif, struct vr_packet *pkt,
rt.rtr_req.rtr_vrf_id = fmd->fmd_dvrf;
rt.rtr_req.rtr_family = AF_INET;
rt.rtr_req.rtr_prefix = (uint8_t *)&rt_prefix;
*(uint32_t *)rt.rtr_req.rtr_prefix = (sarp->arp_dpa);
rt.rtr_req.rtr_prefix_size = 4;
rt.rtr_req.rtr_prefix_len = 32;
rt.rtr_req.rtr_mac = mac;

if (!vr_grat_arp(sarp)) {
*(uint32_t *)rt.rtr_req.rtr_prefix = (sarp->arp_spa);
vr_inet_route_lookup(fmd->fmd_dvrf, &rt);

if (rt.rtr_nh->nh_type == NH_COMPOSITE) {
/* The source of ARP request can not be anything other than ECMP */
if (!(rt.rtr_nh->nh_flags & NH_FLAG_COMPOSITE_ECMP))
return MR_DROP;

/* If ECMP, we need to route the L3 packets */
VR_MAC_COPY(dmac, vif->vif_mac);
return MR_PROXY;
}

rt.rtr_nh = NULL;
}

*(uint32_t *)rt.rtr_req.rtr_prefix = (sarp->arp_dpa);
vr_inet_route_lookup(fmd->fmd_dvrf, &rt);

if (vr_grat_arp(sarp)) {
Expand Down

0 comments on commit 0ecae3d

Please sign in to comment.