lkml.org 
[lkml]   [2020]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 4.9 220/251] net: netem: correct the parent's backlog when corrupted packet was dropped
    Date
    From: Jakub Kicinski <jakub.kicinski@netronome.com>

    [ Upstream commit e0ad032e144731a5928f2d75e91c2064ba1a764c ]

    If packet corruption failed we jump to finish_segs and return
    NET_XMIT_SUCCESS. Seeing success will make the parent qdisc
    increment its backlog, that's incorrect - we need to return
    NET_XMIT_DROP.

    Fixes: 6071bd1aa13e ("netem: Segment GSO packets on enqueue")
    Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
    Reviewed-by: Simon Horman <simon.horman@netronome.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    net/sched/sch_netem.c | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
    index 11c4c93f5ded..e06491314d59 100644
    --- a/net/sched/sch_netem.c
    +++ b/net/sched/sch_netem.c
    @@ -609,6 +609,8 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch,
    }
    /* Parent qdiscs accounted for 1 skb of size @prev_len */
    qdisc_tree_reduce_backlog(sch, -(nb - 1), -(len - prev_len));
    + } else if (!skb) {
    + return NET_XMIT_DROP;
    }
    return NET_XMIT_SUCCESS;
    }
    --
    2.20.1
    \
     
     \ /
      Last update: 2020-01-16 19:03    [W:4.056 / U:0.660 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site