diff options
author | luigi <luigi@FreeBSD.org> | 2012-02-27 19:05:01 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2012-02-27 19:05:01 +0000 |
commit | 3ac0fcfb9762b2fd4991f32bff09543ba13df0d0 (patch) | |
tree | a547096f4399bc66370c43d717a40e4b79eb8401 /sys/dev/e1000/if_em.c | |
parent | 71d18727cc7b50dc4e7c4d02cab4232fd4b10711 (diff) | |
download | FreeBSD-src-3ac0fcfb9762b2fd4991f32bff09543ba13df0d0.zip FreeBSD-src-3ac0fcfb9762b2fd4991f32bff09543ba13df0d0.tar.gz |
A bunch of netmap fixes:
USERSPACE:
1. add support for devices with different number of rx and tx queues;
2. add better support for zero-copy operation, adding an extra field
to the netmap ring to indicate how many buffers we have already processed
but not yet released (with help from Eddie Kohler);
3. The two changes above unfortunately require an API change, so while
at it add a version field and some spares to the ioctl() argument
to help detect mismatches.
4. update the manual page for the two changes above;
5. update sample applications in tools/tools/netmap
KERNEL:
1. simplify the internal structures moving the global wait queues
to the 'struct netmap_adapter';
2. simplify the functions that map kring<->nic ring indexes
3. normalize device-specific code, helps mainteinance;
4. start exploring the impact of micro-optimizations (prefetch etc.)
in the ixgbe driver.
Use 'legacy' descriptors on the tx ring and prefetch slots gives
about 20% speedup at 900 MHz. Another 7-10% would come from removing
the explict calls to bus_dmamap* in the core (they are effectively
NOPs in this case, but it takes expensive load of the per-buffer
dma maps to figure out that they are all NULL.
Rx performance not investigated.
I am postponing the MFC so i can import a few more improvements
before merging.
Diffstat (limited to 'sys/dev/e1000/if_em.c')
-rw-r--r-- | sys/dev/e1000/if_em.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 9495c79..8ab511d 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -3296,7 +3296,7 @@ em_setup_transmit_ring(struct tx_ring *txr) } #ifdef DEV_NETMAP if (slot) { - int si = netmap_tidx_n2k(na, txr->me, i); + int si = netmap_idx_n2k(&na->tx_rings[txr->me], i); uint64_t paddr; void *addr; @@ -3759,7 +3759,7 @@ em_txeof(struct tx_ring *txr) selwakeuppri(&na->tx_rings[txr->me].si, PI_NET); EM_TX_UNLOCK(txr); EM_CORE_LOCK(adapter); - selwakeuppri(&na->tx_rings[na->num_queues + 1].si, PI_NET); + selwakeuppri(&na->tx_si, PI_NET); EM_CORE_UNLOCK(adapter); EM_TX_LOCK(txr); return (FALSE); @@ -4051,7 +4051,7 @@ em_setup_receive_ring(struct rx_ring *rxr) rxbuf = &rxr->rx_buffers[j]; #ifdef DEV_NETMAP if (slot) { - int si = netmap_ridx_n2k(na, rxr->me, j); + int si = netmap_idx_n2k(&na->rx_rings[rxr->me], j); uint64_t paddr; void *addr; @@ -4370,10 +4370,11 @@ em_rxeof(struct rx_ring *rxr, int count, int *done) if (ifp->if_capenable & IFCAP_NETMAP) { struct netmap_adapter *na = NA(ifp); + na->rx_rings[rxr->me].nr_kflags |= NKR_PENDINTR; selwakeuppri(&na->rx_rings[rxr->me].si, PI_NET); EM_RX_UNLOCK(rxr); EM_CORE_LOCK(adapter); - selwakeuppri(&na->rx_rings[na->num_queues + 1].si, PI_NET); + selwakeuppri(&na->rx_si, PI_NET); EM_CORE_UNLOCK(adapter); return (0); } |