Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp540126iol; Thu, 9 Jun 2022 08:41:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXvYXTth3kEHo9pqCOPd84cC5naMmpFESmFF/Q1PMQ0GvqI6irwAJqzo0Z33Zc99s6k2WG X-Received: by 2002:a63:8942:0:b0:3fc:ffa6:378c with SMTP id v63-20020a638942000000b003fcffa6378cmr31915427pgd.305.1654789319139; Thu, 09 Jun 2022 08:41:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654789319; cv=none; d=google.com; s=arc-20160816; b=CxGMLj9C/bJHLbHwqAPILbcWRg/ibvLTOM2RyohW2Dor/WPznhOB+ntrM/iUpELeG5 iu9Du3xd21V3DBZ869lGnlhViD2cQmnBvEnS3Za3Q2WU3EY4y70hcUvlZkO1Zbx0ZR/T rSURv+ipa6GHCXhCEBTogVUvjkzlZc/Oqdc9YFZ6n8EQ/AGCaSaqmszJfnc3GEihiFdL 8Eluz7P2iPK7QML9qfyNQbkeqK0B2kPmA6ImjPpL8SCT0oMS2cLiKAXFHGPG/MRGqiJm Z46YHcjOb4VheWYIV/Fg6PVOm4DX44D3Wlyr0NB6w6uIqZuayhJLJ32YvUmoQZPnuzzB QTqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ualphzSRMcpR/j7yZ7iHbJPU8LTywlVVlmZmkrMSbfo=; b=PzQ2QKAH2KaoBDFC12Yrp52V3PPGMYeh2v+q7DoXwmHk+rvG+J9/6d5omjavgMtjz3 1WfzbQ8Kx0LTSqE4km/Njepo6xi4cIDn3AYQ0gVVJAf6LsdpYRZDeYEyPi8wCGI+tdt4 fxMEiSkCFoa+XuhjDskc8Jh4gNgIbgzXka/uRwokpUquOFPI/T3bdfzy1LOYf1JJwHR2 UjOEH3ytBq9DXlnABarMOSzdkExcPBNBRp2XyaFyc5v9Na+K9Sm2yYdX02br0ZWYDu9Y W1LUEFoJqrdem08xUREosDEWn8hn9h6ako9lEGMN5GnC+EInoqRNuOPYdWd3OHZXdQmk WFjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b="MipUN/50"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v4-20020a17090a898400b001e2e267a475si29468097pjn.129.2022.06.09.08.41.45; Thu, 09 Jun 2022 08:41:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b="MipUN/50"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237328AbiFIPdH (ORCPT + 66 others); Thu, 9 Jun 2022 11:33:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236999AbiFIPdG (ORCPT ); Thu, 9 Jun 2022 11:33:06 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 775764F1D3 for ; Thu, 9 Jun 2022 08:33:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ualphzSRMcpR/j7yZ7iHbJPU8LTywlVVlmZmkrMSbfo=; b=MipUN/50ltFUqY8mp+LPlhoHHj vNfXsbPRdMen90wHEMz1Shy1R+On9RtaggN6HpYw7z8JtuYP6nr6MH9W/Wy5JIJeRA1NnpTHvzKfC IzLioZzEE3H4KjOrOS2lFKJMPJdAEMwoxOmRhUo6901h8bDCeHVygb5OEebut5ebktzw=; Received: from p57a6f999.dip0.t-ipconnect.de ([87.166.249.153] helo=nf.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1nzK9d-0002L1-U1; Thu, 09 Jun 2022 17:33:02 +0200 Message-ID: <1d7870e7-6b41-3eb6-910f-8df335b222bc@nbd.name> Date: Thu, 9 Jun 2022 17:33:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH 1/2] mac80211: fix overflow issues in airtime fairness code Content-Language: en-US To: =?UTF-8?Q?Toke_H=c3=b8iland-J=c3=b8rgensen?= , linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net References: <20220603164307.92189-1-nbd@nbd.name> <87bkv7owq1.fsf@toke.dk> From: Felix Fietkau In-Reply-To: <87bkv7owq1.fsf@toke.dk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 05.06.22 19:18, Toke Høiland-Jørgensen wrote: > Felix Fietkau writes: > >> The airtime weight calculation overflows with a default weight value of 256 >> whenever more than 8ms worth of airtime is reported. >> Bigger weight values impose even smaller limits on maximum airtime values. >> This can mess up airtime based calculations for drivers that don't report >> per-PPDU airtime values, but batch up values instead. >> >> Fix this by reordering multiplications/shifts and by reducing unnecessary >> intermediate precision (which was lost in a later stage anyway). >> >> The new shift value limits the maximum weight to 4096, which should be more >> than enough. Any values bigger than that will be clamped to the upper limit. >> >> Signed-off-by: Felix Fietkau > > The weights are UAPI, so I guess we could run into applications that > expect to be able to set a weight higher than 4096? I don't think this > is too likely, but maybe it is better to reject such attempts instead of > silently clamping the value, to flush out any breakage if it does occur? Will do this in v2. Thanks, - Felix