From patchwork Thu Aug 15 14:40:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13764841 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 B9F4AC52D7C for ; Thu, 15 Aug 2024 14:42:10 +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=ay0ClSUBYnrL9R9xZ0n3GEdh4ukn5Baj+mckgzUBt9w=; b=HWLlHqyw6/i23QdXbjypLeXuet KT6/cR1aH4ULUED4RjB6MqSljQSr9ePzInzVhWJJDvLU/fLcGJfysSTacR5zIKH2oIziVgVtJkR8B GBVYdR4RWkAVvh91f3+GIurmJ/Rk6bKlHHZadg0tyxow/QyiEs6VPTJnX+TCHaUcC7ukLU3bmUBRZ RvbTl+t2TFHTCiGq1wsyz9tsQLnQT57C+H65rhxCwdpYu+aQ8xLIO8yqzZd4huY1yVhKD5gZmKQgC L6TpovZWT1GxuJWCOsHFg9hJkKxbbJy2raZfzupBDMNwNUH9xNgD3EHIrTkCXFWdBb3ZnfXSsmGOt GM4dGdig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sebfi-0000000AFIE-0Ced; Thu, 15 Aug 2024 14:41:50 +0000 Received: from out-173.mta1.migadu.com ([95.215.58.173]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sebf0-0000000AF8Q-3zSi for linux-arm-kernel@lists.infradead.org; Thu, 15 Aug 2024 14:41:11 +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=1723732858; 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=ay0ClSUBYnrL9R9xZ0n3GEdh4ukn5Baj+mckgzUBt9w=; b=UTCZV5e1GHZP1xMpztYb/kaTB+GD/ngmi45Cn8lzOsZM82QpyQk5rfnotQu7R27jFAOu3o NFnQZISEVRCN1XC2coPUHLMOKCT5lrzgQ9s01/YXs7lnoKSoAS/vf9iIWBded2THZC6XGt DY6J3GdAskESASUwuWMvcG7JbYuCDu0= From: Sean Anderson To: Andrew Lunn , Radhey Shyam Pandey , netdev@vger.kernel.org Cc: Simon Horman , Jakub Kicinski , Michal Simek , linux-kernel@vger.kernel.org, "David S . Miller" , Russell King , linux-arm-kernel@lists.infradead.org, Eric Dumazet , Paolo Abeni , Sean Anderson Subject: [PATCH net-next v3 0/2] net: xilinx: axienet: Add statistics support Date: Thu, 15 Aug 2024 10:40:29 -0400 Message-Id: <20240815144031.4079048-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-20240815_074107_856632_CC4EF7F3 X-CRM114-Status: UNSURE ( 7.89 ) 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 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 | 267 +++++++++++++++++- 2 files changed, 348 insertions(+), 4 deletions(-)