From owner-svn-src-all@freebsd.org Thu May 25 22:39:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDE2AD8076A; Thu, 25 May 2017 22:39:49 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 811321948; Thu, 25 May 2017 22:39:49 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4PMdmn9060333; Thu, 25 May 2017 22:39:48 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4PMdmQh060331; Thu, 25 May 2017 22:39:48 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201705252239.v4PMdmQh060331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Thu, 25 May 2017 22:39:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r318904 - stable/11/sys/netpfil/ipfw X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 May 2017 22:39:49 -0000 Author: truckman Date: Thu May 25 22:39:48 2017 New Revision: 318904 URL: https://svnweb.freebsd.org/changeset/base/318904 Log: MFC r318527 Fix the queue delay estimation in PIE/FQ-PIE when the timestamp (TS) method is used. When packet timestamp is used, the "current_qdelay" keeps storing the last queue delay value calculated in the dequeue function. Therefore, when a burst of packets arrives followed by a pause, the "current_qdelay" will store a high value caused by the burst and stick to that value during the pause because the queue delay measurement is done inside the dequeue function. This causes the drop probability calculation function to calculate high drop probability value instead of zero and prevents the burst allowance mechanism from working properly. Fix this problem by resetting "current_qdelay" inside the drop probability calculation function when the queue length is zero and TS option is used. Submitted by: Rasool Al-Saadi Modified: stable/11/sys/netpfil/ipfw/dn_aqm_pie.c stable/11/sys/netpfil/ipfw/dn_sched_fq_pie.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/ipfw/dn_aqm_pie.c ============================================================================== --- stable/11/sys/netpfil/ipfw/dn_aqm_pie.c Thu May 25 21:59:19 2017 (r318903) +++ stable/11/sys/netpfil/ipfw/dn_aqm_pie.c Thu May 25 22:39:48 2017 (r318904) @@ -211,11 +211,16 @@ calculate_drop_prob(void *x) pprms = pst->parms; prob = pst->drop_prob; - /* calculate current qdelay */ - if (pprms->flags & PIE_DEPRATEEST_ENABLED) { + /* calculate current qdelay using DRE method. + * If TS is used and no data in the queue, reset current_qdelay + * as it stays at last value during dequeue process. + */ + if (pprms->flags & PIE_DEPRATEEST_ENABLED) pst->current_qdelay = ((uint64_t)pst->pq->ni.len_bytes * pst->avg_dq_time) >> PIE_DQ_THRESHOLD_BITS; - } + else + if (!pst->pq->ni.len_bytes) + pst->current_qdelay = 0; /* calculate drop probability */ p = (int64_t)pprms->alpha * Modified: stable/11/sys/netpfil/ipfw/dn_sched_fq_pie.c ============================================================================== --- stable/11/sys/netpfil/ipfw/dn_sched_fq_pie.c Thu May 25 21:59:19 2017 (r318903) +++ stable/11/sys/netpfil/ipfw/dn_sched_fq_pie.c Thu May 25 22:39:48 2017 (r318904) @@ -383,11 +383,16 @@ fq_calculate_drop_prob(void *x) pprms = pst->parms; prob = pst->drop_prob; - /* calculate current qdelay */ - if (pprms->flags & PIE_DEPRATEEST_ENABLED) { + /* calculate current qdelay using DRE method. + * If TS is used and no data in the queue, reset current_qdelay + * as it stays at last value during dequeue process. + */ + if (pprms->flags & PIE_DEPRATEEST_ENABLED) pst->current_qdelay = ((uint64_t)q->stats.len_bytes * pst->avg_dq_time) >> PIE_DQ_THRESHOLD_BITS; - } + else + if (!q->stats.len_bytes) + pst->current_qdelay = 0; /* calculate drop probability */ p = (int64_t)pprms->alpha *