Deleted Added
full compact
if_igb.c (229767) if_igb.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_igb.c 229767 2012-01-07 09:41:57Z kevlo $*/
33/*$FreeBSD: head/sys/dev/e1000/if_igb.c 229939 2012-01-10 19:57:23Z 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

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

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;
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

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

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;
3323 netmap_load_map(txr->txtag, txbuf->map,
3324 NMB(slot + si), na->buff_size);
3323 netmap_load_map(txr->txtag, txbuf->map, NMB(slot + si));
3325 }
3326#endif /* DEV_NETMAP */
3327 /* clear the watch index */
3328 txbuf->next_eop = -1;
3329 }
3330
3331 /* Set number of descriptors available */
3332 txr->tx_avail = adapter->num_tx_desc;

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

4057 for (int j = 0; j < adapter->num_rx_desc; ++j) {
4058 struct mbuf *mh, *mp;
4059
4060 rxbuf = &rxr->rx_buffers[j];
4061#ifdef DEV_NETMAP
4062 if (slot) {
4063 /* slot sj is mapped to the i-th NIC-ring entry */
4064 int sj = j + na->rx_rings[rxr->me].nkr_hwofs;
3324 }
3325#endif /* DEV_NETMAP */
3326 /* clear the watch index */
3327 txbuf->next_eop = -1;
3328 }
3329
3330 /* Set number of descriptors available */
3331 txr->tx_avail = adapter->num_tx_desc;

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

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 */
4063 int sj = j + na->rx_rings[rxr->me].nkr_hwofs;
4064 uint64_t paddr;
4065 void *addr;
4066
4067 if (sj < 0)
4068 sj += na->num_rx_desc;
4065 void *addr;
4066
4067 if (sj < 0)
4068 sj += na->num_rx_desc;
4069 addr = NMB(slot + sj);
4070 netmap_load_map(rxr->ptag,
4071 rxbuf->pmap, addr, na->buff_size);
4069 addr = PNMB(slot + sj, &paddr);
4070 netmap_load_map(rxr->ptag, rxbuf->pmap, addr);
4072 /* Update descriptor */
4071 /* Update descriptor */
4073 rxr->rx_base[j].read.pkt_addr = htole64(vtophys(addr));
4072 rxr->rx_base[j].read.pkt_addr = htole64(paddr);
4074 continue;
4075 }
4076#endif /* DEV_NETMAP */
4077 if (rxr->hdr_split == FALSE)
4078 goto skip_head;
4079
4080 /* First the header */
4081 rxbuf->m_head = m_gethdr(M_DONTWAIT, MT_DATA);

--- 1758 unchanged lines hidden ---
4073 continue;
4074 }
4075#endif /* DEV_NETMAP */
4076 if (rxr->hdr_split == FALSE)
4077 goto skip_head;
4078
4079 /* First the header */
4080 rxbuf->m_head = m_gethdr(M_DONTWAIT, MT_DATA);

--- 1758 unchanged lines hidden ---