Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1741277ybg; Wed, 23 Oct 2019 22:30:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzFHt5covQMcgS17rwJxBzUtKJS73VdB2XA1vBPggUpLj8sH82tdCZYjXYMk0x4ZsPbvSlv X-Received: by 2002:aa7:ca59:: with SMTP id j25mr41390876edt.78.1571895003378; Wed, 23 Oct 2019 22:30:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571895003; cv=none; d=google.com; s=arc-20160816; b=WTyH6fDsOIFWnz+89qWxeyg3svwM/nKuiMOeZD84UyLFanTN4kWj4VChqKtVyLxJWq Mm5ZdVJed7mcgc2pyub295S6AKkNwDwZGbWpV5SNiWMaBb0uEAPh6ZdtafepHLa62KSm pmnhBXK38w1bwiRsztn75zp8gNyCYk/GkhazL3j8joyoSvzQaArU//zB6eahtpHaODRK L45Xld0VEM+w5cI+i0+nsMgkyW3FycmbML3u+5ZoSko0lIdh7heGbiw/flbWpZp3Fg+7 4RQ+tLb7gKcvEKmC2BIs34AqqI2xjn6zNkSehRFLsllrIPu6jNMO4ZAmGhA1VsYfNBPg 8xEw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Wf7cqgLpHpMCfHDTso2mEEg6iVGE1A3AlSMCK0EZOvI=; b=vydyCe3uBisbgwPdy2WeuSWvO3k6hFcK+yl1s87CsddkgYscSl/uioNiNY0ODTK83i Vkh+LF9WGdrEpN3F+Sp93aYc7lF0ATAwxFudCwCbxW9mUemHnrI4zGg6eagsvONm1Xw6 XJVHbnZopefiMdVSDpV37zYMTLQmndaQyCsZ4fFtKS6BPlQs7j95FkgQlr6PY9pBg5py i5Y0mq4ZKsfB1TC8sPbvtV2liWt+ft4xdGYRsxnEAvltteT9VXUZFvkEWBeQYmOY5cpZ 4k1Qq1agU4A1JbnY5T5uKX38m2hUECtlHs4Ck19Cm3cdMR9IlPjbcs6qWR1EiGaRvN2m 3ssQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MeL78Pzz; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q45si7520800eda.202.2019.10.23.22.29.21; Wed, 23 Oct 2019 22:30:03 -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=@google.com header.s=20161025 header.b=MeL78Pzz; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406841AbfJWPnQ (ORCPT + 99 others); Wed, 23 Oct 2019 11:43:16 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:39983 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404173AbfJWPnQ (ORCPT ); Wed, 23 Oct 2019 11:43:16 -0400 Received: by mail-lj1-f195.google.com with SMTP id u22so3626818lji.7 for ; Wed, 23 Oct 2019 08:43:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Wf7cqgLpHpMCfHDTso2mEEg6iVGE1A3AlSMCK0EZOvI=; b=MeL78PzzFc4GWTGjttUER3eajJiHAfiXzG8G1Xek8riNLS0Akb3EyaIF8kCjplCBvC e8PdIOrGlpPr64UiYnljhSyeNwzpyq1+SmkBqsKNqfnIjx/7/WUm7V18gqSZfq6qXpjy HSSFn0i5dZw0hwcdKmrjoc8j36P/bg/LP5qNws123c15xYetsbls2kJVLs9fGDiHpzTp NTAbYCE9/adTig9wIUFJSciEu5YjcNmNc29oi5wz79zXLWWwMOEF2YCmKSle0etLBDjV RPybKBRkcQRNKCdFp6+vsH/DZ/Jg6//ynFzwearQSIDF3fO2sX+/o3KRHWOwcJvzxVXH 952A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Wf7cqgLpHpMCfHDTso2mEEg6iVGE1A3AlSMCK0EZOvI=; b=SJZ9GgBg/fZvB37fxzt12SQI1/+1tfSOR8mKZjWZDObanprHTKbFjqkIidfQasPXpC ochDJbSnaUHluHrbcOtQVmQ2pqAK60Q2eAycPHaQzvSp/dsvqnGIhb7y6Y1LyLtCMUx8 ZTEaiZfO0o/emMRqOildf5N1bOprcwGLbHhPXLCWm8Uc/j6/efT01CBueqaUbPl/1Byi NjvYduJ3gKl/6vVT7YIaMXx10zzL5Sejts9LGCvDBumqME1iUg2E4FinitKzuLw0swfq My5KV+e5CuTFcZPkp/d8acedVvoilu7r5cE+E5FeM68MC1C4GqNqFiV6ppwQcqyAw2Yc E3Kg== X-Gm-Message-State: APjAAAVMhnhc/1HTdjxoaaTHpVtdARsxN27HumHWSYhbr/LQpeAzM8SG zdOblfGZyoh8+cVzMBwMEJMUXnmp/8fiCv17A58cVA== X-Received: by 2002:a05:651c:326:: with SMTP id b6mr7678893ljp.119.1571845394424; Wed, 23 Oct 2019 08:43:14 -0700 (PDT) MIME-Version: 1.0 References: <157148503415.2989444.7391437309981941226.stgit@toke.dk> <157148503865.2989444.7118792679603045723.stgit@toke.dk> <871rv5ovwr.fsf@toke.dk> <87tv7znact.fsf@toke.dk> <87lftbn60t.fsf@toke.dk> In-Reply-To: <87lftbn60t.fsf@toke.dk> From: Kan Yan Date: Wed, 23 Oct 2019 08:43:03 -0700 Message-ID: Subject: Re: [PATCH v4 4/4] mac80211: Use Airtime-based Queue Limits (AQL) on packet dequeue To: =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org > Aha! Turns out I was doing the sta lookup completely wrong in > ieee80211_report_used_skb(); so anything frames that were dropped and > went through there would not get its airtime subtracted correctly. Will > send a v6 with a fix :) Awesome, thanks! That looks very promising. The symptom I see with previous patch is the interface's pending airtime count looks fine, but the station's airtime get wrong, either due to airtime is credited to the wrong station or wrong AC. On Wed, Oct 23, 2019 at 2:52 AM Toke H=C3=B8iland-J=C3=B8rgensen wrote: > > Toke H=C3=B8iland-J=C3=B8rgensen writes: > > > Kan Yan writes: > > > >>> >> + if (ieee80211_is_data_qos(hdr->frame_control)) { > >>> >> + qc =3D ieee80211_get_qos_ctl(hdr); > >>> >> + tid =3D qc[0] & 0xf; > >>> >> + ac =3D ieee80211_ac_from_tid(tid); > >>> >> + } else { > >>> >> + ac =3D IEEE80211_AC_BE; > >>> >> + } > >>> > > >>> > The tid/ac is incorrect either here or in __ieee80211_tx_status() w= hen > >>> > tested with ath10k. The ac is set to AC_BE with test done using BK > >>> > class traffic, hence the pending airtime get updated for the wrong > >>> > txq. > >>> > >>> Huh, well that won't do, obviously :) > >>> > >>> Any idea why it might be wrong? > >> > >> somehow ieee80211_is_data_qos() returns false. Besides, qos_control > >> field doesn't seems to be set in ieee80211_build_hdr(). > >> > >>> Hmm, I guess we could just get the ac using skb_get_queue_mapping(). > >>> I'll send an update with this fixed for you to try :) > >> Thanks for the quick update. It is getting much better, but > >> unfortunately the pending airtime accounting sometimes is still not > >> correct and cause txq stuck occasionally. > > > > OK, so that has to mean that there are packets getting dropped somewher= e > > without going through ieee80211_report_used_skb(). Assuming you're not > > hitting the underflow warnings, just seeing the counter not get back > > down to zero? > > > > Could you see if you can find out if ath10k does that anywhere? I'll go > > hunting in mac80211. > > > > Looking for calls to kfree_skb() or kfree_skb_list() should hopefully > > turn up something... > > Aha! Turns out I was doing the sta lookup completely wrong in > ieee80211_report_used_skb(); so anything frames that were dropped and > went through there would not get its airtime subtracted correctly. Will > send a v6 with a fix :) > > -Toke >