From patchwork Tue Aug 20 17:53:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13770522 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94E3EC531DC for ; Tue, 20 Aug 2024 17:55:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=iauch5809aYw0zcKrq/ncZUeuHwbewH9i2gZIKc7qnY=; b=x/qzoxZ9qdAvot5JMHUwK+UXVo QFJ46zUnZWLL/G8Lkhm48domDQhrUcipDN+lTFCfHjBRA5pPr2L0632XtuoAsNHV3vEvu5VSjWUfN hliYy5zQ8OeHKuwmKRBPGEaYlh0Qik/MsxK7rF24U/QsH7S9Sy9WyzokEyAQr9Erj3qT61mnGsjZq DgzcYONYHiyRHhz6njZikJH5rizXd9njMT/j8FLOfb9wCajvo2tumWyeTChF3fgUZta5BVI08A8Ta elCiL9Rqgr1ArzjBnJRQs1AS3+1ifhyaZSsrG0XV7v/Cfgqolle0ObjQh5ILfi2HOQY6Ov/fydSm1 ZLDKYR6Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgT4C-00000006EzR-1vYF; Tue, 20 Aug 2024 17:54:48 +0000 Received: from out-184.mta1.migadu.com ([2001:41d0:203:375::b8]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgT3U-00000006EoC-05BP for linux-arm-kernel@lists.infradead.org; Tue, 20 Aug 2024 17:54:06 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1724176441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=iauch5809aYw0zcKrq/ncZUeuHwbewH9i2gZIKc7qnY=; b=OxXx2w6Ly9sbN1gs6iqprEn6klo8+nLRZnaJQG4zeqjNn7ZTUUnx65DH2bvaYeXFzxExak MwdYwdHlJiFNRrSfOIQOSXCEl+WhYyQC/5G57+jVqsQQooOR0AAEkJhcYlJOCHqGj+oAaB O9DKQBSNoxK/vRpaZVhZ4cKaVR5M+K4= From: Sean Anderson To: Andrew Lunn , Radhey Shyam Pandey , netdev@vger.kernel.org Cc: Michal Simek , linux-kernel@vger.kernel.org, Russell King , "David S . Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , Simon Horman , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH net-next v4 0/2] net: xilinx: axienet: Add statistics support Date: Tue, 20 Aug 2024 13:53:40 -0400 Message-Id: <20240820175343.760389-1-sean.anderson@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240820_105404_433189_AB40EC74 X-CRM114-Status: UNSURE ( 8.51 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for hardware statistics counters (if they are enabled) in the AXI Ethernet driver. Unfortunately, the implementation is complicated a bit since the hardware might only support 32-bit counters. Changes in v4: - Reduce hw_last_counter to u32 to ensure we use (wrapping) 32-bit arithmetic. - Implement get_ethtool_stats for nonstandard statistics - Rebase onto net-next/main Changes in v3: - Use explicit mutex_lock/unlock instead of guard() in __axienet_device_reset to make it clear that we need to hold lp->stats_lock for the whole function. Changes in v2: - Switch to a seqlock-based implementation to allow fresher updates (rather than always using stale counter values from the previous refresh). - Take stats_lock unconditionally in __axienet_device_reset - Fix documentation mismatch Sean Anderson (2): net: xilinx: axienet: Report RxRject as rx_dropped net: xilinx: axienet: Add statistics support drivers/net/ethernet/xilinx/xilinx_axienet.h | 85 +++++ .../net/ethernet/xilinx/xilinx_axienet_main.c | 327 +++++++++++++++++- 2 files changed, 408 insertions(+), 4 deletions(-)