From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 310413B29E for ; Thu, 17 Oct 2019 05:44:34 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571305473; 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=AvdX82gDjYsI6+terlAiEqdwIFtB7f56kH7xxsKFHgE=; b=gdFD6YTd7yS31DaFxj0/jmevefAiblpSvSZRjWK3NBbjksKoDw3Q6AXeCkc6bIY3j73KMm 0+ff3nkNVzFhdQGoSUBSorlrZ7nZxyArolkyWj6KHfGdX4BxXwlKucCz/BbH6HRTNqH0CZ 4iA1oBn8IiXicOlF8VhJkzeAbqDuRsI= 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-271-vPFMjYBDNQC5o98B205Lzw-1; Thu, 17 Oct 2019 05:44:30 -0400 Received: by mail-lj1-f199.google.com with SMTP id w26so308230ljh.9 for ; Thu, 17 Oct 2019 02:44:30 -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=s+jcaxhu6oDWhtVBooMl1ngDQtHW2eHMGXoYZ8Sz7Y0=; b=UIdy/sMNbceRfgBuNRfsW8NhVb4TOqe/kEZ6nwCHoeQXQxZev+fuGS4oWlRQgcvZGt ra7jvF1re/mAG+HRCYEehUIdnPFKjutanym9qjAzE4a174AFT2RxPWiZgT9R93/qODOp QLwW4g7QC1VD933s5DpFTciy61EVTUp9xY1BYsfLfB+hRn5hRo9B13MrY3EnZPmmxowK BjecXWxhw8YlZmAIFDB1V0uzqa2bQy8bQoND5LoeWA2+vhdkf1IKK+BIe347eiRiSeNg 9MjEb33hUaUXxfqyR3dwV0e3KKpxZR+iwQCKolQlIAxaB1NRbsEH+sv3nMH5d6R7GbJF ErMA== X-Gm-Message-State: APjAAAXH06L4dVL9Eb2nZ4vmk5OhkHqbHEd2u3G+BmbeVN8rvwdCGeCl 3RR+rKx94sv84NyslbJG5vN2gBOaL2e3gfHgdPdOlwdi9kB0Khvsbw0cMLqXxXZHFf8BYBpVSo5 81uy5HMjd5DDBlSaKFOFe8f2LSnW+JIubU3Q= X-Received: by 2002:a2e:3c05:: with SMTP id j5mr1947459lja.24.1571305469240; Thu, 17 Oct 2019 02:44:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxO1j6qiZOfAL5tJA6olP8+LPlYQd+Y7no3y4yFz1FQHRzpNQVDOQEvMTwwldWseOilFhe41A== X-Received: by 2002:a2e:3c05:: with SMTP id j5mr1947434lja.24.1571305468911; Thu, 17 Oct 2019 02:44:28 -0700 (PDT) Received: from alrua-x1.borgediget.toke.dk ([2a00:7660:6da:443::2]) by smtp.gmail.com with ESMTPSA id u26sm825833lfd.19.2019.10.17.02.44.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 02:44:28 -0700 (PDT) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 810AE1804C9; Thu, 17 Oct 2019 11:44:27 +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@lists.bufferbloat.net, ath10k@lists.infradead.org, John Crispin , Lorenzo Bianconi , Felix Fietkau , Rajkumar Manoharan , Kevin Hayes In-Reply-To: References: <157115993755.2500430.12214017471129215800.stgit@toke.dk> <157115994190.2500430.14955682016008497593.stgit@toke.dk> X-Clacks-Overhead: GNU Terry Pratchett Date: Thu, 17 Oct 2019 11:44:27 +0200 Message-ID: <87o8yfg0zo.fsf@toke.dk> MIME-Version: 1.0 X-MC-Unique: vPFMjYBDNQC5o98B205Lzw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Make-wifi-fast] [PATCH v2 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: Thu, 17 Oct 2019 09:44:34 -0000 Kan Yan writes: > Hi Toke, > > Thanks for getting this done! I will give it a try in the next few > days. A few comments: > >> The estimated airtime for each skb is stored in the tx_info, so we can >> subtract the same amount from the running total when the skb is freed or >> recycled. > > Looks like ath10k driver zero out the info->status before calling > ieee80211_tx_status(...): > int ath10k_txrx_tx_unref(struct ath10k_htt *htt, > const struct htt_tx_done *tx_done) > { > ... > info =3D IEEE80211_SKB_CB(msdu); > memset(&info->status, 0, sizeof(info->status)); > ... > ieee80211_tx_status(htt->ar->hw, msdu); > } Ah, bugger; I was afraid we'd run into this. A quick grep indicates that it's only ath10k and iwl that do this, though, so it's probably manageable to just fix this. I think the simplest solution is just to restore the field after clearing, no? > We need either restore the info->status.tx_time_est or calling > ieee80211_sta_update_pending_airtime() in ath10k before tx_time_est > get erased. > >> + if (local->airtime_flags & AIRTIME_USE_AQL) { >> + airtime =3D ieee80211_calc_expected_tx_airtime(hw, vif, = txq->sta, >> + skb->len + = 38); > > I think it is better to put the "+ 38" that takes care of the header > overhead inside ieee80211_calc_expected_tx_airtime(). Hmm, no strong opinion about this; but yeah, since we have a dedicated function for this use I guess there's no harm in adding it there :) -Toke