Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1904279rwl; Thu, 30 Mar 2023 03:13:25 -0700 (PDT) X-Google-Smtp-Source: AKy350azFFWo4C4fgXfCQv+TYSXhnL0FtYcFfykMG9myqfUlJgPzMiIi9Z98jX/C6LXNW+gBxlzp X-Received: by 2002:a17:906:280e:b0:947:46e0:9e4f with SMTP id r14-20020a170906280e00b0094746e09e4fmr1969235ejc.3.1680171204978; Thu, 30 Mar 2023 03:13:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680171204; cv=none; d=google.com; s=arc-20160816; b=ydMIvYxSa+LOrHQMkCZrAUW2aq5TIWHFrlJvBGLjfJ85h7wy0Xv23XH6WrnnOxr1V4 x5UStVZGlvYAEqqD9k/5M8E5p3mdKt57lueY2lC9BlOvCKGRCMGTq8HmqwPDRqnWMiHH 7qAWLNsqasfSmR8gO/whKWavDx0XXEMFs7pSRh6Lffvzb54ZB+pmlhxp+Ms1myyW9uQn suOPwCF065bzgHbvuUnwqcHX+SWON0vAIsZWGCpG8JtPQeJndC0ZAjyT6Z5hYML14wJ8 aWT1spV1KcHVjhOjlroxTJowVnAL4AlwIdhz/7KSAHGgAoADpLMTj0I+dfAghPWi7cY6 qUsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=JfFJZNchjeMN1TQ8MGFZliQJTBtxtlbHA0I4GjdbyTQ=; b=tjTjfo2jaPtgiKa71//8ylvKYYf7+Yf79Ph60bpdyIlgzMMvSHvGLGJSwHnJnyrdVq HvFYTRu3nijW8kgVjPPrrLp+o614lK92ArrujgFcdv52timM0Ciocpl5ViOF4uRqec/T ac0kcar0HwL4f3OyijKNJIz7CaPYH1DAaZZxNlOlj4xGRwbqof5zfP8tqu1uIGnKFmff VHIMre+YTdDhVyDVip4X0JU5E2KtZhqv8nXO9LgkEw8vKQv9TjqNYHWfmM+DEOa3b+Iu e0Emmt0SS96EumgLVOb4dpUGl8PvPQlxPhY3kooHxEUcrHPerCEgYrpDt+1i4NzRLopD Vp0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=lUwWyOUJ; 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; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lc17-20020a170906f91100b009314e27809esi38375582ejb.116.2023.03.30.03.13.09; Thu, 30 Mar 2023 03:13:24 -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=pass header.i=@sipsolutions.net header.s=mail header.b=lUwWyOUJ; 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; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230504AbjC3KGf (ORCPT + 59 others); Thu, 30 Mar 2023 06:06:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231146AbjC3KGd (ORCPT ); Thu, 30 Mar 2023 06:06:33 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B80A7689 for ; Thu, 30 Mar 2023 03:06:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=JfFJZNchjeMN1TQ8MGFZliQJTBtxtlbHA0I4GjdbyTQ=; t=1680170792; x=1681380392; b=lUwWyOUJif+53aGo0m0FoC/snCOORVoeFLjDOV0RgWPSi9d jNUGF+uc8Iw4WzGqOSSGnpRo6WVdCYr+Q8faPyU8gxEBoBgQ4U8otPjRWA5HSWAR5f+dZJZvhLK5d KZqD0PMN+X8OCb7GCoGj4uSdjxuo14skDIhLnTqwC9F9vyRF+Km5MFp0WZzzwpen7IEea2qiU1gBs WsaJiR9/IRvzuWAi43bBDkqK85Bhe2wCNxTbRZWMLTGo4oQY31aWlrblSbZjCRAbFE7wo1xohpPUo rUruKgqAdqa7BPZJR33ivLmpUWeHj43RZjfEBMdcorD6w9kGZ0BUY3SpWrbv7ueA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1phpAs-000yop-17; Thu, 30 Mar 2023 12:06:30 +0200 Message-ID: <78fc12945f0f4ed90836e9031fd18d95a8c473a8.camel@sipsolutions.net> Subject: Re: [PATCH] wifi: mac80211: Initialize EWMA fail avg to 1 From: Johannes Berg To: Karthik M Cc: linux-wireless@vger.kernel.org, Tamizh Chelvam Raja Date: Thu, 30 Mar 2023 12:06:29 +0200 In-Reply-To: <20230317144432.10477-1-quic_karm@quicinc.com> References: <20230317144432.10477-1-quic_karm@quicinc.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 X-malware-bazaar: not-scanned X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 Fri, 2023-03-17 at 20:14 +0530, Karthik M wrote: > If the average value has been rounded to 0 (success), > reset it to the smallest nonzero value (similarly to the initialization) = to > avoid a case where a single failure would result in an average value > that goes beyond the threshold value of 95. What does 95 have to do with it? Also the whole commit message doesn't even mention mesh a single time. > Signed-off-by: Tamizh Chelvam Raja > Signed-off-by: Karthik M > --- > net/mac80211/mesh_hwmp.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) >=20 > diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c > index 9b1ce7c3925a..e9fcaff9cc7e 100644 > --- a/net/mac80211/mesh_hwmp.c > +++ b/net/mac80211/mesh_hwmp.c > @@ -298,10 +298,21 @@ void ieee80211s_update_metric(struct ieee80211_loca= l *local, > { > struct ieee80211_tx_info *txinfo =3D st->info; > int failed; > + u32 fail_avg; > struct rate_info rinfo; > =20 > failed =3D !(txinfo->flags & IEEE80211_TX_STAT_ACK); > =20 > + fail_avg =3D ewma_mesh_fail_avg_read(&sta->mesh->fail_avg); > + if (!fail_avg) { > + /* If the average value has been rounded to 0 (success),=20 > + * reset it to the smallest nonzero value (similarly to=20 > + * the initialization) to avoid a case where a single=20 > + * failure would result in an average value that goes=20 > + * beyond the threshold value of 95 */ Comment style, trailing whitespace ... please run at least some kind of checkpatch yourself. johannes