Netdev List
 help / color / mirror / Atom feed
* [net-2.6 PATCH 1/5] igb: fix unmap length bug
@ 2009-06-30 22:45 Jeff Kirsher
  2009-06-30 22:45 ` [net-2.6 PATCH 2/5] e1000: fix unmap bug Jeff Kirsher
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Jeff Kirsher @ 2009-06-30 22:45 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, Jesse Brandeburg, Jeff Kirsher

From: Jesse Brandeburg <jesse.brandeburg@intel.com>

driver was mixing NET_IP_ALIGN count bytes in map/unmap calls
unevenly. Only map the bytes that the hardware might dma into

also fix unmap related bug where ->dma was not being cleared
after unmap

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/igb/igb_main.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index ea17319..468356d 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -4549,11 +4549,12 @@ static bool igb_clean_rx_irq_adv(struct igb_ring *rx_ring,
 		cleaned = true;
 		cleaned_count++;
 
+		/* this is the fast path for the non-packet split case */
 		if (!adapter->rx_ps_hdr_size) {
 			pci_unmap_single(pdev, buffer_info->dma,
-					 adapter->rx_buffer_len +
-					   NET_IP_ALIGN,
+					 adapter->rx_buffer_len,
 					 PCI_DMA_FROMDEVICE);
+			buffer_info->dma = 0;
 			skb_put(skb, length);
 			goto send_up;
 		}
@@ -4570,8 +4571,9 @@ static bool igb_clean_rx_irq_adv(struct igb_ring *rx_ring,
 
 		if (!skb_shinfo(skb)->nr_frags) {
 			pci_unmap_single(pdev, buffer_info->dma,
-					 adapter->rx_ps_hdr_size + NET_IP_ALIGN,
+					 adapter->rx_ps_hdr_size,
 					 PCI_DMA_FROMDEVICE);
+			buffer_info->dma = 0;
 			skb_put(skb, hlen);
 		}
 
@@ -4713,7 +4715,6 @@ static void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring,
 		bufsz = adapter->rx_ps_hdr_size;
 	else
 		bufsz = adapter->rx_buffer_len;
-	bufsz += NET_IP_ALIGN;
 
 	while (cleaned_count--) {
 		rx_desc = E1000_RX_DESC_ADV(*rx_ring, i);
@@ -4737,7 +4738,7 @@ static void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring,
 		}
 
 		if (!buffer_info->skb) {
-			skb = netdev_alloc_skb(netdev, bufsz);
+			skb = netdev_alloc_skb(netdev, bufsz + NET_IP_ALIGN);
 			if (!skb) {
 				adapter->alloc_rx_buff_failed++;
 				goto no_buffers;


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-07-01  2:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-30 22:45 [net-2.6 PATCH 1/5] igb: fix unmap length bug Jeff Kirsher
2009-06-30 22:45 ` [net-2.6 PATCH 2/5] e1000: fix unmap bug Jeff Kirsher
2009-07-01  2:53   ` David Miller
2009-06-30 22:45 ` [net-2.6 PATCH 3/5] e1000e: io_error_detected callback should return PCI_ERS_RESULT_DISCONNECT Jeff Kirsher
2009-07-01  2:53   ` David Miller
2009-06-30 22:46 ` [net-2.6 PATCH 4/5] e1000: return PCI_ERS_RESULT_DISCONNECT on permanent error Jeff Kirsher
2009-07-01  2:53   ` David Miller
2009-06-30 22:46 ` [net-2.6 PATCH 5/5] igb: " Jeff Kirsher
2009-07-01  2:54   ` David Miller
2009-07-01  2:53 ` [net-2.6 PATCH 1/5] igb: fix unmap length bug David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox