summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2017-08-28 22:23:41 +0000
committerRobert Mustacchi <rm@joyent.com>2017-08-29 16:47:50 +0000
commit87a5cccf335ac1994a9d0b14a658f4ab54b49058 (patch)
tree930c7428c81849a8c3e6e3c954357ce5e0f18d74
parente891a6ea72a9d8c5f8a424aafeaec179d8c8a79b (diff)
downloadillumos-joyent-87a5cccf335ac1994a9d0b14a658f4ab54b49058.tar.gz
Add MAC stats for link speeds
-rw-r--r--usr/src/uts/common/io/qede/qede.h1
-rw-r--r--usr/src/uts/common/io/qede/qede_gld.c69
-rw-r--r--usr/src/uts/common/io/qede/qede_kstat.c2
-rw-r--r--usr/src/uts/common/io/qede/qede_osal.c4
4 files changed, 71 insertions, 5 deletions
diff --git a/usr/src/uts/common/io/qede/qede.h b/usr/src/uts/common/io/qede/qede.h
index 1f3d04b23d..0f0496a205 100644
--- a/usr/src/uts/common/io/qede/qede.h
+++ b/usr/src/uts/common/io/qede/qede.h
@@ -578,6 +578,7 @@ typedef struct qede_link_props {
boolean_t param_100000fdx;
boolean_t param_50000fdx;
boolean_t param_40000fdx;
+ boolean_t param_25000fdx;
boolean_t param_10000fdx;
boolean_t param_1000fdx;
boolean_t param_1000hdx;
diff --git a/usr/src/uts/common/io/qede/qede_gld.c b/usr/src/uts/common/io/qede/qede_gld.c
index e668259786..0294c73553 100644
--- a/usr/src/uts/common/io/qede/qede_gld.c
+++ b/usr/src/uts/common/io/qede/qede_gld.c
@@ -755,9 +755,6 @@ qede_mac_stats(void * arg,
*value = 0;
break;
#endif
- case ETHER_STAT_CAP_1000FDX:
- *value = 0;
- break;
case ETHER_STAT_CAP_100FDX:
*value = 0;
break;
@@ -820,6 +817,68 @@ case ETHER_STAT_CAP_10FDX:
LINK_DUPLEX_FULL : LINK_DUPLEX_HALF;
break;
+ /*
+ * Supported speeds. These indicate what hardware is capable of.
+ */
+ case ETHER_STAT_CAP_1000HDX:
+ *value = qede->curcfg.supp_capab.param_1000hdx;
+ break;
+
+ case ETHER_STAT_CAP_1000FDX:
+ *value = qede->curcfg.supp_capab.param_1000fdx;
+ break;
+
+ case ETHER_STAT_CAP_10GFDX:
+ *value = qede->curcfg.supp_capab.param_10000fdx;
+ break;
+
+ case ETHER_STAT_CAP_25GFDX:
+ *value = qede->curcfg.supp_capab.param_25000fdx;
+ break;
+
+ case ETHER_STAT_CAP_40GFDX:
+ *value = qede->curcfg.supp_capab.param_40000fdx;
+ break;
+
+ case ETHER_STAT_CAP_50GFDX:
+ *value = qede->curcfg.supp_capab.param_50000fdx;
+ break;
+
+ case ETHER_STAT_CAP_100GFDX:
+ *value = qede->curcfg.supp_capab.param_100000fdx;
+ break;
+
+ /*
+ * Advertised speeds. These indicate what hardware is currently sending.
+ */
+ case ETHER_STAT_ADV_CAP_1000HDX:
+ *value = qede->curcfg.adv_capab.param_1000hdx;
+ break;
+
+ case ETHER_STAT_ADV_CAP_1000FDX:
+ *value = qede->curcfg.adv_capab.param_1000fdx;
+ break;
+
+ case ETHER_STAT_ADV_CAP_10GFDX:
+ *value = qede->curcfg.adv_capab.param_10000fdx;
+ break;
+
+ case ETHER_STAT_ADV_CAP_25GFDX:
+ *value = qede->curcfg.adv_capab.param_25000fdx;
+ break;
+
+ case ETHER_STAT_ADV_CAP_40GFDX:
+ *value = qede->curcfg.adv_capab.param_40000fdx;
+ break;
+
+ case ETHER_STAT_ADV_CAP_50GFDX:
+ *value = qede->curcfg.adv_capab.param_50000fdx;
+ break;
+
+ case ETHER_STAT_ADV_CAP_100GFDX:
+ *value = qede->curcfg.adv_capab.param_100000fdx;
+ break;
+
default:
rc = ENOTSUP;
}
@@ -1187,6 +1246,10 @@ qede_ioctl_pcicfg_rd(qede_t *qede, u32 addr, void *data,
#if 1
cap_offset = pci_config_get8(pci_cfg_handle, PCI_CONF_CAP_PTR);
while (cap_offset != 0) {
+ /* Check for an invalid PCI read. */
+ if (cap_offset == PCI_EINVAL8) {
+ return DDI_FAILURE;
+ }
cap_id = pci_config_get8(pci_cfg_handle, cap_offset);
if (cap_id == PCI_CAP_ID_PCI_E) {
/* PCIe expr capab struct found */
diff --git a/usr/src/uts/common/io/qede/qede_kstat.c b/usr/src/uts/common/io/qede/qede_kstat.c
index 52bfe12ba3..63d7e8d4f2 100644
--- a/usr/src/uts/common/io/qede/qede_kstat.c
+++ b/usr/src/uts/common/io/qede/qede_kstat.c
@@ -433,7 +433,6 @@ qede_kstat_intr_update(kstat_t * kstats, int rw)
return 0;
}
-#if 0
static int
qede_kstat_vport_stats_update(kstat_t * kstats, int rw)
{
@@ -520,7 +519,6 @@ qede_kstat_vport_stats_update(kstat_t * kstats, int rw)
return 0;
}
-#endif
static int
qede_kstat_rxq_update(kstat_t * kstats, int rw)
diff --git a/usr/src/uts/common/io/qede/qede_osal.c b/usr/src/uts/common/io/qede/qede_osal.c
index 5d2b51fe93..14eaa50c5f 100644
--- a/usr/src/uts/common/io/qede/qede_osal.c
+++ b/usr/src/uts/common/io/qede/qede_osal.c
@@ -351,6 +351,8 @@ qede_get_link_info(struct ecore_hwfn *hwfn, struct qede_link_cfg *lnkCfg)
if(lnk_params.speed.advertised_speeds & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_10G)
lnkCfg->adv_capab.param_10000fdx = B_TRUE;
+ if(lnk_params.speed.advertised_speeds & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_25G)
+ lnkCfg->adv_capab.param_25000fdx = B_TRUE;
if(lnk_params.speed.advertised_speeds & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_40G)
lnkCfg->adv_capab.param_40000fdx = B_TRUE;
if(lnk_params.speed.advertised_speeds & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_50G)
@@ -366,6 +368,8 @@ qede_get_link_info(struct ecore_hwfn *hwfn, struct qede_link_cfg *lnkCfg)
if(lnk_caps.speed_capabilities & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_10G)
lnkCfg->supp_capab.param_10000fdx = B_TRUE;
+ if(lnk_caps.speed_capabilities & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_10G)
+ lnkCfg->supp_capab.param_25000fdx = B_TRUE;
if(lnk_caps.speed_capabilities & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_40G)
lnkCfg->supp_capab.param_40000fdx = B_TRUE;
if(lnk_caps.speed_capabilities & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_50G)