From mboxrd@z Thu Jan 1 00:00:00 1970 From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= Subject: Re: [PATCH 3/4] sch_api: Allow reducing queue backlog by a negative value Date: Tue, 08 Jan 2019 10:55:51 +0100 Message-ID: <87zhsbv5g8.fsf@toke.dk> References: <20190107194733.31138-1-toke@toke.dk> <20190107194733.31138-4-toke@toke.dk> <69d53b63-f7ed-3c6e-f191-43ec7fbd1735@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: cake@lists.bufferbloat.net, Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Eric Dumazet , netdev@vger.kernel.org Return-path: Received: from mail.toke.dk ([52.28.52.200]:59739 "EHLO mail.toke.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727367AbfAHJz6 (ORCPT ); Tue, 8 Jan 2019 04:55:58 -0500 In-Reply-To: <69d53b63-f7ed-3c6e-f191-43ec7fbd1735@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: Eric Dumazet writes: > On 01/07/2019 11:47 AM, Toke H=C3=B8iland-J=C3=B8rgensen wrote: >> From: Toke H=C3=B8iland-J=C3=B8rgensen >>=20 >> With GSO splitting in sch_cake, we can decrease as well as increase the >> qlen. To make it possible to signal this up the qdisc tree, change >> qdisc_tree_reduce_backlog() to accept signed integer values as the number >> of packets and bytes to reduce the backlog by. > > > Not sure why this patch is needed, given we use u32 integers > for q.qlen & qstats.backlog > > 0xFFFFFFFF for n is really -1 once folded... > > sch->q.qlen -=3D n; > sch->qstats.backlog -=3D len; Sure, it works without the patch, but changing to int properly communicates the intent (that negative values are allowed) rather than rely on overflow behaviour... -Toke