Skip to content

Commit

Permalink
igb: fix panic while dumping packets on Tx hang with IOMMU
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Emil Tantilov authored and Peter P Waskiewicz Jr committed Aug 9, 2012
1 parent 3647101 commit b669588
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions drivers/net/ethernet/intel/igb/igb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,10 @@ static void igb_dump(struct igb_adapter *adapter)
(u64)buffer_info->time_stamp,
buffer_info->skb, next_desc);

if (netif_msg_pktdata(adapter) && buffer_info->dma != 0)
if (netif_msg_pktdata(adapter) && buffer_info->skb)
print_hex_dump(KERN_INFO, "",
DUMP_PREFIX_ADDRESS,
16, 1, phys_to_virt(buffer_info->dma),
16, 1, buffer_info->skb->data,
buffer_info->length, true);
}
}
Expand Down Expand Up @@ -547,18 +547,17 @@ static void igb_dump(struct igb_adapter *adapter)
(u64)buffer_info->dma,
buffer_info->skb, next_desc);

if (netif_msg_pktdata(adapter)) {
if (netif_msg_pktdata(adapter) &&
buffer_info->dma && buffer_info->skb) {
print_hex_dump(KERN_INFO, "",
DUMP_PREFIX_ADDRESS,
16, 1,
phys_to_virt(buffer_info->dma),
IGB_RX_HDR_LEN, true);
DUMP_PREFIX_ADDRESS,
16, 1, buffer_info->skb->data,
IGB_RX_HDR_LEN, true);
print_hex_dump(KERN_INFO, "",
DUMP_PREFIX_ADDRESS,
16, 1,
phys_to_virt(
buffer_info->page_dma +
buffer_info->page_offset),
page_address(buffer_info->page) +
buffer_info->page_offset,
PAGE_SIZE/2, true);
}
}
Expand Down

0 comments on commit b669588

Please sign in to comment.