Skip to content

Commit

Permalink
Carry 'tome' flag across flow queue enqueue and flush
Browse files Browse the repository at this point in the history
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
  • Loading branch information
anandhk-juniper committed Jan 30, 2015
1 parent 73dbb50 commit 6c9b489
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion dp-core/vr_bridge.c
Expand Up @@ -420,7 +420,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);
Expand Down
4 changes: 4 additions & 0 deletions dp-core/vr_flow.c
Expand Up @@ -474,6 +474,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();
Expand Down Expand Up @@ -804,6 +806,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;
Expand Down
1 change: 1 addition & 0 deletions include/vr_flow.h
Expand Up @@ -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;
Expand Down

0 comments on commit 6c9b489

Please sign in to comment.