Deleted Added
full compact
if_lem.c (298224) if_lem.c (299200)
1/******************************************************************************
2
3 Copyright (c) 2001-2015, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8

--- 16 unchanged lines hidden (view full) ---

25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31
32******************************************************************************/
1/******************************************************************************
2
3 Copyright (c) 2001-2015, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8

--- 16 unchanged lines hidden (view full) ---

25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31
32******************************************************************************/
33/*$FreeBSD: head/sys/dev/e1000/if_lem.c 298224 2016-04-18 20:33:44Z sbruno $*/
33/*$FreeBSD: head/sys/dev/e1000/if_lem.c 299200 2016-05-06 22:54:56Z pfg $*/
34
35/*
36 * Uncomment the following extensions for better performance in a VM,
37 * especially if you have support in the hypervisor.
38 * See http://info.iet.unipi.it/~luigi/netmap/
39 */
40// #define BATCH_DISPATCH
41// #define NIC_SEND_COMBINING

--- 2365 unchanged lines hidden (view full) ---

2407
2408 /*
2409 * These parameters control the automatic generation (Tx) and
2410 * response (Rx) to Ethernet PAUSE frames.
2411 * - High water mark should allow for at least two frames to be
2412 * received after sending an XOFF.
2413 * - Low water mark works best when it is very near the high water mark.
2414 * This allows the receiver to restart by sending XON when it has
34
35/*
36 * Uncomment the following extensions for better performance in a VM,
37 * especially if you have support in the hypervisor.
38 * See http://info.iet.unipi.it/~luigi/netmap/
39 */
40// #define BATCH_DISPATCH
41// #define NIC_SEND_COMBINING

--- 2365 unchanged lines hidden (view full) ---

2407
2408 /*
2409 * These parameters control the automatic generation (Tx) and
2410 * response (Rx) to Ethernet PAUSE frames.
2411 * - High water mark should allow for at least two frames to be
2412 * received after sending an XOFF.
2413 * - Low water mark works best when it is very near the high water mark.
2414 * This allows the receiver to restart by sending XON when it has
2415 * drained a bit. Here we use an arbitary value of 1500 which will
2415 * drained a bit. Here we use an arbitrary value of 1500 which will
2416 * restart after one full frame is pulled from the buffer. There
2417 * could be several smaller frames in the buffer and if so they will
2418 * not trigger the XON until their total number reduces the buffer
2419 * by 1500.
2420 * - The pause time is fairly large at 1000 x 512ns = 512 usec.
2421 */
2422 rx_buffer_size = ((E1000_READ_REG(&adapter->hw, E1000_PBA) &
2423 0xffff) << 10 );

--- 1409 unchanged lines hidden (view full) ---

3833 * as it nullifies DMA operations. 8254x just allows RX buffer size to be
3834 * 2048/4096/8192/16384. What we really want is 2048 - ETHER_ALIGN to align its
3835 * payload. On architecures without strict alignment restrictions 8254x still
3836 * performs unaligned memory access which would reduce the performance too.
3837 * To avoid copying over an entire frame to align, we allocate a new mbuf and
3838 * copy ethernet header to the new mbuf. The new mbuf is prepended into the
3839 * existing mbuf chain.
3840 *
2416 * restart after one full frame is pulled from the buffer. There
2417 * could be several smaller frames in the buffer and if so they will
2418 * not trigger the XON until their total number reduces the buffer
2419 * by 1500.
2420 * - The pause time is fairly large at 1000 x 512ns = 512 usec.
2421 */
2422 rx_buffer_size = ((E1000_READ_REG(&adapter->hw, E1000_PBA) &
2423 0xffff) << 10 );

--- 1409 unchanged lines hidden (view full) ---

3833 * as it nullifies DMA operations. 8254x just allows RX buffer size to be
3834 * 2048/4096/8192/16384. What we really want is 2048 - ETHER_ALIGN to align its
3835 * payload. On architecures without strict alignment restrictions 8254x still
3836 * performs unaligned memory access which would reduce the performance too.
3837 * To avoid copying over an entire frame to align, we allocate a new mbuf and
3838 * copy ethernet header to the new mbuf. The new mbuf is prepended into the
3839 * existing mbuf chain.
3840 *
3841 * Be aware, best performance of the 8254x is achived only when jumbo frame is
3841 * Be aware, best performance of the 8254x is achieved only when jumbo frame is
3842 * not used at all on architectures with strict alignment.
3843 */
3844static int
3845lem_fixup_rx(struct adapter *adapter)
3846{
3847 struct mbuf *m, *n;
3848 int error;
3849

--- 1025 unchanged lines hidden ---
3842 * not used at all on architectures with strict alignment.
3843 */
3844static int
3845lem_fixup_rx(struct adapter *adapter)
3846{
3847 struct mbuf *m, *n;
3848 int error;
3849

--- 1025 unchanged lines hidden ---