From: Eric Joyner <eric.joyner@amd.com>
To: <netdev@vger.kernel.org>
Cc: Brett Creeley <brett.creeley@amd.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Jacob Keller <jacob.e.keller@intel.com>,
Eric Joyner <eric.joyner@amd.com>
Subject: [PATCH net-next v4 2/5] ionic: Update ionic_if.h with new extra port stats
Date: Tue, 9 Jun 2026 23:18:27 -0700 [thread overview]
Message-ID: <20260610061830.51037-3-eric.joyner@amd.com> (raw)
In-Reply-To: <20260610061830.51037-1-eric.joyner@amd.com>
Add a new structure to report additional statistics from the firmware to
struct ionic_port_info. This new struct currently only contains FEC
related statistics, but any new port-level statistics collected by the
firmware would go into it.
The new structure is located in the same area as the unused
ionic_port_pb_stats structure, so this patch also removes that since it
was never used in this driver.
Finally, to indicate firmware support for the new structure, introduce a
new device capability that the driver can use to see if the attached
device supports reporting these extra stats.
Signed-off-by: Eric Joyner <eric.joyner@amd.com>
---
.../net/ethernet/pensando/ionic/ionic_if.h | 39 +++++++------------
1 file changed, 13 insertions(+), 26 deletions(-)
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_if.h b/drivers/net/ethernet/pensando/ionic/ionic_if.h
index 23d6e2b4791e..e84df6115a77 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_if.h
+++ b/drivers/net/ethernet/pensando/ionic/ionic_if.h
@@ -7,6 +7,7 @@
#define IONIC_DEV_INFO_SIGNATURE 0x44455649 /* 'DEVI' */
#define IONIC_DEV_INFO_VERSION 1
#define IONIC_IFNAMSIZ 16
+#define IONIC_STAT_INVALID ((__le64)-1)
/*
* enum ionic_cmd_opcode - Device commands
@@ -273,10 +274,12 @@ union ionic_drv_identity {
* enum ionic_dev_capability - Device capabilities
* @IONIC_DEV_CAP_VF_CTRL: Device supports VF ctrl operations
* @IONIC_DEV_CAP_DISC_CMB: Device supports CMB discovery operations
+ * @IONIC_DEV_CAP_EXTRA_STATS: Device supports extra stats schema
*/
enum ionic_dev_capability {
IONIC_DEV_CAP_VF_CTRL = BIT(0),
IONIC_DEV_CAP_DISC_CMB = BIT(1),
+ IONIC_DEV_CAP_EXTRA_STATS = BIT(4),
};
/**
@@ -2855,6 +2858,14 @@ struct ionic_mgmt_port_stats {
__le64 frames_tx_pause;
};
+struct ionic_port_extra_stats {
+ __le64 rsfec_correctable_blocks;
+ __le64 rsfec_uncorrectable_blocks;
+ __le64 fec_corrected_bits_total;
+ __le64 rx_bits_phy;
+ __le64 fec_codeword_error_bin[16];
+};
+
enum ionic_pb_buffer_drop_stats {
IONIC_BUFFER_INTRINSIC_DROP = 0,
IONIC_BUFFER_DISCARDED,
@@ -2883,28 +2894,6 @@ enum ionic_oflow_drop_stats {
IONIC_OFLOW_DROP_MAX,
};
-/* struct ionic_port_pb_stats - packet buffers system stats
- * uses ionic_pb_buffer_drop_stats for drop_counts[]
- */
-struct ionic_port_pb_stats {
- __le64 sop_count_in;
- __le64 eop_count_in;
- __le64 sop_count_out;
- __le64 eop_count_out;
- __le64 drop_counts[IONIC_BUFFER_DROP_MAX];
- __le64 input_queue_buffer_occupancy[IONIC_QOS_TC_MAX];
- __le64 input_queue_port_monitor[IONIC_QOS_TC_MAX];
- __le64 output_queue_port_monitor[IONIC_QOS_TC_MAX];
- __le64 oflow_drop_counts[IONIC_OFLOW_DROP_MAX];
- __le64 input_queue_good_pkts_in[IONIC_QOS_TC_MAX];
- __le64 input_queue_good_pkts_out[IONIC_QOS_TC_MAX];
- __le64 input_queue_err_pkts_in[IONIC_QOS_TC_MAX];
- __le64 input_queue_fifo_depth[IONIC_QOS_TC_MAX];
- __le64 input_queue_max_fifo_depth[IONIC_QOS_TC_MAX];
- __le64 input_queue_peak_occupancy[IONIC_QOS_TC_MAX];
- __le64 output_queue_buffer_occupancy[IONIC_QOS_TC_MAX];
-};
-
/**
* struct ionic_port_identity - port identity structure
* @version: identity structure version
@@ -2950,7 +2939,7 @@ union ionic_port_identity {
* @sprom_page2: Extended Transceiver sprom, page 2
* @sprom_page17: Extended Transceiver sprom, page 17
* @rsvd: reserved byte(s)
- * @pb_stats: uplink pb drop stats
+ * @extra_stats: Extra port statistics data
*/
struct ionic_port_info {
union ionic_port_config config;
@@ -2968,9 +2957,7 @@ struct ionic_port_info {
};
};
u8 rsvd[376];
-
- /* pb_stats must start at 2k offset */
- struct ionic_port_pb_stats pb_stats;
+ struct ionic_port_extra_stats extra_stats;
};
/*
--
2.17.1
next prev parent reply other threads:[~2026-06-10 6:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-10 6:18 [PATCH net-next v4 0/5] ionic: Expose more port stats to ethtool Eric Joyner
2026-06-10 6:18 ` [PATCH net-next v4 1/5] ionic: Fix check in ionic_get_link_ext_stats Eric Joyner
2026-06-10 6:18 ` Eric Joyner [this message]
2026-06-10 6:18 ` [PATCH net-next v4 3/5] ionic: Report "rx_bits_phy" stat to ethtool Eric Joyner
2026-06-10 6:18 ` [PATCH net-next v4 4/5] ionic: Report "link_down_events_phy" in ethtool statistics Eric Joyner
2026-06-10 6:18 ` [PATCH net-next v4 5/5] ionic: Add .get_fec_stats ethtool handler Eric Joyner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260610061830.51037-3-eric.joyner@amd.com \
--to=eric.joyner@amd.com \
--cc=andrew+netdev@lunn.ch \
--cc=brett.creeley@amd.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jacob.e.keller@intel.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox