fix the build using __builtin_prefetch() instead of redefining prefetch()

This commit is contained in:
Luigi Rizzo 2013-12-16 23:57:43 +00:00
parent c826a64307
commit 2e159ef0b5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=259487
3 changed files with 5 additions and 8 deletions

View file

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

View file

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

View file

@ -79,8 +79,6 @@ __FBSDID("$FreeBSD$");
#include <sys/endian.h>
#include <sys/refcount.h>
// #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++;