Deleted Added
full compact
if_lem.c (229767) if_lem.c (229939)
1/******************************************************************************
2
3 Copyright (c) 2001-2011, 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-2011, 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 229767 2012-01-07 09:41:57Z kevlo $*/
33/*$FreeBSD: head/sys/dev/e1000/if_lem.c 229939 2012-01-10 19:57:23Z luigi $*/
34
35#ifdef HAVE_KERNEL_OPTION_HEADERS
36#include "opt_device_polling.h"
37#include "opt_inet.h"
38#include "opt_inet6.h"
39#endif
40
41#include <sys/param.h>

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

2665 BUS_DMASYNC_POSTWRITE);
2666 bus_dmamap_unload(adapter->txtag, tx_buffer->map);
2667 m_freem(tx_buffer->m_head);
2668 tx_buffer->m_head = NULL;
2669#ifdef DEV_NETMAP
2670 if (slot) {
2671 /* slot si is mapped to the i-th NIC-ring entry */
2672 int si = i + na->tx_rings[0].nkr_hwofs;
34
35#ifdef HAVE_KERNEL_OPTION_HEADERS
36#include "opt_device_polling.h"
37#include "opt_inet.h"
38#include "opt_inet6.h"
39#endif
40
41#include <sys/param.h>

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

2665 BUS_DMASYNC_POSTWRITE);
2666 bus_dmamap_unload(adapter->txtag, tx_buffer->map);
2667 m_freem(tx_buffer->m_head);
2668 tx_buffer->m_head = NULL;
2669#ifdef DEV_NETMAP
2670 if (slot) {
2671 /* slot si is mapped to the i-th NIC-ring entry */
2672 int si = i + na->tx_rings[0].nkr_hwofs;
2673 uint64_t paddr;
2673 void *addr;
2674
2675 if (si > na->num_tx_desc)
2676 si -= na->num_tx_desc;
2674 void *addr;
2675
2676 if (si > na->num_tx_desc)
2677 si -= na->num_tx_desc;
2677 addr = NMB(slot + si);
2678 adapter->tx_desc_base[si].buffer_addr =
2679 htole64(vtophys(addr));
2678 addr = PNMB(slot + si, &paddr);
2679 adapter->tx_desc_base[si].buffer_addr = htole64(paddr);
2680 /* reload the map for netmap mode */
2680 /* reload the map for netmap mode */
2681 netmap_load_map(adapter->txtag,
2682 tx_buffer->map, addr, na->buff_size);
2681 netmap_load_map(adapter->txtag, tx_buffer->map, addr);
2683 }
2684#endif /* DEV_NETMAP */
2685 tx_buffer->next_eop = -1;
2686 }
2687
2688 /* Reset state */
2689 adapter->last_hw_offload = 0;
2690 adapter->next_avail_tx_desc = 0;

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

3242 }
3243
3244 /* Allocate new ones. */
3245 for (i = 0; i < adapter->num_rx_desc; i++) {
3246#ifdef DEV_NETMAP
3247 if (slot) {
3248 /* slot si is mapped to the i-th NIC-ring entry */
3249 int si = i + na->rx_rings[0].nkr_hwofs;
2682 }
2683#endif /* DEV_NETMAP */
2684 tx_buffer->next_eop = -1;
2685 }
2686
2687 /* Reset state */
2688 adapter->last_hw_offload = 0;
2689 adapter->next_avail_tx_desc = 0;

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

3241 }
3242
3243 /* Allocate new ones. */
3244 for (i = 0; i < adapter->num_rx_desc; i++) {
3245#ifdef DEV_NETMAP
3246 if (slot) {
3247 /* slot si is mapped to the i-th NIC-ring entry */
3248 int si = i + na->rx_rings[0].nkr_hwofs;
3249 uint64_t paddr;
3250 void *addr;
3251
3252 if (si > na->num_rx_desc)
3253 si -= na->num_rx_desc;
3250 void *addr;
3251
3252 if (si > na->num_rx_desc)
3253 si -= na->num_rx_desc;
3254 addr = NMB(slot + si);
3255 netmap_load_map(adapter->rxtag,
3256 rx_buffer->map, addr, na->buff_size);
3254 addr = PNMB(slot + si, &paddr);
3255 netmap_load_map(adapter->rxtag, rx_buffer->map, addr);
3257 /* Update descriptor */
3256 /* Update descriptor */
3258 adapter->rx_desc_base[i].buffer_addr =
3259 htole64(vtophys(addr));
3257 adapter->rx_desc_base[i].buffer_addr = htole64(paddr);
3260 continue;
3261 }
3262#endif /* DEV_NETMAP */
3263 error = lem_get_buf(adapter, i);
3264 if (error)
3265 return (error);
3266 }
3267

--- 1432 unchanged lines hidden ---
3258 continue;
3259 }
3260#endif /* DEV_NETMAP */
3261 error = lem_get_buf(adapter, i);
3262 if (error)
3263 return (error);
3264 }
3265

--- 1432 unchanged lines hidden ---