From patchwork Wed Jan 9 16:09:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= X-Patchwork-Id: 1022503 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43ZYyH4cTgz9sD9 for ; Thu, 10 Jan 2019 03:10:47 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732615AbfAIQKq (ORCPT ); Wed, 9 Jan 2019 11:10:46 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:40481 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731928AbfAIQKp (ORCPT ); Wed, 9 Jan 2019 11:10:45 -0500 Received: by mail-wm1-f66.google.com with SMTP id f188so8831611wmf.5 for ; Wed, 09 Jan 2019 08:10:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Tne+pz2deJc2VCXjfLIxDp8sTgCtfQZOoUqfWW6tQ/M=; b=XtGKzmZ2x9+DLuCTENb5ocw6upF7qeMSWw61RH2WJ/hghZiFveRZeqzhmoRTMPdhIl y0qyow5gm9GFWD6OOOUAs3W3nc5Yrrz6UocxzKNMYjJsU+mx1vFCtMB1dlwaTytn5bKz 6Ta1vLUhEB9SaKu2oqvSZKYXRX5xhApJ+8wQqAZRW19xrtHb46f6y5pinzsvPFcVHWv9 h+mUSqF92o9PQjnh+aTejudlhj+/8JQCu7/5DxE2Vd9NoKlvZp8OqVgFw3e9U2xCd7Fo R70dmkbZaWGPJ70b5b4yPGFNk7LPgKyMNBDNvaPDz62JPNCrv2rSLuZqsESEIJIaf86r 9nXw== X-Gm-Message-State: AJcUukd+ONYc68vPB5PahGfJPrqrJzhPdcBqwDCk8C2iIZAjijL9rGQl WIWfYACRV7WiNPlulqeQ0aYE8HvzuP0= X-Google-Smtp-Source: ALg8bN6uMNUOGDOjYUwSsQFxY82cIDAIY1qvzPSMwzGYTzGlZuJVhRsG4BOwRsluYFpBVxDjpFYanw== X-Received: by 2002:a1c:f613:: with SMTP id w19mr6262486wmc.0.1547050243923; Wed, 09 Jan 2019 08:10:43 -0800 (PST) Received: from tohojo-x1-rh.localdomain (borgediget.toke.dk. [85.204.121.218]) by smtp.gmail.com with ESMTPSA id j3sm13821576wmb.39.2019.01.09.08.10.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Jan 2019 08:10:43 -0800 (PST) Received: by tohojo-x1-rh.localdomain (Postfix, from userid 1000) id DDA3D1833C1; Wed, 9 Jan 2019 17:10:42 +0100 (CET) From: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= To: netdev@vger.kernel.org Cc: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= Subject: [PATCH v2 3/3] sch_cake: Correctly update parent qlen when splitting GSO packets Date: Wed, 9 Jan 2019 17:09:44 +0100 Message-Id: <20190109160943.18051-4-toke@redhat.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190109160943.18051-1-toke@redhat.com> References: <20190109160943.18051-1-toke@redhat.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org To ensure parent qdiscs have the same notion of the number of enqueued packets even after splitting a GSO packet, update the qdisc tree with the number of packets that was added due to the split. Reported-by: Pete Heist Tested-by: Pete Heist Signed-off-by: Toke Høiland-Jørgensen --- net/sched/sch_cake.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c index b910cd5c56f7..73940293700d 100644 --- a/net/sched/sch_cake.c +++ b/net/sched/sch_cake.c @@ -1667,7 +1667,7 @@ static s32 cake_enqueue(struct sk_buff *skb, struct Qdisc *sch, if (skb_is_gso(skb) && q->rate_flags & CAKE_FLAG_SPLIT_GSO) { struct sk_buff *segs, *nskb; netdev_features_t features = netif_skb_features(skb); - unsigned int slen = 0; + unsigned int slen = 0, numsegs = 0; segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK); if (IS_ERR_OR_NULL(segs)) @@ -1683,6 +1683,7 @@ static s32 cake_enqueue(struct sk_buff *skb, struct Qdisc *sch, flow_queue_add(flow, segs); sch->q.qlen++; + numsegs++; slen += segs->len; q->buffer_used += segs->truesize; b->packets++; @@ -1696,7 +1697,7 @@ static s32 cake_enqueue(struct sk_buff *skb, struct Qdisc *sch, sch->qstats.backlog += slen; q->avg_window_bytes += slen; - qdisc_tree_reduce_backlog(sch, 1, len); + qdisc_tree_reduce_backlog(sch, 1-numsegs, len-slen); consume_skb(skb); } else { /* not splitting */