From owner-svn-src-all@FreeBSD.ORG Tue May 6 02:22:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07904BD7; Tue, 6 May 2014 02:22:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7FE2B8; Tue, 6 May 2014 02:22:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s462MrR2011566; Tue, 6 May 2014 02:22:53 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s462Mr4q011562; Tue, 6 May 2014 02:22:53 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201405060222.s462Mr4q011562@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 6 May 2014 02:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265410 - in stable/10/sys/dev/cxgbe: . common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 02:22:54 -0000 Author: np Date: Tue May 6 02:22:52 2014 New Revision: 265410 URL: http://svnweb.freebsd.org/changeset/base/265410 Log: MFC r261533, r261536, r261537, and r263457. r261533: cxgbe(4): Use the port's tx channel to identify it to t4_clr_port_stats. r261536: cxgbe(4): The T5 allows for a different freelist starvation threshold for queues with buffer packing. Use the correct value to calculate a freelist's low water mark. r261537: cxgbe(4): Use the rx channel map (instead of the tx channel map) as the congestion channel map. r263457: cxgbe(4): Recognize the "spider" configuration where a T5 card's 40G QSFP port is presented as 4 distinct 10G SFP+ ports to the driver. Modified: stable/10/sys/dev/cxgbe/adapter.h stable/10/sys/dev/cxgbe/common/t4_hw.c stable/10/sys/dev/cxgbe/t4_main.c stable/10/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/10/sys/dev/cxgbe/adapter.h Tue May 6 01:15:42 2014 (r265409) +++ stable/10/sys/dev/cxgbe/adapter.h Tue May 6 02:22:52 2014 (r265410) @@ -204,6 +204,7 @@ struct port_info { uint8_t mod_type; uint8_t port_id; uint8_t tx_chan; + uint8_t rx_chan_map; /* rx MPS channel bitmap */ /* These need to be int as they are used in sysctl */ int ntxq; /* # of tx queues */ @@ -512,6 +513,7 @@ struct sge { int timer_val[SGE_NTIMERS]; int counter_val[SGE_NCOUNTERS]; int fl_starve_threshold; + int fl_starve_threshold2; int eq_s_qpp; int iq_s_qpp; Modified: stable/10/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/10/sys/dev/cxgbe/common/t4_hw.c Tue May 6 01:15:42 2014 (r265409) +++ stable/10/sys/dev/cxgbe/common/t4_hw.c Tue May 6 02:22:52 2014 (r265410) @@ -5647,6 +5647,7 @@ int __devinit t4_port_init(struct port_i p->viid = ret; p->tx_chan = j; + p->rx_chan_map = get_mps_bg_map(adap, j); p->lport = j; p->rss_size = rss_size; t4_os_set_hw_addr(adap, p->port_id, addr); Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Tue May 6 01:15:42 2014 (r265409) +++ stable/10/sys/dev/cxgbe/t4_main.c Tue May 6 02:22:52 2014 (r265410) @@ -2622,6 +2622,7 @@ build_medialist(struct port_info *pi) ifmedia_set(media, m | IFM_10G_CX4); break; + case FW_PORT_TYPE_QSFP_10G: case FW_PORT_TYPE_SFP: case FW_PORT_TYPE_FIBER_XFI: case FW_PORT_TYPE_FIBER_XAUI: @@ -7754,11 +7755,11 @@ t4_ioctl(struct cdev *dev, unsigned long if (port_id >= sc->params.nports) return (EINVAL); + pi = sc->port[port_id]; /* MAC stats */ - t4_clr_port_stats(sc, port_id); + t4_clr_port_stats(sc, pi->tx_chan); - pi = sc->port[port_id]; if (pi->flags & PORT_INIT_DONE) { struct sge_rxq *rxq; struct sge_txq *txq; Modified: stable/10/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_sge.c Tue May 6 01:15:42 2014 (r265409) +++ stable/10/sys/dev/cxgbe/t4_sge.c Tue May 6 02:22:52 2014 (r265410) @@ -568,6 +568,10 @@ t4_read_chip_settings(struct adapter *sc r = t4_read_reg(sc, A_SGE_CONM_CTRL); s->fl_starve_threshold = G_EGRTHRESHOLD(r) * 2 + 1; + if (is_t4(sc)) + s->fl_starve_threshold2 = s->fl_starve_threshold; + else + s->fl_starve_threshold2 = G_EGRTHRESHOLDPACKING(r) * 2 + 1; /* egress queues: log2 of # of doorbells per BAR2 page */ r = t4_read_reg(sc, A_SGE_EGRESS_QUEUES_PER_PAGE_PF); @@ -2232,7 +2236,9 @@ alloc_iq_fl(struct port_info *pi, struct return (rc); } fl->needed = fl->cap; - fl->lowat = roundup2(sc->sge.fl_starve_threshold, 8); + fl->lowat = fl->flags & FL_BUF_PACKING ? + roundup2(sc->sge.fl_starve_threshold2, 8) : + roundup2(sc->sge.fl_starve_threshold, 8); c.iqns_to_fl0congen |= htobe32(V_FW_IQ_CMD_FL0HOSTFCMODE(X_HOSTFCMODE_NONE) | @@ -2467,7 +2473,7 @@ tnl_cong(struct port_info *pi) else if (cong_drop == 1) return (0); else - return (1 << pi->tx_chan); + return (pi->rx_chan_map); } static int @@ -2574,7 +2580,7 @@ alloc_ofld_rxq(struct port_info *pi, str char name[16]; rc = alloc_iq_fl(pi, &ofld_rxq->iq, &ofld_rxq->fl, intr_idx, - 1 << pi->tx_chan); + pi->rx_chan_map); if (rc != 0) return (rc);