summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornp <np@FreeBSD.org>2013-04-30 05:51:52 +0000
committernp <np@FreeBSD.org>2013-04-30 05:51:52 +0000
commitf28f0645eb717cf82e54d32aa2608dfe7f3ee517 (patch)
treebab2969d2ba554a5502df40286f8547bae4b1359
parent5d25f28d35e0dac3d93796a41dac8d18a855808f (diff)
downloadFreeBSD-src-f28f0645eb717cf82e54d32aa2608dfe7f3ee517.zip
FreeBSD-src-f28f0645eb717cf82e54d32aa2608dfe7f3ee517.tar.gz
- Provide accurate ifmedia information so that 40G ports/transceivers are
displayed properly in ifconfig, etc. - Use the same number of tx and rx queues for a 40G port as for a 10G port. MFC after: 1 week
-rw-r--r--sys/dev/cxgbe/adapter.h7
-rw-r--r--sys/dev/cxgbe/t4_main.c43
2 files changed, 44 insertions, 6 deletions
diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h
index 99ab38e..434fb53 100644
--- a/sys/dev/cxgbe/adapter.h
+++ b/sys/dev/cxgbe/adapter.h
@@ -757,6 +757,13 @@ is_10G_port(const struct port_info *pi)
return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) != 0);
}
+static inline bool
+is_40G_port(const struct port_info *pi)
+{
+
+ return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_40G) != 0);
+}
+
static inline int
tx_resume_threshold(struct sge_eq *eq)
{
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index 95987b9..387cd00 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -666,7 +666,7 @@ t4_attach(device_t dev)
device_get_nameunit(dev), i);
mtx_init(&pi->pi_lock, pi->lockname, 0, MTX_DEF);
- if (is_10G_port(pi)) {
+ if (is_10G_port(pi) || is_40G_port(pi)) {
n10g++;
pi->tmr_idx = t4_tmr_idx_10g;
pi->pktc_idx = t4_pktc_idx_10g;
@@ -756,7 +756,7 @@ t4_attach(device_t dev)
pi->first_rxq = rqidx;
pi->first_txq = tqidx;
- if (is_10G_port(pi)) {
+ if (is_10G_port(pi) || is_40G_port(pi)) {
pi->nrxq = iaq.nrxq10g;
pi->ntxq = iaq.ntxq10g;
} else {
@@ -771,7 +771,7 @@ t4_attach(device_t dev)
if (is_offload(sc)) {
pi->first_ofld_rxq = ofld_rqidx;
pi->first_ofld_txq = ofld_tqidx;
- if (is_10G_port(pi)) {
+ if (is_10G_port(pi) || is_40G_port(pi)) {
pi->nofldrxq = iaq.nofldrxq10g;
pi->nofldtxq = iaq.nofldtxq10g;
} else {
@@ -2595,16 +2595,47 @@ build_medialist(struct port_info *pi)
case FW_PORT_MOD_TYPE_NA:
case FW_PORT_MOD_TYPE_ER:
default:
+ device_printf(pi->dev,
+ "unknown port_type (%d), mod_type (%d)\n",
+ pi->port_type, pi->mod_type);
+ ifmedia_add(media, m | IFM_UNKNOWN, data, NULL);
+ ifmedia_set(media, m | IFM_UNKNOWN);
+ break;
+ }
+ break;
+
+ case FW_PORT_TYPE_QSFP:
+ switch (pi->mod_type) {
+
+ case FW_PORT_MOD_TYPE_LR:
+ ifmedia_add(media, m | IFM_40G_LR4, data, NULL);
+ ifmedia_set(media, m | IFM_40G_LR4);
+ break;
+
+ case FW_PORT_MOD_TYPE_SR:
+ ifmedia_add(media, m | IFM_40G_SR4, data, NULL);
+ ifmedia_set(media, m | IFM_40G_SR4);
+ break;
+ case FW_PORT_MOD_TYPE_TWINAX_PASSIVE:
+ case FW_PORT_MOD_TYPE_TWINAX_ACTIVE:
+ ifmedia_add(media, m | IFM_40G_CR4, data, NULL);
+ ifmedia_set(media, m | IFM_40G_CR4);
+ break;
+
+ default:
+ device_printf(pi->dev,
+ "unknown port_type (%d), mod_type (%d)\n",
+ pi->port_type, pi->mod_type);
ifmedia_add(media, m | IFM_UNKNOWN, data, NULL);
ifmedia_set(media, m | IFM_UNKNOWN);
break;
}
break;
- case FW_PORT_TYPE_KX4:
- case FW_PORT_TYPE_KX:
- case FW_PORT_TYPE_KR:
default:
+ device_printf(pi->dev,
+ "unknown port_type (%d), mod_type (%d)\n", pi->port_type,
+ pi->mod_type);
ifmedia_add(media, m | IFM_UNKNOWN, data, NULL);
ifmedia_set(media, m | IFM_UNKNOWN);
break;
OpenPOWER on IntegriCloud