diff options
author | Emil Tantilov <emil.s.tantilov@intel.com> | 2012-07-28 01:07:48 -0400 |
---|---|---|
committer | Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> | 2012-08-09 05:36:05 -0400 |
commit | b669588abaceb5c6d70699b6c009e5cedc42449b (patch) | |
tree | b268a3acb349a5cae8efd16b80a2d04efc5fc428 | |
parent | 36471012e2ae28ca3178f84d4687a2d88a36593e (diff) |
igb: fix panic while dumping packets on Tx hang with IOMMU
This patch resolves a "BUG: unable to handle kernel paging request at ..."
oops while dumping packet data. The issue occurs with IOMMU enabled due to
the address provided by phys_to_virt().
This patch avoids phys_to_virt() by making using skb->data and the address
of the pages allocated for Rx.
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
-rw-r--r-- | drivers/net/ethernet/intel/igb/igb_main.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index b7c2d5050572..48cc4fb1a307 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c | |||
@@ -462,10 +462,10 @@ static void igb_dump(struct igb_adapter *adapter) | |||
462 | (u64)buffer_info->time_stamp, | 462 | (u64)buffer_info->time_stamp, |
463 | buffer_info->skb, next_desc); | 463 | buffer_info->skb, next_desc); |
464 | 464 | ||
465 | if (netif_msg_pktdata(adapter) && buffer_info->dma != 0) | 465 | if (netif_msg_pktdata(adapter) && buffer_info->skb) |
466 | print_hex_dump(KERN_INFO, "", | 466 | print_hex_dump(KERN_INFO, "", |
467 | DUMP_PREFIX_ADDRESS, | 467 | DUMP_PREFIX_ADDRESS, |
468 | 16, 1, phys_to_virt(buffer_info->dma), | 468 | 16, 1, buffer_info->skb->data, |
469 | buffer_info->length, true); | 469 | buffer_info->length, true); |
470 | } | 470 | } |
471 | } | 471 | } |
@@ -547,18 +547,17 @@ rx_ring_summary: | |||
547 | (u64)buffer_info->dma, | 547 | (u64)buffer_info->dma, |
548 | buffer_info->skb, next_desc); | 548 | buffer_info->skb, next_desc); |
549 | 549 | ||
550 | if (netif_msg_pktdata(adapter)) { | 550 | if (netif_msg_pktdata(adapter) && |
551 | buffer_info->dma && buffer_info->skb) { | ||
551 | print_hex_dump(KERN_INFO, "", | 552 | print_hex_dump(KERN_INFO, "", |
552 | DUMP_PREFIX_ADDRESS, | 553 | DUMP_PREFIX_ADDRESS, |
553 | 16, 1, | 554 | 16, 1, buffer_info->skb->data, |
554 | phys_to_virt(buffer_info->dma), | 555 | IGB_RX_HDR_LEN, true); |
555 | IGB_RX_HDR_LEN, true); | ||
556 | print_hex_dump(KERN_INFO, "", | 556 | print_hex_dump(KERN_INFO, "", |
557 | DUMP_PREFIX_ADDRESS, | 557 | DUMP_PREFIX_ADDRESS, |
558 | 16, 1, | 558 | 16, 1, |
559 | phys_to_virt( | 559 | page_address(buffer_info->page) + |
560 | buffer_info->page_dma + | 560 | buffer_info->page_offset, |
561 | buffer_info->page_offset), | ||
562 | PAGE_SIZE/2, true); | 561 | PAGE_SIZE/2, true); |
563 | } | 562 | } |
564 | } | 563 | } |