Commit b669588a authored by Emil Tantilov's avatar Emil Tantilov Committed by Peter P Waskiewicz Jr

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: default avatarEmil Tantilov <emil.s.tantilov@intel.com>
Tested-by: default avatarJeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: default avatarPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
parent 36471012
...@@ -462,10 +462,10 @@ static void igb_dump(struct igb_adapter *adapter) ...@@ -462,10 +462,10 @@ static void igb_dump(struct igb_adapter *adapter)
(u64)buffer_info->time_stamp, (u64)buffer_info->time_stamp,
buffer_info->skb, next_desc); 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, "", print_hex_dump(KERN_INFO, "",
DUMP_PREFIX_ADDRESS, DUMP_PREFIX_ADDRESS,
16, 1, phys_to_virt(buffer_info->dma), 16, 1, buffer_info->skb->data,
buffer_info->length, true); buffer_info->length, true);
} }
} }
...@@ -547,18 +547,17 @@ static void igb_dump(struct igb_adapter *adapter) ...@@ -547,18 +547,17 @@ static void igb_dump(struct igb_adapter *adapter)
(u64)buffer_info->dma, (u64)buffer_info->dma,
buffer_info->skb, next_desc); 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, "", print_hex_dump(KERN_INFO, "",
DUMP_PREFIX_ADDRESS, DUMP_PREFIX_ADDRESS,
16, 1, 16, 1, buffer_info->skb->data,
phys_to_virt(buffer_info->dma),
IGB_RX_HDR_LEN, true); IGB_RX_HDR_LEN, true);
print_hex_dump(KERN_INFO, "", print_hex_dump(KERN_INFO, "",
DUMP_PREFIX_ADDRESS, DUMP_PREFIX_ADDRESS,
16, 1, 16, 1,
phys_to_virt( page_address(buffer_info->page) +
buffer_info->page_dma + buffer_info->page_offset,
buffer_info->page_offset),
PAGE_SIZE/2, true); PAGE_SIZE/2, true);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment