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 X-Spam-Level: X-Spam-Status: No, score=-11.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2F58C432BE for ; Thu, 26 Aug 2021 19:18:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AA83660EFE for ; Thu, 26 Aug 2021 19:18:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243458AbhHZTTK (ORCPT ); Thu, 26 Aug 2021 15:19:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:47282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243360AbhHZTTJ (ORCPT ); Thu, 26 Aug 2021 15:19:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 057F760F14; Thu, 26 Aug 2021 19:18:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630005502; bh=B835QYr8s3iNkwUIsABnoQUsWxamk2ZRljJXvabRXZs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Itcukwh7QIH0WuB1WXgjYdfyLMvlOJBZPIRx64AkNQbutn9RXtgssQxFi9JryJwJY rhCB9WJ4aPQ4nHm+ImiwYZeMZmZHczgm2eixD7/P8kBVZkmcKIMoysonCOYK1LFVUA B+Ve/H+Y27w2e9ba/4Ea9PLgTaswLPtBoN3ZIKNHCChluNPXwyiDxR02yYibS/+jsa uk0+DnjotjpSOaRdreVQS+D/qT4mzhWoxnv+K+KJwdLT0w6SBNFdFAY7s2rOnAmRrJ +jZkfV8vbTdWQ+PI18GMKJJFjf27KGwZZmxSVsqWjhYsgmwn6PAenhWtRQod4xMqDG UKCdYwPMCyoNg== Date: Thu, 26 Aug 2021 12:18:21 -0700 From: Jakub Kicinski To: Michael Chan Cc: David Miller , Netdev , olteanv@gmail.com Subject: Re: [PATCH net-next v3 2/3] bnxt: count packets discarded because of netpoll Message-ID: <20210826121821.2c926745@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: References: <20210826131224.2770403-1-kuba@kernel.org> <20210826131224.2770403-3-kuba@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, 26 Aug 2021 11:43:58 -0700 Michael Chan wrote: > On Thu, Aug 26, 2021 at 6:12 AM Jakub Kicinski wrote: > > @@ -10646,11 +10653,15 @@ static void bnxt_get_ring_stats(struct bnxt *bp, > > stats->multicast += BNXT_GET_RING_STATS64(sw, rx_mcast_pkts); > > > > stats->tx_dropped += BNXT_GET_RING_STATS64(sw, tx_error_pkts); > > + > > + bsw_stats->rx.rx_netpoll_discards += > > + cpr->sw_stats.rx.rx_netpoll_discards; > > Can we just add these rx_netpoll_discards counters directly to > stats->rx_dropped? It looks simpler if we do it that way, right? To make sure - are you saying that instead of adding struct bnxt_sw_stats sw_stats_prev; we should accumulate in net_stats_prev->rx_dropped, and have the ethtool counter only report the discards since last down/up? Or to use the atomic counter on the netdev and never report in ethtool (since after patch 3 rx_dropped is a mix of reasons)?