From nobody Sat Jun 13 21:03:18 2026 Received: from sender-pp-o93.zoho.in (sender-pp-o93.zoho.in [103.117.158.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7622C30148A; Sat, 13 Jun 2026 09:13:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=103.117.158.93 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781342019; cv=pass; b=iQPC4n4eJD+ZOGqzJ840UVQcJ1eAnzZ/f4GfEYzavNvjGAtbMEUyzTgxEHtbfozaL77GNwEbLUje0aAAkZ3dYgjRqZPb4qpcaynJAUhI+xOFhTgv6ky+JOi6DgegyDg0U8ZRpbjL9J4VEZcAc99UGrENQilDNRqlY/eyx8vJOXE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781342019; c=relaxed/simple; bh=68L0UCoky5sCWGnuMVtw9IqP+7EXAp4b0TZe2j0UuXA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Tx5tqLU2KH1Xa8A1j3NF91hBb4WAuaA8PlZn7UKjfhclB7Xs7XgHYcyOnPupkGVVxX0vIFq1gf1+pS4Ceq4pMUCPvxSl2FeXg3VB3FOYhHIFqQ7RSTF+C1qKY63gkOPybjqQ/WiOr1wzB7zULZjxUrR9xBOem6FpGzosKlshuhk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zohomail.in; spf=pass smtp.mailfrom=zohomail.in; dkim=pass (1024-bit key) header.d=zohomail.in header.i=kshitiz.bartariya@zohomail.in header.b=BurZEosn; arc=pass smtp.client-ip=103.117.158.93 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zohomail.in Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zohomail.in Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zohomail.in header.i=kshitiz.bartariya@zohomail.in header.b="BurZEosn" ARC-Seal: i=1; a=rsa-sha256; t=1781341965; cv=none; d=zohomail.in; s=zohoarc; b=GI0cK7iOX324VlGf3gasf8KvYCoHE3imxizSnBi9te0jH+xVqxBz/O7mfBXWXQmzllXAGgqWGDuq0bSKKvwwTIVzelNIqY92Ea1t7HqL4g+PhwP6T+LBssWULS0LQAOSmUmsuktNAF7qD6vAKEk47zKwjshTBdgfH7oqMMBLeKk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1781341965; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=3R0uW9DC3035/8HwJUTjPGnWNNQeGkU2lsxEtwrLprg=; b=KJuW+HLX08+iB7SbhIxZ0pMK2DtDtoq8DPlvGGeYflAth0RcU0MpV9rAbUcrENWQYkOaq3cY8ItkaGLUe8GPtsJlEpt0m3M8g3Fm0o+36yuk4SSCIaPetroQK8BhNYcw/TVVo3YOGILVuCy78uDd4MQrHKn2DgOEXGrSvOh16+s= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=zohomail.in; spf=pass smtp.mailfrom=kshitiz.bartariya@zohomail.in; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1781341965; s=zoho; d=zohomail.in; i=kshitiz.bartariya@zohomail.in; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=3R0uW9DC3035/8HwJUTjPGnWNNQeGkU2lsxEtwrLprg=; b=BurZEosnb29zD2RUGEJTH5Yx05mlQZFHTfTgAxVVqklehvdH/JGqW/vFUbcDbUdC 0nTDmPFqtNFzyOcUziKHoVUwt8UMLDO94EsRcBj3F7o3HGoyCR4h/MJilauUHvngzno gnvgaS3ZO/HuRFfzgLgzYV5Jq5ETRtX20YLrXxdQ= Received: by mx.zoho.in with SMTPS id 1781341958077868.0825005646292; Sat, 13 Jun 2026 14:42:38 +0530 (IST) From: Kshitiz Bartariya To: anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, jedrzej.jagielski@intel.com Cc: Kshitiz Bartariya , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v4] ixgbe: implement get_queue_stats_rx Date: Sat, 13 Jun 2026 14:42:26 +0530 Message-ID: <20260613091231.26601-1-kshitiz.bartariya@zohomail.in> X-Mailer: git-send-email 2.50.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" Hook into the netdev_stat_ops interface to expose per RX queue statistics through the netdev generic netlink API. The following counters are filled: - bytes: maps directly to bytes - packets: maps directly to packets - alloc_fail: sum of alloc_rx_page_failed and alloc_rx_buff_failed - csum_bad: maps directly to csum_err, which is incremented for both IP header and L4 checksum errors in ixgbe_rx_checksum(). The new per-queue stats can be observed with: $ ynltool qstats show scope queue Reviewed-by: Jedrzej Jagielski Signed-off-by: Kshitiz Bartariya --- v4: - Changed comment format from // to /* */ - Moved ixgbe_stat_ops declaration next to the ixgbe_netdev_ops Suggested by Jedrzej Jagielski. v3: - Added bytes and packets stats counters - Implemented ixgbe_get_base_stats function As suggested by AI on=20 https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260603174857.78666-1= -kshitiz.bartariya%40zohomail.in https://lore.kernel.org/lkml/20260612084605.19785-1-kshitiz.bartariya@zoho= mail.in/ v2: Amended commit message with command to get RX queue stats as=20 suggested by Jedrzej Jagielski. https://lore.kernel.org/lkml/20260603174857.78666-1-kshitiz.bartariya@zoho= mail.in/ v1:=20 https://lore.kernel.org/lkml/20260602100932.21838-1-kshitiz.bartariya@zoho= mail.in/ drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/et= hernet/intel/ixgbe/ixgbe_main.c index bc16e4c93fd4..67844e25af23 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -9759,6 +9759,30 @@ static void ixgbe_get_stats64(struct net_device *net= dev, stats->rx_missed_errors =3D netdev->stats.rx_missed_errors; } =20 +static void ixgbe_get_queue_stats_rx(struct net_device *dev, int idx, + struct netdev_queue_stats_rx *stats) +{ + struct ixgbe_adapter *adapter =3D ixgbe_from_netdev(dev); + struct ixgbe_ring *ring =3D adapter->rx_ring[idx]; + + stats->bytes =3D ring->stats.bytes; + stats->packets =3D ring->stats.packets; + stats->alloc_fail =3D ring->rx_stats.alloc_rx_page_failed + + ring->rx_stats.alloc_rx_buff_failed; + stats->csum_bad =3D ring->rx_stats.csum_err; +} + +static void ixgbe_get_base_stats(struct net_device *dev, + struct netdev_queue_stats_rx *rx, + struct netdev_queue_stats_tx *tx) +{ + /* ixgbe has no inactive queues */ + rx->bytes =3D 0; + rx->packets =3D 0; + rx->alloc_fail =3D 0; + rx->csum_bad =3D 0; +} + static int ixgbe_ndo_get_vf_stats(struct net_device *netdev, int vf, struct ifla_vf_stats *vf_stats) { @@ -11116,6 +11140,11 @@ static const struct net_device_ops ixgbe_netdev_op= s =3D { .ndo_hwtstamp_set =3D ixgbe_ptp_hwtstamp_set, }; =20 +static const struct netdev_stat_ops ixgbe_stat_ops =3D { + .get_queue_stats_rx =3D ixgbe_get_queue_stats_rx, + .get_base_stats =3D ixgbe_get_base_stats, +}; + static void ixgbe_disable_txr_hw(struct ixgbe_adapter *adapter, struct ixgbe_ring *tx_ring) { @@ -11662,6 +11691,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const = struct pci_device_id *ent) hw->phy.mdio.mdio_write =3D ixgbe_mdio_write; =20 netdev->netdev_ops =3D &ixgbe_netdev_ops; + netdev->stat_ops =3D &ixgbe_stat_ops; ixgbe_set_ethtool_ops(netdev); netdev->watchdog_timeo =3D 5 * HZ; strscpy(netdev->name, pci_name(pdev), sizeof(netdev->name)); --=20 2.50.1 (Apple Git-155)