Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142380347
D40354.id122666.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D40354.id122666.diff
View Options
diff --git a/sys/dev/ixl/i40e_register.h b/sys/dev/ixl/i40e_register.h
--- a/sys/dev/ixl/i40e_register.h
+++ b/sys/dev/ixl/i40e_register.h
@@ -1443,6 +1443,18 @@
#define I40E_PRTMAC_PCS_XAUI_SWAP_B_SWAP_RX_LANE1_MASK I40E_MASK(0x3, I40E_PRTMAC_PCS_XAUI_SWAP_B_SWAP_RX_LANE1_SHIFT)
#define I40E_PRTMAC_PCS_XAUI_SWAP_B_SWAP_RX_LANE0_SHIFT 14
#define I40E_PRTMAC_PCS_XAUI_SWAP_B_SWAP_RX_LANE0_MASK I40E_MASK(0x3, I40E_PRTMAC_PCS_XAUI_SWAP_B_SWAP_RX_LANE0_SHIFT)
+/* _i=0...3 */ /* Reset: GLOBR */
+#define I40E_PRTMAC_PCS_LINK_STATUS1(_i) (0x0008C200 + ((_i) * 4))
+#define I40E_PRTMAC_PCS_LINK_STATUS1_LINK_SPEED_SHIFT 24
+#define I40E_PRTMAC_PCS_LINK_STATUS1_LINK_SPEED_MASK \
+ I40E_MASK(0x7, I40E_PRTMAC_PCS_LINK_STATUS1_LINK_SPEED_SHIFT)
+#define I40E_PRTMAC_PCS_LINK_STATUS2 0x0008C220
+#define I40E_PRTMAC_PCS_LINK_CTRL 0x0008C260
+#define I40E_PRTMAC_PCS_XGMII_FIFO_STATUS 0x0008C320
+#define I40E_PRTMAC_PCS_AN_LP_STATUS 0x0008C680
+#define I40E_PRTMAC_PCS_KR_STATUS 0x0008CA00
+#define I40E_PRTMAC_PCS_FEC_KR_STATUS1 0x0008CC20
+#define I40E_PRTMAC_PCS_FEC_KR_STATUS2 0x0008CC40
#define I40E_GL_FWRESETCNT 0x00083100 /* Reset: POR */
#define I40E_GL_FWRESETCNT_FWRESETCNT_SHIFT 0
#define I40E_GL_FWRESETCNT_FWRESETCNT_MASK I40E_MASK(0xFFFFFFFF, I40E_GL_FWRESETCNT_FWRESETCNT_SHIFT)
diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c
--- a/sys/dev/ixl/ixl_pf_main.c
+++ b/sys/dev/ixl/ixl_pf_main.c
@@ -67,6 +67,7 @@
/* Debug Sysctls */
static int ixl_sysctl_link_status(SYSCTL_HANDLER_ARGS);
static int ixl_sysctl_phy_abilities(SYSCTL_HANDLER_ARGS);
+static int ixl_sysctl_phy_statistics(SYSCTL_HANDLER_ARGS);
static int ixl_sysctl_sw_filter_list(SYSCTL_HANDLER_ARGS);
static int ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS);
static int ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS);
@@ -2606,6 +2607,10 @@
CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT,
pf, 0, ixl_sysctl_queue_interrupt_table, "A", "View MSI-X indices for TX/RX queues");
+ SYSCTL_ADD_PROC(ctx, debug_list,
+ OID_AUTO, "phy_statistics", CTLTYPE_STRING | CTLFLAG_RD,
+ pf, 0, ixl_sysctl_phy_statistics, "A", "PHY Statistics");
+
if (pf->has_i2c) {
SYSCTL_ADD_PROC(ctx, debug_list,
OID_AUTO, "read_i2c_byte",
@@ -3446,6 +3451,61 @@
return (error);
}
+static int
+ixl_sysctl_phy_statistics(SYSCTL_HANDLER_ARGS)
+{
+ struct ixl_pf *pf = (struct ixl_pf *)arg1;
+ struct i40e_hw *hw = &pf->hw;
+ device_t dev = pf->dev;
+ struct sbuf *buf;
+ int error = 0;
+
+ buf = sbuf_new_for_sysctl(NULL, NULL, 128, req);
+ if (buf == NULL) {
+ device_printf(dev, "Could not allocate sbuf for sysctl output.\n");
+ return (ENOMEM);
+ }
+
+ if (hw->mac.type == I40E_MAC_X722) {
+ sbuf_printf(buf, "\n"
+ "PCS Link Control Register: unavailable\n"
+ "PCS Link Status 1: unavailable\n"
+ "PCS Link Status 2: unavailable\n"
+ "XGMII FIFO Status: unavailable\n"
+ "Auto-Negotiation (AN) Status: unavailable\n"
+ "KR PCS Status: unavailable\n"
+ "KR FEC Status 1 – FEC Correctable Blocks Counter: unavailable\n"
+ "KR FEC Status 2 – FEC Uncorrectable Blocks Counter: unavailable"
+ );
+ } else {
+ sbuf_printf(buf, "\n"
+ "PCS Link Control Register: %#010X\n"
+ "PCS Link Status 1: %#010X\n"
+ "PCS Link Status 2: %#010X\n"
+ "XGMII FIFO Status: %#010X\n"
+ "Auto-Negotiation (AN) Status: %#010X\n"
+ "KR PCS Status: %#010X\n"
+ "KR FEC Status 1 – FEC Correctable Blocks Counter: %#010X\n"
+ "KR FEC Status 2 – FEC Uncorrectable Blocks Counter: %#010X",
+ rd32(hw, I40E_PRTMAC_PCS_LINK_CTRL),
+ rd32(hw, I40E_PRTMAC_PCS_LINK_STATUS1(0)),
+ rd32(hw, I40E_PRTMAC_PCS_LINK_STATUS2),
+ rd32(hw, I40E_PRTMAC_PCS_XGMII_FIFO_STATUS),
+ rd32(hw, I40E_PRTMAC_PCS_AN_LP_STATUS),
+ rd32(hw, I40E_PRTMAC_PCS_KR_STATUS),
+ rd32(hw, I40E_PRTMAC_PCS_FEC_KR_STATUS1),
+ rd32(hw, I40E_PRTMAC_PCS_FEC_KR_STATUS2)
+ );
+ }
+
+ error = sbuf_finish(buf);
+ if (error)
+ device_printf(dev, "Error finishing sbuf: %d\n", error);
+
+ sbuf_delete(buf);
+ return (error);
+}
+
static int
ixl_sysctl_sw_filter_list(SYSCTL_HANDLER_ARGS)
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jan 20, 8:42 AM (14 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27761227
Default Alt Text
D40354.id122666.diff (4 KB)
Attached To
Mode
D40354: ixl: implement support for dumping NIC registers
Attached
Detach File
Event Timeline
Log In to Comment