From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 2753F3B29E for ; Sat, 19 Oct 2019 07:13:03 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571483582; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WoX9rczeRjvya0vnh4YYflEgbgCXdBdatjIIvrFPWu0=; b=ZRLd30xlt4vj2SDOBTGXUwbjUnKvDjwh5CkTdYAHgi1ioOcuEcosP9cMl3n2O/pbn38W4v QhJtQz+iFRnnafMEqmYhULlo9Ajv2Y0kNoyDAMHY007CI4LVxjB7aPAiPtmI2OXuhdIWJL cwSCurfrcl49I2RVo4eGxEOdU4jB6yk= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-142-ev1gfy6cOIWiXKlNR7TcwQ-1; Sat, 19 Oct 2019 07:12:59 -0400 Received: by mail-lj1-f199.google.com with SMTP id b90so1615859ljf.11 for ; Sat, 19 Oct 2019 04:12:58 -0700 (PDT) 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:in-reply-to:references:date :message-id:mime-version; bh=M4GgkX+LRADBECdK3BnJ0KmXqiIAAwYR2Rj8nOCvbRc=; b=e6JUQVM64NaiBVH/G2goTiiKKVXihgdE3cvyd44mRpqXVzZDzrT/+1AQ/tso9kBFAd toHmCfVkZTDctuWDPTWLSB3dXKtN4IZIUfmYqd+khQbsMj1Cap7kXYmZtDWrkB1OMme1 az/bhsIX3sTyGzpbqPYnwufJblqEpiVvKjTTva+Y9P4IwJjRlJLNUK7tdtZQ7P9K7q0b ojLCL7o1EGt6Rbi7eegP/CYRuEconStyLzCG8xFP6IWUUl6IUTvt6PGqpIrPJpJTzeeH /ETNriU/gcM57OD9EQaGCIcQuPaJJv1tmHY+6WCR3oEGRMrj5nyPRXL2wtgjyX80dNva Z7QA== X-Gm-Message-State: APjAAAW+8ElurWfznQYpWieYEMfVHV5Wcf612DsImRug+WOt/FnHcU3z xRnlbI2IazTm8k/+NmDZqRm/60eBHISgrDfMZWTmJCzrqsEphgPGk8CceplKOdnHgA4wFm9EdW7 WfYKL5Hb2VZhgULNuv1GEAa1ivWRYqmN4i1w= X-Received: by 2002:a2e:a0d6:: with SMTP id f22mr9186474ljm.74.1571483577551; Sat, 19 Oct 2019 04:12:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlAKTSJxvndxc9u4z5wrZ6m3ed9972rGIVuaUby4/A2GFHKgjGkWh5J+VqEVLYMg27m8c8Kg== X-Received: by 2002:a2e:a0d6:: with SMTP id f22mr9186462ljm.74.1571483577382; Sat, 19 Oct 2019 04:12:57 -0700 (PDT) Received: from alrua-x1.borgediget.toke.dk ([2a00:7660:6da:443::2]) by smtp.gmail.com with ESMTPSA id e19sm3391039lja.8.2019.10.19.04.12.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Oct 2019 04:12:56 -0700 (PDT) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 967CE1804C8; Sat, 19 Oct 2019 13:12:55 +0200 (CEST) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Kan Yan Cc: Johannes Berg , linux-wireless@vger.kernel.org, Make-Wifi-fast , ath10k@lists.infradead.org, John Crispin , Lorenzo Bianconi , Felix Fietkau , Rajkumar Manoharan , Kevin Hayes In-Reply-To: References: <157140962094.2866668.3383184317264069493.stgit@toke.dk> <157140962534.2866668.1182822483250825739.stgit@toke.dk> X-Clacks-Overhead: GNU Terry Pratchett Date: Sat, 19 Oct 2019 13:12:55 +0200 Message-ID: <87o8ydc7k8.fsf@toke.dk> MIME-Version: 1.0 X-MC-Unique: ev1gfy6cOIWiXKlNR7TcwQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Make-wifi-fast] [PATCH v3 4/4] mac80211: Use Airtime-based Queue Limits (AQL) on packet dequeue X-BeenThere: make-wifi-fast@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Oct 2019 11:13:03 -0000 Kan Yan writes: >> + if (local->airtime_flags & AIRTIME_USE_AQL) { >> + airtime =3D ieee80211_calc_expected_tx_airtime(hw, vif, = txq->sta, >> + skb->len); >> + if (airtime) { >> + /* We only have 10 bits in tx_time_est, so store= airtime >> + * in increments of 4 us and clamp that to 2**10= . >> + */ >> + info->tx_time_est =3D min_t(u32, airtime >> 2, 1= << 10); >> + ieee80211_sta_update_pending_airtime(local, tx.s= ta, ac, >> + airtime, fa= lse); >> + } >> + } >> + > > It should be: > ieee80211_sta_update_pending_airtime(local, tx.s= ta, ac, > > info->tx_time_est << 2, false); > > The airtime rounded to 4us (info->tx_time_est << 2), instead of the > original airtime should be used when registering the pending airtime, > to keep it consistent with airtime subtracted when the skb is freed. Yes, I realised that last night as well. The rounding is also off (max is 2**10-1, not 2**10. Will send a v4 :) -Toke