[ofa-general] Re: [PATCH/RFC] IPoIB: Allocate priv->tx_ring with vmalloc()

Roland Dreier rdreier at cisco.com
Thu Mar 13 10:45:51 PDT 2008


 > Just curious why you think extra pointer indirection for each send is
 > worse than TLB misses taken by using vmalloc(), are the latter being
 > excepted very un often? Also assuming keeping the dma addresses at the
 > TX descriptor is a practice taken also by Ethernet drivers who do have
 > big send queues, maybe we should look there to see how this problem
 > was solved?

It's just a gut feeling.  Maybe it's wrong on sparc64 or powerpc where
the MMU isn't as good as the x86's.

As far as other ethernet drivers, using vmalloc seems fairly common:

e1000/e1000_main.c:   txdr->buffer_info = vmalloc(size);
e1000/e1000_main.c:   rxdr->buffer_info = vmalloc(size);

bnx2.c:       bp->rx_buf_ring = vmalloc(sizeof(struct sw_bd) * RX_DESC_CNT *

[bnx2x does the same thing but hides it in a macro]

ixgbe/ixgbe_main.c:   txdr->tx_buffer_info = vmalloc(size);
ixgbe/ixgbe_main.c:   rxdr->rx_buffer_info = vmalloc(size);

e1000e/netdev.c:      tx_ring->buffer_info = vmalloc(size);
e1000e/netdev.c:      rx_ring->buffer_info = vmalloc(size);

netxen/netxen_nic_main.c:     cmd_buf_arr = (struct netxen_cmd_buffer *)vmalloc(TX_RINGSIZE);

etc



More information about the general mailing list