Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1872422ybg; Sat, 19 Oct 2019 04:15:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwqYPENeSPvjfhEVuTHTdmdKKUQZiVP9kvl8u3e0KWT/usEhMtPo4sqVEf+ygtV/6AY3aqu X-Received: by 2002:a17:906:3010:: with SMTP id 16mr13172743ejz.74.1571483708196; Sat, 19 Oct 2019 04:15:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571483708; cv=none; d=google.com; s=arc-20160816; b=HY1dibI59HsCaw++6ZFOgD1+OsIdG2ZDyvOfuFn5G+tfsP2wkmcyeHzmLthLCwA/Ot znv705M3p2oMPlHm2XB4kpWI47z9KBMPJgyREMa8T1ZsOotnkT6tUTVDLCC8CGygkodM NUk5W53H9kJKIzYwP6dU2rXadKiA8VNNYiN2TiciTiPCzVKXCjCO4rcDjBp/k1icCrd+ MvJNW3qRESJsr8KPmLijnbqKMsqnOeJ/+MuvXaht6SAsD+QZqgOhhhHvVi6czq31olub g6Fki7HiCQkDMgNwQGVRY57q+d3xYzeVMbr0WQV5JvW8xF9qMd5XLxWWSyPaihlhkcp8 MCyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=WoX9rczeRjvya0vnh4YYflEgbgCXdBdatjIIvrFPWu0=; b=dUWNUHsVu+EEzQB+FdI5RQ+sPZY2k/bAcUEvyBlW326pklObq+0eMHP9Ei+nwmoWoa jdZv61KapNtLg3GmrmvF2AughGtNZ31wlmd0w7EDXC1wocxg8gft5me0cFL8naxqbKLj eIra6L1PtFOpvw6fymTuqo44PbbuMCbGcKoWH7UoFIpLtrWeAIujG1plWwwYBdK/REoe TZXVzJWXbU+wc/hFoB6lH+a6E/6c9jFPjk9S3fVdnymzXPdQzGxouBvSB5Nu2CLLLe9z hyonRCm51ifqL1qDY5grhbQEpNjH44/Z8nOopDPjX3sDBjinhWJqBFnsCxIxs1V1lqSe jyWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Y8vkzNLK; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z3si5163285ejb.42.2019.10.19.04.14.42; Sat, 19 Oct 2019 04:15:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Y8vkzNLK; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725895AbfJSLNG (ORCPT + 99 others); Sat, 19 Oct 2019 07:13:06 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:31686 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725883AbfJSLNF (ORCPT ); Sat, 19 Oct 2019 07:13:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571483583; 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=Y8vkzNLKbQGMa2euHCJRTV4d0MXSbadNwg0QNuJEl7DXmNql7OzXa+WlER3QdYXH3EcyN3 6x+KRPdhu0nkTlPx1wpWcKrwdYFMp8on1m4h9+GVI7VJBbjYA0uwYSWx8+tBdoMdLQJtEL t7o788NeGdo9DnK955vOCw8hMx/j6Z8= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-159-gdVylvcfOxaMxhfdhI-amA-1; Sat, 19 Oct 2019 07:12:58 -0400 Received: by mail-lj1-f200.google.com with SMTP id h19so1617819ljc.5 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=Pv+9bPNnCZRGFGasxd+Ic+w4zupaVRmrRwYxAjwd4njAAcgGzX4xriP59YQP+D8FF3 LGGWQNUhOpi4jMvzaq/t06/EGJ/4iG/9UQrzpHl1yAeT02lNzImF2B/zwCE88Qn5csUU HRA0X9TU1pfqv4cCqRmOyOLSe9fgGfylwdnbzuFELOcT8EnyfeG5Xaslu/f8Y12W5st+ JcULfuJ51SPp3b51IUC+yP0WSYzr0wjjq7eonx5Gtg5VsvQq7YYv2HXiB1adsccaijq1 MvdyxNv83NMMpMvFQeFjMXjGXysegczgeBM+IIdJ6gr3UHziAoubr3r7MPoZNKy0TBAy VEpA== X-Gm-Message-State: APjAAAV3hOWJYpllCXudljtTA/S7B8qPKI1NSBowFQVnNR2+FeoeBWa5 fA0z37xc7RR/I6ZbNpg6XFK7NTZ0fvWMQBDNjgxps0kttQc5B4ziGnE6lTJPw89EnkS6DSrb6Gq JF3fd9QaW4bjFWCUF7NMjUx2Yu1c= X-Received: by 2002:a2e:a0d6:: with SMTP id f22mr9186477ljm.74.1571483577551; Sat, 19 Oct 2019 04:12:57 -0700 (PDT) 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 Subject: Re: [PATCH v3 4/4] mac80211: Use Airtime-based Queue Limits (AQL) on packet dequeue 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: gdVylvcfOxaMxhfdhI-amA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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