Deleted Added
full compact
if_re.c (166178) if_re.c (166223)
1/*-
2 * Copyright (c) 1997, 1998-2003
3 * Bill Paul <wpaul@windriver.com>. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

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
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1997, 1998-2003
3 * Bill Paul <wpaul@windriver.com>. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

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
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/dev/re/if_re.c 166178 2007-01-23 00:44:12Z yongari $");
34__FBSDID("$FreeBSD: head/sys/dev/re/if_re.c 166223 2007-01-25 17:30:30Z wpaul $");
35
36/*
37 * RealTek 8139C+/8169/8169S/8110S/8168/8111/8101E PCI NIC driver
38 *
39 * Written by Bill Paul <wpaul@windriver.com>
40 * Senior Networking Software Engineer
41 * Wind River Systems
42 */

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

2066 * bytes in size, and IP header checksumming is enabled, the
2067 * resulting ethernet frame that appears on the wire will
2068 * have garbled payload. To work around this, if TX checksum
2069 * offload is enabled, we always manually pad short frames out
2070 * to the minimum ethernet frame size. We do this by pretending
2071 * the mbuf chain has too many fragments so the coalescing code
2072 * below can assemble the packet into a single buffer that's
2073 * padded out to the mininum frame size.
35
36/*
37 * RealTek 8139C+/8169/8169S/8110S/8168/8111/8101E PCI NIC driver
38 *
39 * Written by Bill Paul <wpaul@windriver.com>
40 * Senior Networking Software Engineer
41 * Wind River Systems
42 */

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

2066 * bytes in size, and IP header checksumming is enabled, the
2067 * resulting ethernet frame that appears on the wire will
2068 * have garbled payload. To work around this, if TX checksum
2069 * offload is enabled, we always manually pad short frames out
2070 * to the minimum ethernet frame size. We do this by pretending
2071 * the mbuf chain has too many fragments so the coalescing code
2072 * below can assemble the packet into a single buffer that's
2073 * padded out to the mininum frame size.
2074 *
2075 * Note: this appears unnecessary for TCP, and doing it for TCP
2076 * with PCIe adapters seems to result in bad checksums.
2074 */
2077 */
2075 if (arg.rl_flags && (*m_head)->m_pkthdr.len < RL_MIN_FRAMELEN)
2078
2079 if (arg.rl_flags && !(arg.rl_flags & RL_TDESC_CMD_TCPCSUM) &&
2080 (*m_head)->m_pkthdr.len < RL_MIN_FRAMELEN)
2076 error = EFBIG;
2077 else
2078 error = bus_dmamap_load_mbuf(sc->rl_ldata.rl_mtag, map,
2079 *m_head, re_dma_map_desc, &arg, BUS_DMA_NOWAIT);
2080
2081 if (error && error != EFBIG) {
2082 device_printf(sc->rl_dev, "can't map mbuf (error %d)\n", error);
2083 return (ENOBUFS);

--- 640 unchanged lines hidden ---
2081 error = EFBIG;
2082 else
2083 error = bus_dmamap_load_mbuf(sc->rl_ldata.rl_mtag, map,
2084 *m_head, re_dma_map_desc, &arg, BUS_DMA_NOWAIT);
2085
2086 if (error && error != EFBIG) {
2087 device_printf(sc->rl_dev, "can't map mbuf (error %d)\n", error);
2088 return (ENOBUFS);

--- 640 unchanged lines hidden ---