From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 8C0553B2A0 for ; Mon, 30 May 2016 08:35:38 -0400 (EDT) Received: by mail-wm0-x22d.google.com with SMTP id z87so69716348wmh.0 for ; Mon, 30 May 2016 05:35:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-transfer-encoding; bh=d1h1IaYrYuuadiTIikC8BXa/sog/Xlaj4fk0ljf8XmU=; b=vojFzve4tlExw3UCDpuTHrGOgli5wzzhhamYor1SYhK9JFQxFBQEYh8kyDV6Eq4sz0 z+u3ybfKlJabnXoo18mFM15EFBOByTBn7ozWe2uQo4Pxol/z01uNY0Jux870Zf/rp92m 4yd+L22J7WCv7Rc4aXbbvJ8DY36DsHpFwk3Z4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-transfer-encoding; bh=d1h1IaYrYuuadiTIikC8BXa/sog/Xlaj4fk0ljf8XmU=; b=WDGY1aaTsqwoZ5kP9bBZC7oZnEebw0RfQBigv3fc+koi3lvnMelULfMduy/uVHZh3w BH3tTQeUJC7UIJ5posms10ckBYRTpowRxJSr4BP70izJrg3Npm/naetYaJEMBs2by9o/ vq7xY5PabW28mbvTvCXzQw+4b9hytBiLgvf6WWccy8Spa08gbuH1dUf65R9mvHtA0jPl 1U6PnWjLT/4YiZOx+VLJF8PqcdONUlgpIhdKv0sos58mnPdSvOX98hzU9dQ2jBJ8uMtS uOaZmuYQvnBV3KYwjOHvnt1S2Qr/UHRKvwLF6cd9MFPF7e3kCEtsONjGTMauaTliJQ6F PRsw== X-Gm-Message-State: ALyK8tJIPmdFR1Irweea3Qd7115HEUuYEPkjIUz1Q6O3d6QwhpoK3zk7OBs1yADdpLXLWr7mxwvG3GZV3vpRKsupazGdSvyD3cYs/OpDqFfNcVnFNUQGJkQovpOv85F1FncBU5/8ccS4Ych1Spg/mIvz3NhslcnSTSqItw== MIME-Version: 1.0 X-Received: by 10.28.29.200 with SMTP id d191mr7668864wmd.91.1464611737588; Mon, 30 May 2016 05:35:37 -0700 (PDT) Received: by 10.194.71.52 with HTTP; Mon, 30 May 2016 05:35:37 -0700 (PDT) In-Reply-To: <87pos9dj2y.fsf@toke.dk> References: <87pos9dj2y.fsf@toke.dk> Date: Mon, 30 May 2016 14:35:37 +0200 Message-ID: From: Michal Kazior To: =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= Cc: linux-wireless , make-wifi-fast@lists.bufferbloat.net, "ath9k-devel@lists.ath9k.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-DomainID: tieto.com Subject: Re: [Make-wifi-fast] [RFC] ath9k: Measure per-station airtime usage 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: Mon, 30 May 2016 12:35:38 -0000 On 26 May 2016 at 15:50, Toke H=C3=B8iland-J=C3=B8rgensen wr= ote: > This is my attempt to add per-station airtime usage accounting to ath9k. > For now I just export it to a new debugfs entry, but my plan is to use > it to make (station) scheduling decisions. However, before attempting > that I would like some feedback from someone more familiar with the > ath9k than me as to whether this way of measuring airtime usage is > likely to give reasonable results. > > I realise that there's probably some things I'm missing, but an initial > test run indicates that the values are at least in the right ballpark (I > get a total of ~170k usecs of measured airtime per 200 ms sampling > interval when running three simultaneous TCP streams to three different > stations). > > So can anyone comment on whether I'm on the right track here? And > possibly provide some more detail as to what I'm missing and how to > remedy that? [...] > > +void ath_debug_tx_airtime(struct ath_softc *sc, > + struct ath_node *an, > + struct ath_tx_status *ts) > +{ > + struct ath_airtime_stats *astats; > + > + rcu_read_lock(); > + > + astats =3D &an->airtime_stats; > + astats->tx_airtime +=3D ts->duration; I'm not ath9k expert but this seems to be oblivious to tx retries. The ts->duration is acquired from the last used tx rate for given frame. Or am I missing something? I think you should use ts->ts_rateindex and ts->ts_longretry to factor in retries (see ath_tx_rc_status). Micha=C5=82