From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 11:28:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBB7A106564A; Wed, 25 Jul 2012 11:28:15 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CD478FC1B; Wed, 25 Jul 2012 11:28:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6PBSFTw052577; Wed, 25 Jul 2012 11:28:15 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6PBSFlt052575; Wed, 25 Jul 2012 11:28:15 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201207251128.q6PBSFlt052575@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 25 Jul 2012 11:28:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238765 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 25 Jul 2012 11:28:15 -0000 Author: luigi Date: Wed Jul 25 11:28:15 2012 New Revision: 238765 URL: http://svn.freebsd.org/changeset/base/238765 Log: Use legacy interrupts as a default. This gives up to 10% speedup when used in qemu (and this driver is for non-PCIe cards, so probably its largest use is in virtualized environments). Approved by: Jack Vogel MFC after: 3 days Modified: head/sys/dev/e1000/if_lem.c Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Wed Jul 25 10:55:14 2012 (r238764) +++ head/sys/dev/e1000/if_lem.c Wed Jul 25 11:28:15 2012 (r238765) @@ -239,6 +239,7 @@ static void lem_enable_wakeup(device static int lem_enable_phy_wakeup(struct adapter *); static void lem_led_func(void *, int); +#define EM_LEGACY_IRQ /* slightly faster, at least in qemu */ #ifdef EM_LEGACY_IRQ static void lem_intr(void *); #else /* FAST IRQ */ @@ -1549,6 +1550,13 @@ lem_xmit(struct adapter *adapter, struct u32 txd_upper, txd_lower, txd_used, txd_saved; int error, nsegs, i, j, first, last = 0; +extern int netmap_drop; + if (netmap_drop == 95) { +dropme: + m_freem(*m_headp); + *m_headp = NULL; + return (ENOBUFS); + } m_head = *m_headp; txd_upper = txd_lower = txd_used = txd_saved = 0; @@ -1688,6 +1696,9 @@ lem_xmit(struct adapter *adapter, struct } } + if (netmap_drop == 96) + goto dropme; + adapter->next_avail_tx_desc = i; if (adapter->pcix_82544) @@ -1715,6 +1726,16 @@ lem_xmit(struct adapter *adapter, struct */ ctxd->lower.data |= htole32(E1000_TXD_CMD_EOP | E1000_TXD_CMD_RS); + +if (netmap_drop == 97) { + static int count=0; + if (count++ & 63 != 0) + ctxd->lower.data &= + ~htole32(E1000_TXD_CMD_RS); + else + D("preserve RS"); + +} /* * Keep track in the first buffer which * descriptor will be written back @@ -1733,6 +1754,12 @@ lem_xmit(struct adapter *adapter, struct adapter->link_duplex == HALF_DUPLEX) lem_82547_move_tail(adapter); else { +extern int netmap_repeat; + if (netmap_repeat) { + int x; + for (x = 0; x < netmap_repeat; x++) + E1000_WRITE_REG(&adapter->hw, E1000_TDT(0), i); + } E1000_WRITE_REG(&adapter->hw, E1000_TDT(0), i); if (adapter->hw.mac.type == e1000_82547) lem_82547_update_fifo_head(adapter, @@ -2986,6 +3013,13 @@ lem_txeof(struct adapter *adapter) return; } #endif /* DEV_NETMAP */ +{ + static int drops = 0; + if (netmap_copy && drops++ < netmap_copy) + return; + drops = 0; +} + if (adapter->num_tx_desc_avail == adapter->num_tx_desc) return;