From 87be56f7d2f26a04c263a64c9d7f429f8e3b2676 Mon Sep 17 00:00:00 2001 From: "Anand H. Krishnan" Date: Fri, 30 Jan 2015 10:53:43 +0530 Subject: [PATCH] Carry 'tome' flag across flow queue enqueue and flush If a packet is routed and the routing decision points to a nexthop with policy, the packets that are enqueued in the flow entry has to be routed (and not bridged) when they are flushed from the entry. To do that, fmd_to_me flag has to be carried across enqueue and flush. Closes BUG: #1406873 Change-Id: Ie6b6d545abe814bfab7e6df35e53b1229984a92c --- dp-core/vr_bridge.c | 1 - dp-core/vr_flow.c | 4 ++++ include/vr_flow.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dp-core/vr_bridge.c b/dp-core/vr_bridge.c index cc202270c..5eeeae420 100644 --- a/dp-core/vr_bridge.c +++ b/dp-core/vr_bridge.c @@ -421,7 +421,6 @@ vr_bridge_input(struct vrouter *router, struct vr_packet *pkt, /* Adjust MSS for V4 and V6 packets */ if ((pkt->vp_type == VP_TYPE_IP) || (pkt->vp_type == VP_TYPE_IP6)) { - pull_len = pkt_get_network_header_off(pkt) - pkt_head_space(pkt); if (!pkt_pull(pkt, pull_len)) { vr_pfree(pkt, VP_DROP_PULL); diff --git a/dp-core/vr_flow.c b/dp-core/vr_flow.c index f76af17ef..459788469 100644 --- a/dp-core/vr_flow.c +++ b/dp-core/vr_flow.c @@ -475,6 +475,8 @@ vr_enqueue_flow(struct vrouter *router, struct vr_flow_entry *fe, if (fmd) { pnode->pl_outer_src_ip = fmd->fmd_outer_src_ip; pnode->pl_label = fmd->fmd_label; + if (fmd->fmd_to_me) + pnode->pl_flags |= PN_FLAG_TO_ME; } __sync_synchronize(); @@ -805,6 +807,8 @@ vr_flush_flow_queue(struct vrouter *router, struct vr_flow_entry *fe, memset(fmd, 0, sizeof(*fmd)); fmd->fmd_outer_src_ip = pnode->pl_outer_src_ip; fmd->fmd_label = pnode->pl_label; + if (pnode->pl_flags & PN_FLAG_TO_ME) + fmd->fmd_to_me = 1; } pkt = pnode->pl_packet; diff --git a/include/vr_flow.h b/include/vr_flow.h index f0d70b4e3..d5ae73eb6 100644 --- a/include/vr_flow.h +++ b/include/vr_flow.h @@ -142,6 +142,7 @@ struct vr_flow_stats { #define VR_MAX_FLOW_QUEUE_ENTRIES 3U #define PN_FLAG_LABEL_IS_VNID 0x1 +#define PN_FLAG_TO_ME 0x2 struct vr_packet_node { struct vr_packet *pl_packet;