From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 7 23:14:56 2014 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E48D022F; Tue, 7 Jan 2014 23:14:55 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C48A7195C; Tue, 7 Jan 2014 23:14:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s07NEt9K047305; Tue, 7 Jan 2014 23:14:55 GMT (envelope-from edavis@svn.freebsd.org) Received: (from edavis@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s07NEtRV047302; Tue, 7 Jan 2014 23:14:55 GMT (envelope-from edavis@svn.freebsd.org) Message-Id: <201401072314.s07NEtRV047302@svn.freebsd.org> From: Eric Davis Date: Tue, 7 Jan 2014 23:14:55 +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: r260424 - 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.17 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: Tue, 07 Jan 2014 23:14:56 -0000 Author: edavis Date: Tue Jan 7 23:14:55 2014 New Revision: 260424 URL: http://svnweb.freebsd.org/changeset/base/260424 Log: Merged r260415 from head. Approved by: davidcd Modified: stable/8/sys/dev/bxe/bxe.c stable/8/sys/dev/bxe/ecore_hsi.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 Tue Jan 7 23:04:06 2014 (r260423) +++ stable/8/sys/dev/bxe/bxe.c Tue Jan 7 23:14:55 2014 (r260424) @@ -34,7 +34,7 @@ #include __FBSDID("$FreeBSD$"); -#define BXE_DRIVER_VERSION "1.78.76" +#define BXE_DRIVER_VERSION "1.78.77" #include "bxe.h" #include "ecore_sp.h" @@ -5509,10 +5509,31 @@ bxe_tx_encap(struct bxe_fastpath *fp, st fp->eth_q_stats.tx_window_violation_std++; } - /* XXX I don't like this, change to double copy packet */ + /* lets try to defragment this mbuf */ + fp->eth_q_stats.mbuf_defrag_attempts++; - /* no sense trying to defrag again, just drop the frame */ - rc = ENODEV; + m0 = m_defrag(*m_head, M_DONTWAIT); + if (m0 == NULL) { + fp->eth_q_stats.mbuf_defrag_failures++; + /* Ugh, just drop the frame... :( */ + rc = ENOBUFS; + } else { + /* defrag successful, try mapping again */ + *m_head = m0; + error = bus_dmamap_load_mbuf_sg(fp->tx_mbuf_tag, + tx_buf->m_map, m0, + segs, &nsegs, BUS_DMA_NOWAIT); + if (error) { + fp->eth_q_stats.tx_dma_mapping_failure++; + /* No sense in trying to defrag/copy chain, drop it. :( */ + rc = error; + } + + /* if the chain is still too long then drop it */ + if (__predict_false(nsegs > 12)) { + rc = ENODEV; + } + } } bxe_tx_encap_continue: Modified: stable/8/sys/dev/bxe/ecore_hsi.h ============================================================================== --- stable/8/sys/dev/bxe/ecore_hsi.h Tue Jan 7 23:04:06 2014 (r260423) +++ stable/8/sys/dev/bxe/ecore_hsi.h Tue Jan 7 23:14:55 2014 (r260424) @@ -1305,6 +1305,13 @@ struct extended_dev_info_shared_cfg { #define EXTENDED_DEV_INFO_SHARED_CFG_SRIOV_SHOW_MENU 0x00000000 #define EXTENDED_DEV_INFO_SHARED_CFG_SRIOV_HIDE_MENU 0x00000200 + /* Overide PCIE revision ID when enabled the, + revision ID will set to B1=='0x11' */ + #define EXTENDED_DEV_INFO_SHARED_CFG_OVR_REV_ID_MASK 0x00000400 + #define EXTENDED_DEV_INFO_SHARED_CFG_OVR_REV_ID_SHIFT 10 + #define EXTENDED_DEV_INFO_SHARED_CFG_OVR_REV_ID_DISABLED 0x00000000 + #define EXTENDED_DEV_INFO_SHARED_CFG_OVR_REV_ID_ENABLED 0x00000400 + /* Threshold in celcius for max continuous operation */ uint32_t temperature_report; /* 0x4014 */ #define EXTENDED_DEV_INFO_SHARED_CFG_TEMP_MCOT_MASK 0x0000007F