]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
ixgbe: use rx_buffer_info->dma instead of nr_frags to determine skb unmap
authorAlexander Duyck <alexander.h.duyck@intel.com>
Thu, 4 Jun 2009 15:59:49 +0000 (15:59 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 7 Jun 2009 12:20:20 +0000 (05:20 -0700)
This patch changes the driver so that it uses rx_buffer_info->dma to
determine if it needs to unmap the page instead of sh_info->nr_frags.  This
helps to prevent a cache line miss when receiving small packets as the
rx_buffer_info data should already be in the cache.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ixgbe/ixgbe_main.c

index 9684632f15b86233334d53af90b9b99ee634aa5d..e1efa1d7df4ebd4646467cc5e097f203e842a087 100644 (file)
@@ -708,7 +708,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
                prefetch(skb->data - NET_IP_ALIGN);
                rx_buffer_info->skb = NULL;
 
-               if (len && !skb_shinfo(skb)->nr_frags) {
+               if (rx_buffer_info->dma) {
                        pci_unmap_single(pdev, rx_buffer_info->dma,
                                         rx_ring->rx_buf_len,
                                         PCI_DMA_FROMDEVICE);