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

e1000e: 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 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 b669588a
...@@ -178,6 +178,24 @@ static void e1000_regdump(struct e1000_hw *hw, struct e1000_reg_info *reginfo) ...@@ -178,6 +178,24 @@ static void e1000_regdump(struct e1000_hw *hw, struct e1000_reg_info *reginfo)
pr_info("%-15s %08x %08x\n", rname, regs[0], regs[1]); pr_info("%-15s %08x %08x\n", rname, regs[0], regs[1]);
} }
static void e1000e_dump_ps_pages(struct e1000_adapter *adapter,
struct e1000_buffer *bi)
{
int i;
struct e1000_ps_page *ps_page;
for (i = 0; i < adapter->rx_ps_pages; i++) {
ps_page = &bi->ps_pages[i];
if (ps_page->page) {
pr_info("packet dump for ps_page %d:\n", i);
print_hex_dump(KERN_INFO, "", DUMP_PREFIX_ADDRESS,
16, 1, page_address(ps_page->page),
PAGE_SIZE, true);
}
}
}
/* /*
* e1000e_dump - Print registers, Tx-ring and Rx-ring * e1000e_dump - Print registers, Tx-ring and Rx-ring
*/ */
...@@ -299,10 +317,10 @@ static void e1000e_dump(struct e1000_adapter *adapter) ...@@ -299,10 +317,10 @@ static void e1000e_dump(struct e1000_adapter *adapter)
(unsigned long long)buffer_info->time_stamp, (unsigned long long)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, "", DUMP_PREFIX_ADDRESS, 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); buffer_info->skb->len, true);
} }
/* Print Rx Ring Summary */ /* Print Rx Ring Summary */
...@@ -381,10 +399,8 @@ static void e1000e_dump(struct e1000_adapter *adapter) ...@@ -381,10 +399,8 @@ static void e1000e_dump(struct e1000_adapter *adapter)
buffer_info->skb, next_desc); buffer_info->skb, next_desc);
if (netif_msg_pktdata(adapter)) if (netif_msg_pktdata(adapter))
print_hex_dump(KERN_INFO, "", e1000e_dump_ps_pages(adapter,
DUMP_PREFIX_ADDRESS, 16, 1, buffer_info);
phys_to_virt(buffer_info->dma),
adapter->rx_ps_bsize0, true);
} }
} }
break; break;
...@@ -444,12 +460,12 @@ static void e1000e_dump(struct e1000_adapter *adapter) ...@@ -444,12 +460,12 @@ static void e1000e_dump(struct e1000_adapter *adapter)
(unsigned long long)buffer_info->dma, (unsigned long long)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->skb)
print_hex_dump(KERN_INFO, "", print_hex_dump(KERN_INFO, "",
DUMP_PREFIX_ADDRESS, 16, DUMP_PREFIX_ADDRESS, 16,
1, 1,
phys_to_virt buffer_info->skb->data,
(buffer_info->dma),
adapter->rx_buffer_len, adapter->rx_buffer_len,
true); 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