Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8021359ybn; Tue, 1 Oct 2019 01:48:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwhDY2nCQ1NNDw25yaptXt+RJrLC3ewQ3Y3sHg8xqxbwZbXtUwcFNlyGTE3PW11owSKacP X-Received: by 2002:a50:d090:: with SMTP id v16mr24347308edd.176.1569919689586; Tue, 01 Oct 2019 01:48:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569919689; cv=none; d=google.com; s=arc-20160816; b=RJs92VQUQEbwabn66Bo32PmgcIa9llC3GiqkOmnvtcB+dE4Oz+DTmABQMYSYN2c4iG ytHFsEcq+GLJ9feA6A3tHloQdMVB7DgaIkCTbFCgY+coxUY/lVYYYKQLQThGzE7iGJHP JC8riHkpv5/oIQaz6qgDgDecGFpN/l7QxsOLRIi5VsduU2UX2tJCn832iHGQBvBPdQoo Wst7RzB2afkdkL9gOODnZP608DMERUYJasikcW8OgsI4DSKry7djpABJ46SP7w+6DpSq Bgu9O9LI5vslajxxfIWUGJBEYjvz73285bFMNswsUL1ZdeZlcT6bUJjcxKuoBxGVf3T+ HQRw== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=zwrbSPirTk3TXMqDG1NUG7CfyzskPoPMPemEW5xb2Vo=; b=HBN3/U16Evoq5bcOxOP+5gNUjF52E+V4a6C6rBL1xy7iR6LrdB9zvKdl99vq+V1CJP SF1obeLLCzGOojuXFJn2j0dq2JGtQOsHuN8hfIVWdLogejk7fbyWhgwWE7vPrB1VT3Cl pmUmcADpmf5qBc5cwaVSbK6H0kdSavkW7Oab41QuE0XJdbKqzAtpVP94Ccll/BOKVmOS p4J7CM37Dt1aNjtQwJpf19jT2xFY0dFLuHAqb1IUJk/2Vf0yaoo+OuioWCRrcJ6H8TxI R1F7m2D/Z87S964qi7ZZ2BHaPn1aBcoyiO5GgZcNaSI+IJcQR/vffN30pvCRweTOt8ws eoxA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q22si8298576eja.178.2019.10.01.01.47.44; Tue, 01 Oct 2019 01:48:09 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733040AbfJAIqd (ORCPT + 99 others); Tue, 1 Oct 2019 04:46:33 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:57164 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726148AbfJAIqc (ORCPT ); Tue, 1 Oct 2019 04:46:32 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.92.2) (envelope-from ) id 1iFDnj-0002fZ-AY; Tue, 01 Oct 2019 10:46:31 +0200 Message-ID: <2518c49c96b8b5233fabcb8bafccba6b8f3155bf.camel@sipsolutions.net> Subject: Re: [PATCH RFC/RFT 2/4] mac80211: Add API function to set the last TX bitrate for a station From: Johannes Berg To: Toke =?ISO-8859-1?Q?H=F8iland-J=F8rgensen?= Cc: linux-wireless@vger.kernel.org, make-wifi-fast@lists.bufferbloat.net, John Crispin , Lorenzo Bianconi , Felix Fietkau Date: Tue, 01 Oct 2019 10:46:30 +0200 In-Reply-To: <156889576646.191202.14461472477971784776.stgit@alrua-x1> References: <156889576422.191202.5906619710809654631.stgit@alrua-x1> <156889576646.191202.14461472477971784776.stgit@alrua-x1> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Thu, 2019-09-19 at 14:22 +0200, Toke Høiland-Jørgensen 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, > + u32 rate) > +{ > + struct sta_info *sta = container_of(pubsta, struct sta_info, sta); > + > + sta->last_tx_bitrate = rate; > + sta->last_tx_bitrate_reciprocal = ((u64)IEEE80211_RECIPROCAL_DIVISOR / rate); that cast seems unnecessary? johannes