Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp83756rdg; Wed, 11 Oct 2023 22:21:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQL4XCeKAAZ2budw+8AOYwZp7vOL9wmG2FQ6T3xf7fNFuFo+U3ubR/jM2YADtEfIvpFr7v X-Received: by 2002:a05:6a20:7d85:b0:137:c971:6a0c with SMTP id v5-20020a056a207d8500b00137c9716a0cmr28316456pzj.31.1697088116619; Wed, 11 Oct 2023 22:21:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697088116; cv=none; d=google.com; s=arc-20160816; b=voPExJmFM0VImxkyDPDkRgunssogc7r35fV8+l91Q17lDgf7HjLNySnPaMOu3EVL/k PTmDVsMLf8lDIhlIjx5kSt+gal2HFO7CU9+qFfWvf68jWZq9APwS2Dp9oYJaBQPSAX0Y a4bYo1nZRAyG1809MMHv5UwvnLqz/GVBBU0Ll+mmGHVU79zoKUDHAyQSw/TKszMJ3XM9 eqaF2Q6qVh2t6jperKRi3A2aOnwV16xn8/y5FdXixT7nPo0EHIVXyI6i4C/Ljpc2CU9D VCoDBng4ucJyubmBYueP6GNOnT4YZYoaHefmAQNZUoAJwBH57vExqbGApOUGaSgQFBFF 1TAw== 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=mzJ6mczws2V1o12NE3ALNTxfbB/dSlBF4vOrX568DzU=; fh=k91SU9KDaW5F7m4w67l2cRFyEX/M4SsnTSj714RjakY=; b=w2QvgJG0UR8L6FG+tUj5ltouHpgIA3W00LBjbegw/hGYkIEzEOVl3P9Ev2pPbP+pCv luHN1In3KNIfFzePfuPw7eE9bBysbrAcRpL9gMj9mmibemRHc1uN/Dohnfu9p+QhBe5y O1I6CyY5qiIR4+zdKPN3DFYEj8yNKIeBR7rC33kM3cMDxJknOklf5HaELbP3nwWW8m6A Fppm2hv1CoWN7lHEiKKvMeJAOXJbaTeHkOtN/YRt8KdUfCQs3MCtsNcYkfwykfRNovH/ S5VElQZVUC0HXGYfKgz+l/t10rFQ2tDfM7SWQw8wPkVVuMPPCFa2fimxrSFD/vb4jv74 wEvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Jx0wdWGi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id c2-20020a631c02000000b005859eba7939si1387194pgc.20.2023.10.11.22.21.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 22:21:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Jx0wdWGi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 2F68480A802B; Wed, 11 Oct 2023 22:21:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377111AbjJLFVb (ORCPT + 99 others); Thu, 12 Oct 2023 01:21:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233879AbjJLFV3 (ORCPT ); Thu, 12 Oct 2023 01:21:29 -0400 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E7B590; Wed, 11 Oct 2023 22:21:28 -0700 (PDT) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 39C5LHCN051170; Thu, 12 Oct 2023 00:21:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1697088077; bh=mzJ6mczws2V1o12NE3ALNTxfbB/dSlBF4vOrX568DzU=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=Jx0wdWGinDG26kPvuiEwfOJty21+RPavdxMGn/hEds6NkWc9u5FaNSufX6gdhTSRF g1b5GCiW92huGNJhviPjw8fOiIOXOJGoT4UisxtduyFvlQICFVZ9+ZFHZbzvL4Cxar RC8CC4JT7IJuyVk98I/3G9HyYwYTL1PDBRsyyy/w= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 39C5LHfM073317 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 12 Oct 2023 00:21:17 -0500 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 12 Oct 2023 00:21:17 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 12 Oct 2023 00:21:17 -0500 Received: from [10.24.69.31] (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 39C5LCIS092468; Thu, 12 Oct 2023 00:21:13 -0500 Message-ID: <7b5f195f-c5c8-6847-9458-3d5563cf0112@ti.com> Date: Thu, 12 Oct 2023 10:51:12 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH] net: ti: icssg-prueth: Fix tx_total_bytes count Content-Language: en-US To: Andrew Lunn CC: Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , , , , Vignesh Raghavendra , , Roger Quadros References: <20231011063700.1824093-1-danishanwar@ti.com> <4d7c2ab9-e980-42a5-9452-79bc0d33e094@lunn.ch> From: MD Danish Anwar In-Reply-To: <4d7c2ab9-e980-42a5-9452-79bc0d33e094@lunn.ch> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 11 Oct 2023 22:21:54 -0700 (PDT) Hi Andrew, On 11/10/23 18:11, Andrew Lunn wrote: >> @@ -29,7 +30,12 @@ void emac_update_hardware_stats(struct prueth_emac *emac) >> base + icssg_all_stats[i].offset, >> val); >> >> + if (!strncmp(icssg_ethtool_stats[i].name, "tx_good_frames", ETH_GSTRING_LEN)) >> + tx_pkt_cnt = val; > > Doing a strncmp seems very expensive. Could you make use of > icssg_stats.offset? > Sure. I can define the offset of these two stats and then use them in if condition as below. #define ICSSG_TX_PACKET_OFFSET 0xA0 #define ICSSG_TX_BYTE_OFFSET 0xEC if (icssg_ethtool_stats[i].offset == ICSSG_TX_PACKET_OFFSET) tx_pkt_cnt = val; if (icssg_ethtool_stats[i].offset == ICSSG_TX_BYTE_OFFSET) emac->stats[i] -= tx_pkt_cnt * 8; Pls let me know if this looks OK. > Andrew -- Thanks and Regards, Danish