Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp740113ybg; Fri, 18 Oct 2019 06:44:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqye6AZn/EM45KPXEPe4MB1xzWfuyp7RHoDhfJUd2viOi/fZg5VbAq3oOojUum22UT6VU2KL X-Received: by 2002:a17:906:4ac8:: with SMTP id u8mr8777315ejt.193.1571406241081; Fri, 18 Oct 2019 06:44:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571406241; cv=none; d=google.com; s=arc-20160816; b=UTGLx3b96tjk7m99+dLT6EmYcOyEhKxMnsBjFxaCmqUA2+3R1/s6WinYveEECir5Q+ VpWy1O7dIXGGw1S8EEzZGmliUvN4ew7gBjleR45D07RZH/fKuuLK6pw7qZRVuuGRAzZB fFkotvlFoDg2mmJ57CjJQyRD7CrkuYzv0hI15EIDHAeiM6dRWKKGtEKM7moydjjcN8Ze QUrKHOINGKd75HV0ZP9eYqMVgJ6DXQ5OjMIP5j0lZP8xgzfTD6B9pZ/L2ISsBnZN9ht9 626KW5Gg16cLhctAevlTusomU7af1+qlGzs6DWLA6vh5G8EmHkjjdLCUvRzpDkA6ZF4M RPgQ== 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=AvdX82gDjYsI6+terlAiEqdwIFtB7f56kH7xxsKFHgE=; b=iyvcqFRGpKZ7Rio3cCS5AtRX5+if/hLgkQ1TYX9KoJNph8NfJ8L/a/YWFLJVmNW4dq pYg9HbtgjJ0dgG50y3XMJYalf5Tf7NmBg9X+a7HSouefg4tqcQEFFeoiIbyb1wsbZKkx AyeS472urEeD7Q6VQTZEtxjcPai2rb4nWdbCOYpKgeoTiqSsDosVP2skvo6DmK4EQcJb /gRW7ZttfpM7ZtXEBbERoquxgGVkti3/+vNOP9eGCcDq4BXgMYa55DBZK81T/BqsNHTL hUQ2PCs927S+QjD9X8rgfeE4HrAN6VP02EPOKrSdWmfGfgp6LJOF/jiCGKlIsiJbec1t 43fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=h4JFgOYZ; 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 a26si3780642edv.35.2019.10.18.06.43.18; Fri, 18 Oct 2019 06:44:01 -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=h4JFgOYZ; 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 S2405728AbfJQJod (ORCPT + 99 others); Thu, 17 Oct 2019 05:44:33 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:25295 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727873AbfJQJoc (ORCPT ); Thu, 17 Oct 2019 05:44:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571305472; 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=h4JFgOYZ8BXpArxA53D/nP428nOrPmZkP8NFAN16rEC+z/DKb6SWNvUCKv4oXW8myZ8vFW kMW6yNcUgscuc1qCyp/QF3aUXwAR+TG6hGIoIIuvyPXI7pJkbDKHcpjz84VB4wCOjR8DjY XFvBFeGKCQ+vqXKVGfpFU667IEGcUJs= 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-73-JqSH6VFdOmC58Ta36sWcVw-1; Thu, 17 Oct 2019 05:44:30 -0400 Received: by mail-lj1-f200.google.com with SMTP id m81so308044lje.4 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=H4cLoR9SmhScP0aeycDpRKKnsATqWn7oNSd3mzdoHzQ9DMV0tW2qe0XLMYS940qWqv 1hHhAFKyGAuL437UaZ2rtAjQBPQgD2p178y+Y1IbJgd9VgW1wyfOcE24eTDguuSfPwiG BKvEOXGxTEsZ4BhoimPiGpQHPN12dwQWrtnPCEhrvmzAJYv0wi8s8TcHOtyQes+RBZu7 6xKhO6FL1pyP88B+VsBpSqcv6XaxEORGX9UNMpsPlCPBZISH2pnMTDs7QWisD+qZUF0A ecSBfZrDOnpOWiOoBAOPFpyEbG6B7N8clAxUjaRvQYqXh9oAwqK0KVQ4ZAMf/5NTUst+ DmwA== X-Gm-Message-State: APjAAAW772snomnK62ZGsQhJ6otTXMRAVAbwQQHJtRcPwdrxuuMTe7LL zkK+cCdGEYTcBj5/0aAsMlAeB+gNpGiAmVPkM09dNcrvR0AyI5JrV09x+KE3uBWPa7yOffYYpio ItG568MEUy3GlPqeTCf7LSUufTsM= X-Received: by 2002:a2e:3c05:: with SMTP id j5mr1947443lja.24.1571305469130; Thu, 17 Oct 2019 02:44:29 -0700 (PDT) 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 Subject: Re: [PATCH v2 4/4] mac80211: Use Airtime-based Queue Limits (AQL) on packet dequeue 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: JqSH6VFdOmC58Ta36sWcVw-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: > 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