diff --git a/sys/dev/netmap/ixgbe_netmap.h b/sys/dev/netmap/ixgbe_netmap.h index 7fd67d2b57ff..4dea6639d325 100644 --- a/sys/dev/netmap/ixgbe_netmap.h +++ b/sys/dev/netmap/ixgbe_netmap.h @@ -220,8 +220,8 @@ ixgbe_netmap_txsync(struct netmap_adapter *na, u_int ring_nr, int flags) if (nm_i != cur) { /* we have new packets to send */ nic_i = netmap_idx_k2n(kring, nm_i); - prefetch(&ring->slot[nm_i]); - prefetch(&txr->tx_buffers[nic_i]); + __builtin_prefetch(&ring->slot[nm_i]); + __builtin_prefetch(&txr->tx_buffers[nic_i]); for (n = 0; nm_i != cur; n++) { struct netmap_slot *slot = &ring->slot[nm_i]; @@ -237,8 +237,8 @@ ixgbe_netmap_txsync(struct netmap_adapter *na, u_int ring_nr, int flags) IXGBE_TXD_CMD_RS : 0; /* prefetch for next round */ - prefetch(&ring->slot[nm_i + 1]); - prefetch(&txr->tx_buffers[nic_i + 1]); + __builtin_prefetch(&ring->slot[nm_i + 1]); + __builtin_prefetch(&txr->tx_buffers[nic_i + 1]); NM_CHECK_ADDR_LEN(addr, len); diff --git a/sys/dev/netmap/netmap_kern.h b/sys/dev/netmap/netmap_kern.h index c009f5e62684..9381cd4cedd3 100644 --- a/sys/dev/netmap/netmap_kern.h +++ b/sys/dev/netmap/netmap_kern.h @@ -61,7 +61,6 @@ #define NM_ATOMIC_TEST_AND_SET(p) (!atomic_cmpset_acq_int((p), 0, 1)) #define NM_ATOMIC_CLEAR(p) atomic_store_rel_int((p), 0) -#define prefetch(x) __builtin_prefetch(x) MALLOC_DECLARE(M_NETMAP); diff --git a/sys/dev/netmap/netmap_vale.c b/sys/dev/netmap/netmap_vale.c index e0ce94cccb7d..32d6422de120 100644 --- a/sys/dev/netmap/netmap_vale.c +++ b/sys/dev/netmap/netmap_vale.c @@ -79,8 +79,6 @@ __FBSDID("$FreeBSD$"); #include #include -// #define prefetch(x) __builtin_prefetch(x) - #define BDG_RWLOCK_T struct rwlock // struct rwlock @@ -1003,7 +1001,7 @@ nm_bdg_preflush(struct netmap_vp_adapter *na, u_int ring_nr, ft[ft_i].ft_next = NM_FT_NULL; buf = ft[ft_i].ft_buf = (slot->flags & NS_INDIRECT) ? (void *)(uintptr_t)slot->ptr : BDG_NMB(&na->up, slot); - prefetch(buf); + __builtin_prefetch(buf); ++ft_i; if (slot->flags & NS_MOREFRAG) { frags++;