From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 05:51:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 75427E7D; Tue, 30 Apr 2013 05:51:53 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 689891CAB; Tue, 30 Apr 2013 05:51:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U5pq73078878; Tue, 30 Apr 2013 05:51:52 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U5pqpn078875; Tue, 30 Apr 2013 05:51:52 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201304300551.r3U5pqpn078875@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 30 Apr 2013 05:51:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250092 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 05:51:53 -0000 Author: np Date: Tue Apr 30 05:51:52 2013 New Revision: 250092 URL: http://svnweb.freebsd.org/changeset/base/250092 Log: - 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 Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue Apr 30 05:39:42 2013 (r250091) +++ head/sys/dev/cxgbe/adapter.h Tue Apr 30 05:51:52 2013 (r250092) @@ -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) { Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Apr 30 05:39:42 2013 (r250091) +++ head/sys/dev/cxgbe/t4_main.c Tue Apr 30 05:51:52 2013 (r250092) @@ -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;