From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10E3FC433EF for ; Thu, 2 Jun 2022 20:59:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237164AbiFBU7n (ORCPT ); Thu, 2 Jun 2022 16:59:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229520AbiFBU7n (ORCPT ); Thu, 2 Jun 2022 16:59:43 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F38DB12AD3 for ; Thu, 2 Jun 2022 13:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1654203582; x=1685739582; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=rPb7XF5GCjQMEUYiYoxIPi2IouI35teuwJMrZ200egU=; b=uB7MP57D6ohSJ/OG4KsNIwapYn6/xcMn8n0VEkDqwf9LqfLoWklvOsy5 loSMTCKFaer6stb2pMw47vC8hdH6iOsGRx+s8qpTWfafPEO01sCAvX2DD +SZ9BLrlIHM3D7Lw9Z8deAAr2MpJRzXk33ND/BfxVF4tOaV90xVpFwC1Q U=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 02 Jun 2022 13:59:42 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2022 13:59:41 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 2 Jun 2022 13:59:41 -0700 Received: from [10.110.9.238] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 2 Jun 2022 13:59:39 -0700 Message-ID: <6fe32a06-a960-3a77-37fd-bc51af1b4c4f@quicinc.com> Date: Thu, 2 Jun 2022 13:59:38 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [RFC v2 76/96] cl8k: add stats.c Content-Language: en-US To: , CC: Kalle Valo , "David S . Miller" , Jakub Kicinski , Aviad Brikman , Eliav Farber , "Maksym Kokhan" , Oleksandr Savchenko , Shay Bar References: <20220524113502.1094459-1-viktor.barna@celeno.com> <20220524113502.1094459-77-viktor.barna@celeno.com> From: Jeff Johnson In-Reply-To: <20220524113502.1094459-77-viktor.barna@celeno.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 5/24/2022 4:34 AM, viktor.barna@celeno.com wrote: [snip] > +static void _cl_stats_update_tx(struct cl_hw *cl_hw, struct cl_sta *cl_sta, > + struct cl_agg_tx_report *agg_report) > +{ > + struct cl_stats *stats = cl_sta->stats; > + struct cl_tx_cntrs *cntrs; > + union cl_rate_ctrl_info rate_ctrl_info = { > + .word = le32_to_cpu(agg_report->rate_cntrl_info)}; > + u8 bw, nss, mcs, gi, bf; > + > + switch (rate_ctrl_info.field.format_mod) { > + case WRS_MODE_HE: > + nss = (rate_ctrl_info.field.mcs_index >> 4); > + mcs = (rate_ctrl_info.field.mcs_index & 0xF); > + gi = rate_ctrl_info.field.gi; > + > + { why an embedded block? seems to serve no purpose > + bw = rate_ctrl_info.field.bw; > + bf = agg_report->bf; > + > + cntrs = &stats->tx.he[bw][nss][mcs][gi][bf]; bad indentation > + } > + break; > + case WRS_MODE_VHT: > + bw = rate_ctrl_info.field.bw; > + nss = (rate_ctrl_info.field.mcs_index >> 4); > + mcs = (rate_ctrl_info.field.mcs_index & 0xF); > + gi = rate_ctrl_info.field.gi; > + bf = agg_report->bf; > + > + cntrs = &stats->tx.vht[bw][nss][mcs][gi][bf]; bad indentation > + break; > + case WRS_MODE_HT: > + bw = rate_ctrl_info.field.bw; > + nss = (rate_ctrl_info.field.mcs_index >> 3); > + mcs = (rate_ctrl_info.field.mcs_index & 0x7); > + gi = rate_ctrl_info.field.gi; > + cntrs = &stats->tx.ht[bw][nss][mcs][gi]; > + break; > + case WRS_MODE_OFDM: > + mcs = rate_ctrl_info.field.mcs_index - RATE_CTRL_OFFSET_OFDM; > + cntrs = &stats->tx.ofdm[mcs]; > + break; > + case WRS_MODE_CCK: > + mcs = rate_ctrl_info.field.mcs_index; > + cntrs = &stats->tx.cck[mcs]; > + break; > + default: > + return; > + }