From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x241.google.com (mail-it0-x241.google.com [IPv6:2607:f8b0:4001:c0b::241]) (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 0DDAD3B2BC for ; Sat, 4 Jun 2016 13:06:09 -0400 (EDT) Received: by mail-it0-x241.google.com with SMTP id i65so1075532ith.3 for ; Sat, 04 Jun 2016 10:06:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=3kmChuh73CulcHTebAH5FivCwrIAPSMafGk5Drr6neQ=; b=X26HA9sODWKMzf25T0DAc5fAZrNS1OZVFtDvl3uLLmgRdqGRPvIRVbm/9VG7CeaiAc aCrvIwBtqJZ75a4O8qEe7yvZJ0BAsySy/YunvDKpPT5GIRrJ1LXNjtZkLwhA3i0sx+7V pEKezla+tCN2Q3JgHkrm88BLs377cZbIOT3yDCE7wyaWgHdxIl70dssWmkAAYzNgi8ki 6lvDRMPCp4QqWy93U6ftBUMizsPQHQw6SPGWkfC7kCq8Nz+iU4YGe/HewMGy/e/lF4TE r0cojjPOm4OsH9pXgmTsYQIhjxkzt6nZn2D8fI/fdkId1qwtpjta4CEH2c3T9BJAnn8D 33Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=3kmChuh73CulcHTebAH5FivCwrIAPSMafGk5Drr6neQ=; b=lOPp9jUSP1m4uNa9LzBRuVqjf3KOYuyCr5UAKcMJyZdmCBDPRNCUq49YwttSB3NNiV QIbyLeBL2Mo7NXEXhEBB1sZkpBsEcomVcKf5gOiwHJJXhYxsOf49mKoI06Q5uopQRFDp sJzdDGvhskdTvNumPzx/dzl3G9lFtbcz23vIB/ylTpBpLVvbXd7F+yV3PYhIegVOIbe4 3J8AjEw9y8QPmwRQeSdiRvkbE/S9SZ1OdlMOV4biwDAk8UMiHivjw6nBBtMWmkxlzPj3 BnWW13DQ+od/OHItIht2ier5RHEmiNTmBpp4TQMTFJ5n2YOmza0FATIkfQxHMHQd3NjE OKdQ== X-Gm-Message-State: ALyK8tL8oHmyUp+enSn/iVqB+FK3mnIx7U5PPVMKYY5UJqRtXc/mj9m3xZdF5PgFVZO2NF0IhlXqHQx8W461OQ== X-Received: by 10.36.51.15 with SMTP id k15mr6528027itk.80.1465059969232; Sat, 04 Jun 2016 10:06:09 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.36.113.3 with HTTP; Sat, 4 Jun 2016 10:06:08 -0700 (PDT) In-Reply-To: <20160603165144.17356-6-toke@toke.dk> References: <20160603165144.17356-1-toke@toke.dk> <20160603165144.17356-6-toke@toke.dk> From: Adrian Chadd Date: Sat, 4 Jun 2016 10:06:08 -0700 X-Google-Sender-Auth: -mQ4wQDY7QVUmfeO5t95_mi4eDs Message-ID: To: =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= Cc: "linux-wireless@vger.kernel.org" , make-wifi-fast@lists.bufferbloat.net, ath9k-devel Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Make-wifi-fast] [RFC/RFT 5/5] ath9k: Count RX airtime in airtime deficit 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: Sat, 04 Jun 2016 17:06:10 -0000 hi, I've been working on something similar in freebsd, so cool to see this happening here! The only thing missing atm is STBC and LDPC. My RX airtime code looks basically like this one too; but I have TODO items for ensuring LDPC/STBC calculations are sane. -adrian On 3 June 2016 at 09:51, Toke H=C3=B8iland-J=C3=B8rgensen wr= ote: > This adds RX airtime to the airtime deficit used in the scheduler. This > is not a definite win, but I have only done very limited testing where > it has been included. Feel free to skip this patch when testing. > > Signed-off-by: Toke H=C3=B8iland-J=C3=B8rgensen > --- > drivers/net/wireless/ath/ath9k/recv.c | 51 +++++++++++++++++++++++++++++= +++++- > 1 file changed, 50 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless= /ath/ath9k/recv.c > index 7eb8980..23d6ebe 100644 > --- a/drivers/net/wireless/ath/ath9k/recv.c > +++ b/drivers/net/wireless/ath/ath9k/recv.c > @@ -991,6 +991,55 @@ static void ath9k_apply_ampdu_details(struct ath_sof= tc *sc, > } > } > > +static void ath_rx_count_airtime(struct ath_softc *sc, > + struct ath_rx_status *rs, > + struct sk_buff *skb) > +{ > + struct ath_node *an; > + struct ieee80211_hdr *hdr =3D (struct ieee80211_hdr *) skb->data; > + struct ath_hw *ah =3D sc->sc_ah; > + struct ath_common *common =3D ath9k_hw_common(ah); > + struct ieee80211_sta *sta; > + struct ieee80211_rx_status *rxs; > + const struct ieee80211_rate *rate; > + bool is_sgi, is_40, is_sp; > + int phy; > + u32 airtime =3D 0; > + > + if (!ieee80211_is_data(hdr->frame_control)) > + return; > + > + rcu_read_lock(); > + > + sta =3D ieee80211_find_sta_by_ifaddr(sc->hw, hdr->addr2, NULL); > + if (!sta) > + goto exit; > + an =3D (struct ath_node *) sta->drv_priv; > + rxs =3D IEEE80211_SKB_RXCB(skb); > + > + is_sgi =3D !!(rxs->flag & RX_FLAG_SHORT_GI); > + is_40 =3D !!(rxs->flag & RX_FLAG_40MHZ); > + is_sp =3D !!(rxs->flag & RX_FLAG_SHORTPRE); > + > + if (!!(rxs->flag & RX_FLAG_HT)) { > + /* MCS rates */ > + > + airtime +=3D ath_pkt_duration(sc, rxs->rate_idx, rs->rs_d= atalen, > + is_40, is_sgi, is_sp); > + } else { > + > + phy =3D IS_CCK_RATE(rs->rs_rate) ? WLAN_RC_PHY_CCK : WLAN= _RC_PHY_OFDM; > + rate =3D &common->sbands[rxs->band].bitrates[rxs->rate_id= x]; > + airtime +=3D ath9k_hw_computetxtime(ah, phy, rate->bitrat= e * 100, > + rs->rs_datalen, rxs->rate= _idx, is_sp); > + } > + > + an->airtime_deficit -=3D airtime; > + ath_debug_airtime(sc, an, airtime, 0); > +exit: > + rcu_read_unlock(); > +} > + > int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) > { > struct ath_rxbuf *bf; > @@ -1137,7 +1186,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush,= bool hp) > ath9k_antenna_check(sc, &rs); > ath9k_apply_ampdu_details(sc, &rs, rxs); > ath_debug_rate_stats(sc, &rs, skb); > - ath_debug_rx_airtime(sc, &rs, skb); > + ath_rx_count_airtime(sc, &rs, skb); > > hdr =3D (struct ieee80211_hdr *)skb->data; > if (ieee80211_is_ack(hdr->frame_control)) > -- > 2.7.4 > -- > To unsubscribe from this list: send the line "unsubscribe linux-wireless"= in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html