From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 894323B2A4 for ; Tue, 1 Oct 2019 05:09:35 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1569920975; 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=Ey2S05y+qH9qcmtAVhMGP0PZwCwz3gwo0pP+/KPv2RA=; b=hbxc8FrdZJcNJnlgWq0nni/PtJGRtakq9eg+Nh2T1f3W+Upvq1jLcR+e53eHurg6DvkoKg dlZYmMwkDODNrt1/jFxiZ2fb48U74Y3d0UjMvOQfpWcpCpF+vt0wr4iDisRL3tGruANgsk 8JCjF15iGWZogiaTJIR2/Ys1aF98WWo= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-344-YNFP_1t-MBipiyxY5cxZlg-1; Tue, 01 Oct 2019 05:09:33 -0400 Received: by mail-ed1-f71.google.com with SMTP id n12so8146449edr.22 for ; Tue, 01 Oct 2019 02:09:33 -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:content-transfer-encoding; bh=wlyXXImOIp1mcAi7TD8GXAiJ2gSaRKFmxGZ/4rWjOZk=; b=d9ASYcOcFTSE6H1oxs0yskGyFTHlRqY9Vv+xmKW8xiSiVe/iZroiJFXfannVT7w+nQ QwnVw/gnkJ2xAB/bD68LQnk8wGvBEpt/LJG0sl8Ac6XIi44ARVP4rN0ihLBTKbfR8Rsc GLxAfJvxw4AYMAXYupBJaWIlJdxPlos+WF5clq9Jy1RlaryznFGQBq8thP1pEtdpHhqf 97UnNpPNly8o5VqzGbpdtzrch4qKXpI73eGsfpvMg/zRS4bTo93YR5t/vRumOanHvHUn jYIg9CFBRRlNAH+6JSBaJJ85+vfFroVu/9OzKYexg+Ka23lurBz6QOMsiqOPo7q2utP/ nQVQ== X-Gm-Message-State: APjAAAW9xOzCtaSD3OlrNYSbYixTEaiuH6oNFAU3I9s9A67BdmDKqUlA aJMoXBSBHajNR4t+I4HIGuo+YfVLrcDMP40japfTJSBfLUSRb2iu4b5tuK7VfarXBehz7Vgebym QIQXVmM40g6nzoOcCGSFfORm2CWd7vd5NjOM= X-Received: by 2002:aa7:d789:: with SMTP id s9mr24215872edq.62.1569920971872; Tue, 01 Oct 2019 02:09:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCqH9jlzfDumYbdUArITAjkR/o1V5EP9TaHmmbcp6BHtfMgQprpm+eLJx+fRgaiLD0rIE/BQ== X-Received: by 2002:aa7:d789:: with SMTP id s9mr24215867edq.62.1569920971722; Tue, 01 Oct 2019 02:09:31 -0700 (PDT) Received: from alrua-x1.borgediget.toke.dk (borgediget.toke.dk. [85.204.121.218]) by smtp.gmail.com with ESMTPSA id u27sm3018104edb.48.2019.10.01.02.09.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2019 02:09:31 -0700 (PDT) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id B4F9118063D; Tue, 1 Oct 2019 11:09:30 +0200 (CEST) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Johannes Berg Cc: linux-wireless@vger.kernel.org, make-wifi-fast@lists.bufferbloat.net, John Crispin , Lorenzo Bianconi , Felix Fietkau In-Reply-To: <2518c49c96b8b5233fabcb8bafccba6b8f3155bf.camel@sipsolutions.net> References: <156889576422.191202.5906619710809654631.stgit@alrua-x1> <156889576646.191202.14461472477971784776.stgit@alrua-x1> <2518c49c96b8b5233fabcb8bafccba6b8f3155bf.camel@sipsolutions.net> X-Clacks-Overhead: GNU Terry Pratchett Date: Tue, 01 Oct 2019 11:09:30 +0200 Message-ID: <87sgocvnlh.fsf@toke.dk> MIME-Version: 1.0 X-MC-Unique: YNFP_1t-MBipiyxY5cxZlg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Make-wifi-fast] [PATCH RFC/RFT 2/4] mac80211: Add API function to set the last TX bitrate for a station 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: Tue, 01 Oct 2019 09:09:35 -0000 Johannes Berg writes: > On Thu, 2019-09-19 at 14:22 +0200, Toke H=C3=B8iland-J=C3=B8rgensen wrote= : > > Given a ULL constant: > >> +/* constants for calculating reciprocals to avoid division in fast path= */ >> +#define IEEE80211_RECIPROCAL_DIVISOR 0x100000000ULL > > [...] > >> +void ieee80211_sta_set_last_tx_bitrate(struct ieee80211_sta *pubsta, >> +=09=09=09=09 u32 rate) >> +{ >> +=09struct sta_info *sta =3D container_of(pubsta, struct sta_info, sta); >> + >> +=09sta->last_tx_bitrate =3D rate; >> +=09sta->last_tx_bitrate_reciprocal =3D ((u64)IEEE80211_RECIPROCAL_DIVIS= OR / rate); > > that cast seems unnecessary? Yeah. I only remembered to make it a ULL constant later, and forgot to remove the cast. But I guess this should be using do_div() anyway... -Toke