From 7145759169679c9476dab7c6cf0d6b34642ba8a3 Mon Sep 17 00:00:00 2001 From: Divakar Date: Mon, 29 Aug 2016 23:04:33 +0530 Subject: [PATCH] Handle unicast ARP requests in source compute node Currently the unicast ARP requests are not processed in the source compute node. These packets are switched to the destination compute node and before handing the L2 packet to destined VM, these are processed. This can result in Ecmp source VM sending unicast ARP requests and destination VM (non ecmp) responding with Vhost MAC. As a fix, unicast ARP requests are also processed in source compute node itself Change-Id: I7ff8e0b4a5b9fc8abf777e32ed4ef8aeeb4358d6 closes-bug: #1618154 --- dp-core/vr_bridge.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/dp-core/vr_bridge.c b/dp-core/vr_bridge.c index 2af7f23af..904759d94 100644 --- a/dp-core/vr_bridge.c +++ b/dp-core/vr_bridge.c @@ -472,7 +472,8 @@ vr_bridge_input(struct vrouter *router, struct vr_packet *pkt, dmac = (int8_t *) pkt_data(pkt); pull_len = 0; - if ((pkt->vp_type == VP_TYPE_IP) || (pkt->vp_type == VP_TYPE_IP6)) { + if ((pkt->vp_type == VP_TYPE_IP) || (pkt->vp_type == VP_TYPE_IP6) || + (pkt->vp_type == VP_TYPE_ARP)) { pull_len = pkt_get_network_header_off(pkt) - pkt_head_space(pkt); if (pull_len && !pkt_pull(pkt, pull_len)) { vr_pfree(pkt, VP_DROP_PULL); @@ -482,7 +483,6 @@ vr_bridge_input(struct vrouter *router, struct vr_packet *pkt, /* Do the bridge lookup for the packets not meant for "me" */ if (!fmd->fmd_to_me) { - /* * If DHCP packet coming from VM, Trap it to Agent before doing the bridge * lookup itself @@ -499,6 +499,26 @@ vr_bridge_input(struct vrouter *router, struct vr_packet *pkt, return 0; } } + + /* + * Handle the unicast ARP, coming from VM, not + * destined to us. Broadcast ARP requests would be handled + * in L2 multicast nexthop. Multicast ARP on fabric + * interface also would be handled in L2 multicast nexthop. + * Unicast ARP packets on fabric interface would be handled + * in plug routines of interface. + */ + if (!IS_MAC_BMCAST(dmac)) { + handled = 0; + if (pkt->vp_type == VP_TYPE_ARP) { + handled = vr_arp_input(pkt, fmd, dmac); + } else if (l4_type == L4_TYPE_NEIGHBOUR_SOLICITATION) { + handled = vr_neighbor_input(pkt, fmd, dmac); + } + + if (handled) + return 0; + } } rt.rtr_req.rtr_label_flags = 0;