From owner-svn-src-stable-8@FreeBSD.ORG Wed May 27 13:27:40 2015 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABE9D699; Wed, 27 May 2015 13:27:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) 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 99404EA; Wed, 27 May 2015 13:27:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4RDRe0b089718; Wed, 27 May 2015 13:27:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4RDRegN089717; Wed, 27 May 2015 13:27:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505271327.t4RDRegN089717@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 27 May 2015 13:27:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r283611 - stable/8/sys/dev/sound/pci/hda X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2015 13:27:40 -0000 Author: hselasky Date: Wed May 27 13:27:39 2015 New Revision: 283611 URL: https://svnweb.freebsd.org/changeset/base/283611 Log: MFC r283064: Fix an off-by-one error by adding proper range checks when parsing the HDA association descriptors. This fixes a crash during device probe for some HDA PCI devices. Modified: stable/8/sys/dev/sound/pci/hda/hdaa.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdaa.c Wed May 27 13:25:26 2015 (r283610) +++ stable/8/sys/dev/sound/pci/hda/hdaa.c Wed May 27 13:27:39 2015 (r283611) @@ -2811,7 +2811,7 @@ hdaa_audio_as_parse(struct hdaa_devinfo /* Scan associations skipping as=0. */ cnt = 0; - for (j = 1; j < 16; j++) { + for (j = 1; j < 16 && cnt < max; j++) { first = 16; hpredir = 0; for (i = devinfo->startnode; i < devinfo->endnode; i++) { From owner-svn-src-stable-8@FreeBSD.ORG Thu May 28 06:45:15 2015 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7AC59143; Thu, 28 May 2015 06:45:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) 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 4E7638D; Thu, 28 May 2015 06:45:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4S6jFTl024185; Thu, 28 May 2015 06:45:15 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4S6jFTB024184; Thu, 28 May 2015 06:45:15 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201505280645.t4S6jFTB024184@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 May 2015 06:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r283642 - in stable: 10/sys/sys 7/sys/sys 8/sys/sys 9/sys/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2015 06:45:15 -0000 Author: dim Date: Thu May 28 06:45:13 2015 New Revision: 283642 URL: https://svnweb.freebsd.org/changeset/base/283642 Log: MFC r283254: Ensure that the static structs emitted by the MODULE_DEPEND() and MODULE_VERSION() macros don't end up as .comm symbols, when all the version fields are zero. Normally, such symbols will end up in .bss, but for kernel module version objects, this can lead to "garbage" version numbers. Fix this by instructing the compiler to always put these structs in the .data segment instead. Reported by: delphij, ae Modified: stable/8/sys/sys/module.h Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/sys/module.h stable/7/sys/sys/module.h stable/9/sys/sys/module.h Directory Properties: stable/10/ (props changed) stable/7/ (props changed) stable/7/sys/ (props changed) stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/8/sys/sys/module.h ============================================================================== --- stable/8/sys/sys/module.h Thu May 28 05:38:07 2015 (r283641) +++ stable/8/sys/sys/module.h Thu May 28 06:45:13 2015 (r283642) @@ -106,7 +106,8 @@ struct mod_metadata { DATA_SET(modmetadata_set, _mod_metadata##uniquifier) #define MODULE_DEPEND(module, mdepend, vmin, vpref, vmax) \ - static struct mod_depend _##module##_depend_on_##mdepend = { \ + static struct mod_depend _##module##_depend_on_##mdepend \ + __section(".data") = { \ vmin, \ vpref, \ vmax \ @@ -146,7 +147,8 @@ struct mod_metadata { DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, __FreeBSD_version) #define MODULE_VERSION(module, version) \ - static struct mod_version _##module##_version = { \ + static struct mod_version _##module##_version \ + __section(".data") = { \ version \ }; \ MODULE_METADATA(_##module##_version, MDT_VERSION, \ From owner-svn-src-stable-8@FreeBSD.ORG Fri May 29 23:28:56 2015 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42F9D186; Fri, 29 May 2015 23:28:56 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) 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 2FD2D1676; Fri, 29 May 2015 23:28:56 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TNSuXj067478; Fri, 29 May 2015 23:28:56 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TNSuQ2067477; Fri, 29 May 2015 23:28:56 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201505292328.t4TNSuQ2067477@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Fri, 29 May 2015 23:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r283759 - stable/8/sys/dev/bxe X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 23:28:56 -0000 Author: davidcs Date: Fri May 29 23:28:55 2015 New Revision: 283759 URL: https://svnweb.freebsd.org/changeset/base/283759 Log: MFC r283269 Submitted by: gary.zambrano@qlogic.com Approved by:davidcs@freebsd.org Modified: stable/8/sys/dev/bxe/bxe.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/bxe/bxe.c ============================================================================== --- stable/8/sys/dev/bxe/bxe.c Fri May 29 23:02:12 2015 (r283758) +++ stable/8/sys/dev/bxe/bxe.c Fri May 29 23:28:55 2015 (r283759) @@ -3111,7 +3111,7 @@ static inline void bxe_update_sge_prod(struct bxe_softc *sc, struct bxe_fastpath *fp, uint16_t sge_len, - struct eth_end_agg_rx_cqe *cqe) + union eth_sgl_or_raw_data *cqe) { uint16_t last_max, last_elem, first_elem; uint16_t delta = 0; @@ -3124,17 +3124,17 @@ bxe_update_sge_prod(struct bxe_softc /* first mark all used pages */ for (i = 0; i < sge_len; i++) { BIT_VEC64_CLEAR_BIT(fp->sge_mask, - RX_SGE(le16toh(cqe->sgl_or_raw_data.sgl[i]))); + RX_SGE(le16toh(cqe->sgl[i]))); } BLOGD(sc, DBG_LRO, "fp[%02d] fp_cqe->sgl[%d] = %d\n", fp->index, sge_len - 1, - le16toh(cqe->sgl_or_raw_data.sgl[sge_len - 1])); + le16toh(cqe->sgl[sge_len - 1])); /* assume that the last SGE index is the biggest */ bxe_update_last_max_sge(fp, - le16toh(cqe->sgl_or_raw_data.sgl[sge_len - 1])); + le16toh(cqe->sgl[sge_len - 1])); last_max = RX_SGE(fp->last_max_sge); last_elem = last_max >> BIT_VEC64_ELEM_SHIFT; @@ -3250,6 +3250,53 @@ bxe_tpa_stop_exit: } static uint8_t +bxe_service_rxsgl( + struct bxe_fastpath *fp, + uint16_t len, + uint16_t lenonbd, + struct mbuf *m, + struct eth_fast_path_rx_cqe *cqe_fp) +{ + struct mbuf *m_frag; + uint16_t frags, frag_len; + uint16_t sge_idx = 0; + uint16_t j; + uint8_t i, rc = 0; + uint32_t frag_size; + + /* adjust the mbuf */ + m->m_len = lenonbd; + + frag_size = len - lenonbd; + frags = SGE_PAGE_ALIGN(frag_size) >> SGE_PAGE_SHIFT; + + for (i = 0, j = 0; i < frags; i += PAGES_PER_SGE, j++) { + sge_idx = RX_SGE(le16toh(cqe_fp->sgl_or_raw_data.sgl[j])); + + m_frag = fp->rx_sge_mbuf_chain[sge_idx].m; + frag_len = min(frag_size, (uint32_t)(SGE_PAGE_SIZE)); + m_frag->m_len = frag_len; + + /* allocate a new mbuf for the SGE */ + rc = bxe_alloc_rx_sge_mbuf(fp, sge_idx); + if (rc) { + /* Leave all remaining SGEs in the ring! */ + return (rc); + } + fp->eth_q_stats.mbuf_alloc_sge--; + + /* concatenate the fragment to the head mbuf */ + m_cat(m, m_frag); + + frag_size -= frag_len; + } + + bxe_update_sge_prod(fp->sc, fp, frags, &cqe_fp->sgl_or_raw_data); + + return rc; +} + +static uint8_t bxe_rxeof(struct bxe_softc *sc, struct bxe_fastpath *fp) { @@ -3289,7 +3336,7 @@ bxe_rxeof(struct bxe_softc *sc, struct eth_fast_path_rx_cqe *cqe_fp; uint8_t cqe_fp_flags; enum eth_rx_cqe_type cqe_fp_type; - uint16_t len, pad; + uint16_t len, lenonbd, pad; struct mbuf *m = NULL; comp_ring_cons = RCQ(sw_cq_cons); @@ -3304,7 +3351,7 @@ bxe_rxeof(struct bxe_softc *sc, BLOGD(sc, DBG_RX, "fp[%02d] Rx hw_cq_cons=%d hw_sw_cons=%d " "BD prod=%d cons=%d CQE type=0x%x err=0x%x " - "status=0x%x rss_hash=0x%x vlan=0x%x len=%u\n", + "status=0x%x rss_hash=0x%x vlan=0x%x len=%u lenonbd=%u\n", fp->index, hw_cq_cons, sw_cq_cons, @@ -3315,7 +3362,8 @@ bxe_rxeof(struct bxe_softc *sc, cqe_fp->status_flags, le32toh(cqe_fp->rss_hash_result), le16toh(cqe_fp->vlan_tag), - le16toh(cqe_fp->pkt_len_or_gro_seg_len)); + le16toh(cqe_fp->pkt_len_or_gro_seg_len), + le16toh(cqe_fp->len_on_bd)); /* is this a slowpath msg? */ if (__predict_false(CQE_TYPE_SLOW(cqe_fp_type))) { @@ -3362,7 +3410,7 @@ bxe_rxeof(struct bxe_softc *sc, bxe_tpa_stop(sc, fp, tpa_info, queue, pages, &cqe->end_agg_cqe, comp_ring_cons); - bxe_update_sge_prod(sc, fp, pages, &cqe->end_agg_cqe); + bxe_update_sge_prod(sc, fp, pages, &cqe->end_agg_cqe.sgl_or_raw_data); goto next_cqe; } @@ -3378,6 +3426,7 @@ bxe_rxeof(struct bxe_softc *sc, } len = le16toh(cqe_fp->pkt_len_or_gro_seg_len); + lenonbd = le16toh(cqe_fp->len_on_bd); pad = cqe_fp->placement_offset; m = rx_buf->m; @@ -3424,6 +3473,12 @@ bxe_rxeof(struct bxe_softc *sc, m_adj(m, pad); m->m_pkthdr.len = m->m_len = len; + if (len != lenonbd){ + rc = bxe_service_rxsgl(fp, len, lenonbd, m, cqe_fp); + if (rc) + break; + } + /* assign packet to this interface interface */ m->m_pkthdr.rcvif = ifp; @@ -6226,30 +6281,27 @@ static void bxe_set_fp_rx_buf_size(struct bxe_softc *sc) { int i; + uint32_t rx_buf_size; - BLOGD(sc, DBG_LOAD, "mtu = %d\n", sc->mtu); + rx_buf_size = (IP_HEADER_ALIGNMENT_PADDING + ETH_OVERHEAD + sc->mtu); for (i = 0; i < sc->num_queues; i++) { - /* get the Rx buffer size for RX frames */ - sc->fp[i].rx_buf_size = - (IP_HEADER_ALIGNMENT_PADDING + - ETH_OVERHEAD + - sc->mtu); - - BLOGD(sc, DBG_LOAD, "rx_buf_size for fp[%02d] = %d\n", - i, sc->fp[i].rx_buf_size); - - /* get the mbuf allocation size for RX frames */ - if (sc->fp[i].rx_buf_size <= MCLBYTES) { + if(rx_buf_size <= MCLBYTES){ + sc->fp[i].rx_buf_size = rx_buf_size; + sc->fp[i].mbuf_alloc_size = MCLBYTES; + }else if (rx_buf_size <= MJUMPAGESIZE){ + sc->fp[i].rx_buf_size = rx_buf_size; + sc->fp[i].mbuf_alloc_size = MJUMPAGESIZE; + }else if (rx_buf_size <= (MJUMPAGESIZE + MCLBYTES)){ + sc->fp[i].rx_buf_size = MCLBYTES; + sc->fp[i].mbuf_alloc_size = MCLBYTES; + }else if (rx_buf_size <= (2 * MJUMPAGESIZE)){ + sc->fp[i].rx_buf_size = MJUMPAGESIZE; + sc->fp[i].mbuf_alloc_size = MJUMPAGESIZE; + }else { + sc->fp[i].rx_buf_size = MCLBYTES; sc->fp[i].mbuf_alloc_size = MCLBYTES; - } else if (sc->fp[i].rx_buf_size <= BCM_PAGE_SIZE) { - sc->fp[i].mbuf_alloc_size = PAGE_SIZE; - } else { - sc->fp[i].mbuf_alloc_size = MJUM9BYTES; } - - BLOGD(sc, DBG_LOAD, "mbuf_alloc_size for fp[%02d] = %d\n", - i, sc->fp[i].mbuf_alloc_size); } } From owner-svn-src-stable-8@FreeBSD.ORG Fri May 29 23:33:50 2015 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E34140C; Fri, 29 May 2015 23:33:50 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) 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 7F66B1891; Fri, 29 May 2015 23:33:50 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TNXoEU071844; Fri, 29 May 2015 23:33:50 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TNXnOR071840; Fri, 29 May 2015 23:33:49 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201505292333.t4TNXnOR071840@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Fri, 29 May 2015 23:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r283760 - stable/8/sys/dev/bxe X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 23:33:50 -0000 Author: davidcs Date: Fri May 29 23:33:49 2015 New Revision: 283760 URL: https://svnweb.freebsd.org/changeset/base/283760 Log: MFC r283274 Submitted by:gary.zambrano@qlogic.com Modified: stable/8/sys/dev/bxe/bxe.c stable/8/sys/dev/bxe/bxe_stats.c stable/8/sys/dev/bxe/bxe_stats.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/bxe/bxe.c ============================================================================== --- stable/8/sys/dev/bxe/bxe.c Fri May 29 23:28:55 2015 (r283759) +++ stable/8/sys/dev/bxe/bxe.c Fri May 29 23:33:49 2015 (r283760) @@ -27,7 +27,7 @@ #include __FBSDID("$FreeBSD$"); -#define BXE_DRIVER_VERSION "1.78.78" +#define BXE_DRIVER_VERSION "1.78.79" #include "bxe.h" #include "ecore_sp.h" @@ -483,6 +483,8 @@ static const struct { 4, STATS_FLAGS_FUNC, "rx_pkts"}, { STATS_OFFSET32(rx_tpa_pkts), 4, STATS_FLAGS_FUNC, "rx_tpa_pkts"}, + { STATS_OFFSET32(rx_jumbo_sge_pkts), + 4, STATS_FLAGS_FUNC, "rx_jumbo_sge_pkts"}, { STATS_OFFSET32(rx_soft_errors), 4, STATS_FLAGS_FUNC, "rx_soft_errors"}, { STATS_OFFSET32(rx_hw_csum_errors), @@ -594,6 +596,8 @@ static const struct { 4, "rx_pkts"}, { Q_STATS_OFFSET32(rx_tpa_pkts), 4, "rx_tpa_pkts"}, + { Q_STATS_OFFSET32(rx_jumbo_sge_pkts), + 4, "rx_jumbo_sge_pkts"}, { Q_STATS_OFFSET32(rx_soft_errors), 4, "rx_soft_errors"}, { Q_STATS_OFFSET32(rx_hw_csum_errors), @@ -3477,6 +3481,7 @@ bxe_rxeof(struct bxe_softc *sc, rc = bxe_service_rxsgl(fp, len, lenonbd, m, cqe_fp); if (rc) break; + fp->eth_q_stats.rx_jumbo_sge_pkts++; } /* assign packet to this interface interface */ @@ -6860,42 +6865,40 @@ bxe_alloc_fp_buffers(struct bxe_softc *s fp->rx_cq_prod = cqe_ring_prod; fp->eth_q_stats.rx_calls = fp->eth_q_stats.rx_pkts = 0; - if (sc->ifnet->if_capenable & IFCAP_LRO) { - max_agg_queues = MAX_AGG_QS(sc); + max_agg_queues = MAX_AGG_QS(sc); - fp->tpa_enable = TRUE; + fp->tpa_enable = TRUE; - /* fill the TPA pool */ - for (j = 0; j < max_agg_queues; j++) { - rc = bxe_alloc_rx_tpa_mbuf(fp, j); - if (rc != 0) { - BLOGE(sc, "mbuf alloc fail for fp[%02d] TPA queue %d\n", + /* fill the TPA pool */ + for (j = 0; j < max_agg_queues; j++) { + rc = bxe_alloc_rx_tpa_mbuf(fp, j); + if (rc != 0) { + BLOGE(sc, "mbuf alloc fail for fp[%02d] TPA queue %d\n", i, j); - fp->tpa_enable = FALSE; - goto bxe_alloc_fp_buffers_error; - } - - fp->rx_tpa_info[j].state = BXE_TPA_STATE_STOP; + fp->tpa_enable = FALSE; + goto bxe_alloc_fp_buffers_error; } - if (fp->tpa_enable) { - /* fill the RX SGE chain */ - ring_prod = 0; - for (j = 0; j < RX_SGE_USABLE; j++) { - rc = bxe_alloc_rx_sge_mbuf(fp, ring_prod); - if (rc != 0) { - BLOGE(sc, "mbuf alloc fail for fp[%02d] SGE %d\n", - i, ring_prod); - fp->tpa_enable = FALSE; - ring_prod = 0; - goto bxe_alloc_fp_buffers_error; - } + fp->rx_tpa_info[j].state = BXE_TPA_STATE_STOP; + } - ring_prod = RX_SGE_NEXT(ring_prod); + if (fp->tpa_enable) { + /* fill the RX SGE chain */ + ring_prod = 0; + for (j = 0; j < RX_SGE_USABLE; j++) { + rc = bxe_alloc_rx_sge_mbuf(fp, ring_prod); + if (rc != 0) { + BLOGE(sc, "mbuf alloc fail for fp[%02d] SGE %d\n", + i, ring_prod); + fp->tpa_enable = FALSE; + ring_prod = 0; + goto bxe_alloc_fp_buffers_error; } - fp->rx_sge_prod = ring_prod; + ring_prod = RX_SGE_NEXT(ring_prod); } + + fp->rx_sge_prod = ring_prod; } } @@ -11779,28 +11782,26 @@ bxe_pf_rx_q_prep(struct bxe_softc uint16_t sge_sz = 0; uint16_t tpa_agg_size = 0; - if (sc->ifnet->if_capenable & IFCAP_LRO) { - pause->sge_th_lo = SGE_TH_LO(sc); - pause->sge_th_hi = SGE_TH_HI(sc); + pause->sge_th_lo = SGE_TH_LO(sc); + pause->sge_th_hi = SGE_TH_HI(sc); - /* validate SGE ring has enough to cross high threshold */ - if (sc->dropless_fc && + /* validate SGE ring has enough to cross high threshold */ + if (sc->dropless_fc && (pause->sge_th_hi + FW_PREFETCH_CNT) > (RX_SGE_USABLE_PER_PAGE * RX_SGE_NUM_PAGES)) { - BLOGW(sc, "sge ring threshold limit\n"); - } + BLOGW(sc, "sge ring threshold limit\n"); + } - /* minimum max_aggregation_size is 2*MTU (two full buffers) */ - tpa_agg_size = (2 * sc->mtu); - if (tpa_agg_size < sc->max_aggregation_size) { - tpa_agg_size = sc->max_aggregation_size; - } + /* minimum max_aggregation_size is 2*MTU (two full buffers) */ + tpa_agg_size = (2 * sc->mtu); + if (tpa_agg_size < sc->max_aggregation_size) { + tpa_agg_size = sc->max_aggregation_size; + } - max_sge = SGE_PAGE_ALIGN(sc->mtu) >> SGE_PAGE_SHIFT; - max_sge = ((max_sge + PAGES_PER_SGE - 1) & + max_sge = SGE_PAGE_ALIGN(sc->mtu) >> SGE_PAGE_SHIFT; + max_sge = ((max_sge + PAGES_PER_SGE - 1) & (~(PAGES_PER_SGE - 1))) >> PAGES_PER_SGE_SHIFT; - sge_sz = (uint16_t)min(SGE_PAGES, 0xffff); - } + sge_sz = (uint16_t)min(SGE_PAGES, 0xffff); /* pause - not for e1 */ if (!CHIP_IS_E1(sc)) { Modified: stable/8/sys/dev/bxe/bxe_stats.c ============================================================================== --- stable/8/sys/dev/bxe/bxe_stats.c Fri May 29 23:28:55 2015 (r283759) +++ stable/8/sys/dev/bxe/bxe_stats.c Fri May 29 23:33:49 2015 (r283760) @@ -1227,6 +1227,7 @@ bxe_drv_stats_update(struct bxe_softc *s UPDATE_ESTAT_QSTAT(rx_calls); UPDATE_ESTAT_QSTAT(rx_pkts); UPDATE_ESTAT_QSTAT(rx_tpa_pkts); + UPDATE_ESTAT_QSTAT(rx_jumbo_sge_pkts); UPDATE_ESTAT_QSTAT(rx_soft_errors); UPDATE_ESTAT_QSTAT(rx_hw_csum_errors); UPDATE_ESTAT_QSTAT(rx_ofld_frames_csum_ip); Modified: stable/8/sys/dev/bxe/bxe_stats.h ============================================================================== --- stable/8/sys/dev/bxe/bxe_stats.h Fri May 29 23:28:55 2015 (r283759) +++ stable/8/sys/dev/bxe/bxe_stats.h Fri May 29 23:33:49 2015 (r283760) @@ -218,6 +218,7 @@ struct bxe_eth_stats { uint32_t rx_calls; uint32_t rx_pkts; uint32_t rx_tpa_pkts; + uint32_t rx_jumbo_sge_pkts; uint32_t rx_soft_errors; uint32_t rx_hw_csum_errors; uint32_t rx_ofld_frames_csum_ip; @@ -318,6 +319,7 @@ struct bxe_eth_q_stats { uint32_t rx_calls; uint32_t rx_pkts; uint32_t rx_tpa_pkts; + uint32_t rx_jumbo_sge_pkts; uint32_t rx_soft_errors; uint32_t rx_hw_csum_errors; uint32_t rx_ofld_frames_csum_ip; @@ -411,6 +413,7 @@ struct bxe_eth_q_stats_old { uint32_t rx_calls_old; uint32_t rx_pkts_old; uint32_t rx_tpa_pkts_old; + uint32_t rx_jumbo_sge_pkts_old; uint32_t rx_soft_errors_old; uint32_t rx_hw_csum_errors_old; uint32_t rx_ofld_frames_csum_ip_old;