Skip to content

Commit

Permalink
Post GRO, label in fmd can't be used to check whether the packet
Browse files Browse the repository at this point in the history
was tunneled or not

Once the packet is submitted for GRO, all datapath information is
lost. Post GRO, only values that are saved in the packet are the
vif and the nexthop. vif is a recent addition to the saved
information that helped us to identify which interface the packet
came from originally. Once the vif value was set properly, the logic
that checked whether the packet should be trapped to agent or not
based on the presence of label (basically fabric arp responses should
be trapped or not), misbehaved since label information is not saved
pre-GRO and hence not available in the metadata post GRO. For now,
fix the specific logic by checking whether the egress vrf is different
from the ingress vrf, which will be the case since physical interface
vrf will not be the same as vm's vrf.

Change-Id: Iba000889039bc8a5020fc11a462ba1b1a68ce1c8
Closes-BUG: #1551382

Do not reuse forwarding metadata post mirroring

A mirror action needs its own forwarding metadata since the forwarding
parameeters that are used for mirroring will be different from those
that are used for packet forwarding. In this particular case, the vrf
to which the packets are mirrored are different from the vrf to which
packets need to be classified, and hence the packets were dropped in the
flow module with no source route as the drop reason.

Change-Id: I21930818a5cdec560818acb79f671ce29ac8bc85
Closes-BUG: #1552101
  • Loading branch information
anandhk-juniper committed Mar 14, 2016
1 parent 1f384ef commit 7481ce1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions dp-core/vr_datapath.c
Expand Up @@ -340,6 +340,13 @@ vr_handle_arp_reply(struct vr_arp *sarp, struct vr_packet *pkt,
if (fmd->fmd_label >= 0)
return !handled;

/*
* in gro cases, fmd label won't be set. Hence, resort to the
* following check to identify whether the packet was tunneled
*/
if (fmd->fmd_dvrf != vif->vif_vrf)
return !handled;

/* If fabric: Agent and kernel are interested in it */
cloned_pkt = vr_pclone(pkt);
if (cloned_pkt) {
Expand Down Expand Up @@ -540,14 +547,15 @@ unsigned int
vr_virtual_input(unsigned short vrf, struct vr_interface *vif,
struct vr_packet *pkt, unsigned short vlan_id)
{
struct vr_forwarding_md fmd;
struct vr_forwarding_md fmd, mfmd;

vr_init_forwarding_md(&fmd);
fmd.fmd_vlan = vlan_id;
fmd.fmd_dvrf = vrf;

if (vif->vif_flags & VIF_FLAG_MIRROR_RX) {
fmd.fmd_dvrf = vif->vif_vrf;
mfmd = fmd;
mfmd.fmd_dvrf = vif->vif_vrf;
vr_mirror(vif->vif_router, vif->vif_mirror_id, pkt, &fmd);
}

Expand Down

0 comments on commit 7481ce1

Please sign in to comment.