From cd7804d55705d664d8bdfcaecc0f99a4601f5e35 Mon Sep 17 00:00:00 2001 From: Divakar Date: Fri, 13 May 2016 20:02:58 +0530 Subject: [PATCH] Disabling GRO when mirroring is enabled When the packets are received on Fabric interface, these are subjected to GRO before transmitting them to Tap interface. If Tx port mirroring is enabled on Tap interface, as of now, mirroring is applied after GRO of the packets. If the mirroring server is on another compute node, these mirrored packets have GSO enabled. Vrouter makes use of Linux GSO routines and these GSO routines expect that skb in skb_list of head_skb does not contain any linear data (skb_headlen should be zero). Due to GRO the skb_headle of some skb's in skb_list contains linear data resulting in GSO routiness hitting a BUG_ON. To over come this, the GRO needs to be applied post mirroring. To enabled GSO on the mirrored packets the skb's gso_len also need to be supplied. Instead of this fix, GRO is disabled if Tx port mirroring is enabled on Tap interface as stop gap fix till the complete fix is in place. Change-Id: I02b585bf919323b5dd30e36f1f2edade7705a60f closes-bug: #1577473 --- dp-core/vr_nexthop.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dp-core/vr_nexthop.c b/dp-core/vr_nexthop.c index 704d06aa9..10ad1c52a 100644 --- a/dp-core/vr_nexthop.c +++ b/dp-core/vr_nexthop.c @@ -2060,13 +2060,12 @@ nh_encap_l2(struct vr_packet *pkt, struct vr_nexthop *nh, } } - if (pkt->vp_flags & VP_FLAG_GRO) { - if (vif_is_virtual(vif)) { - if (vr_gro_input(pkt, nh)) { - if (stats) - stats->vrf_gros++; - return 0; - } + if ((pkt->vp_flags & VP_FLAG_GRO) && vif_is_virtual(vif) && + (!(vif->vif_flags & VIF_FLAG_MIRROR_TX))) { + if (vr_gro_input(pkt, nh)) { + if (stats) + stats->vrf_gros++; + return 0; } } @@ -2139,7 +2138,8 @@ nh_encap_l3(struct vr_packet *pkt, struct vr_nexthop *nh, } } - if ((pkt->vp_flags & VP_FLAG_GRO) && vif_is_virtual(vif)) { + if ((pkt->vp_flags & VP_FLAG_GRO) && vif_is_virtual(vif) && + (!(vif->vif_flags & VIF_FLAG_MIRROR_TX))) { if (vr_gro_input(pkt, nh)) return 0; }