Deleted Added
full compact
if_igb.c (229939) if_igb.c (231796)
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_igb.c 229939 2012-01-10 19:57:23Z luigi $*/
33/*$FreeBSD: head/sys/dev/e1000/if_igb.c 231796 2012-02-15 23:13:29Z luigi $*/
34
35
36#ifdef HAVE_KERNEL_OPTION_HEADERS
37#include "opt_device_polling.h"
38#include "opt_inet.h"
39#include "opt_inet6.h"
40#include "opt_altq.h"
41#endif

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

3310 bus_dmamap_sync(txr->txtag, txbuf->map,
3311 BUS_DMASYNC_POSTWRITE);
3312 bus_dmamap_unload(txr->txtag, txbuf->map);
3313 m_freem(txbuf->m_head);
3314 txbuf->m_head = NULL;
3315 }
3316#ifdef DEV_NETMAP
3317 if (slot) {
34
35
36#ifdef HAVE_KERNEL_OPTION_HEADERS
37#include "opt_device_polling.h"
38#include "opt_inet.h"
39#include "opt_inet6.h"
40#include "opt_altq.h"
41#endif

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

3310 bus_dmamap_sync(txr->txtag, txbuf->map,
3311 BUS_DMASYNC_POSTWRITE);
3312 bus_dmamap_unload(txr->txtag, txbuf->map);
3313 m_freem(txbuf->m_head);
3314 txbuf->m_head = NULL;
3315 }
3316#ifdef DEV_NETMAP
3317 if (slot) {
3318 /* slot si is mapped to the i-th NIC-ring entry */
3319 int si = i + na->tx_rings[txr->me].nkr_hwofs;
3320
3321 if (si < 0)
3322 si += na->num_tx_desc;
3318 int si = netmap_tidx_n2k(na, txr->me, i);
3319 /* no need to set the address */
3323 netmap_load_map(txr->txtag, txbuf->map, NMB(slot + si));
3324 }
3325#endif /* DEV_NETMAP */
3326 /* clear the watch index */
3327 txbuf->next_eop = -1;
3328 }
3329
3330 /* Set number of descriptors available */

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

4055 /* Now replenish the ring mbufs */
4056 for (int j = 0; j < adapter->num_rx_desc; ++j) {
4057 struct mbuf *mh, *mp;
4058
4059 rxbuf = &rxr->rx_buffers[j];
4060#ifdef DEV_NETMAP
4061 if (slot) {
4062 /* slot sj is mapped to the i-th NIC-ring entry */
3320 netmap_load_map(txr->txtag, txbuf->map, NMB(slot + si));
3321 }
3322#endif /* DEV_NETMAP */
3323 /* clear the watch index */
3324 txbuf->next_eop = -1;
3325 }
3326
3327 /* Set number of descriptors available */

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

4052 /* Now replenish the ring mbufs */
4053 for (int j = 0; j < adapter->num_rx_desc; ++j) {
4054 struct mbuf *mh, *mp;
4055
4056 rxbuf = &rxr->rx_buffers[j];
4057#ifdef DEV_NETMAP
4058 if (slot) {
4059 /* slot sj is mapped to the i-th NIC-ring entry */
4063 int sj = j + na->rx_rings[rxr->me].nkr_hwofs;
4060 int sj = netmap_ridx_n2k(na, rxr->me, j);
4064 uint64_t paddr;
4065 void *addr;
4066
4061 uint64_t paddr;
4062 void *addr;
4063
4067 if (sj < 0)
4068 sj += na->num_rx_desc;
4069 addr = PNMB(slot + sj, &paddr);
4070 netmap_load_map(rxr->ptag, rxbuf->pmap, addr);
4071 /* Update descriptor */
4072 rxr->rx_base[j].read.pkt_addr = htole64(paddr);
4073 continue;
4074 }
4075#endif /* DEV_NETMAP */
4076 if (rxr->hdr_split == FALSE)

--- 1762 unchanged lines hidden ---
4064 addr = PNMB(slot + sj, &paddr);
4065 netmap_load_map(rxr->ptag, rxbuf->pmap, addr);
4066 /* Update descriptor */
4067 rxr->rx_base[j].read.pkt_addr = htole64(paddr);
4068 continue;
4069 }
4070#endif /* DEV_NETMAP */
4071 if (rxr->hdr_split == FALSE)

--- 1762 unchanged lines hidden ---