diff options
author | Emil Tantilov <emil.s.tantilov@intel.com> | 2012-08-01 04:12:21 -0400 |
---|---|---|
committer | Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> | 2012-08-09 05:36:05 -0400 |
commit | f0c5dadff3fbda77a65b8577fee437c3d771233d (patch) | |
tree | 292f9eef98bcbd2ec2aa359c6ef50517b0f624d6 /drivers/net/ethernet | |
parent | b669588abaceb5c6d70699b6c009e5cedc42449b (diff) |
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: 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>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/intel/e1000e/netdev.c | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index 95b245310f17..46c3b1f9ff89 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c | |||
@@ -178,6 +178,24 @@ static void e1000_regdump(struct e1000_hw *hw, struct e1000_reg_info *reginfo) | |||
178 | pr_info("%-15s %08x %08x\n", rname, regs[0], regs[1]); | 178 | pr_info("%-15s %08x %08x\n", rname, regs[0], regs[1]); |
179 | } | 179 | } |
180 | 180 | ||
181 | static void e1000e_dump_ps_pages(struct e1000_adapter *adapter, | ||
182 | struct e1000_buffer *bi) | ||
183 | { | ||
184 | int i; | ||
185 | struct e1000_ps_page *ps_page; | ||
186 | |||
187 | for (i = 0; i < adapter->rx_ps_pages; i++) { | ||
188 | ps_page = &bi->ps_pages[i]; | ||
189 | |||
190 | if (ps_page->page) { | ||
191 | pr_info("packet dump for ps_page %d:\n", i); | ||
192 | print_hex_dump(KERN_INFO, "", DUMP_PREFIX_ADDRESS, | ||
193 | 16, 1, page_address(ps_page->page), | ||
194 | PAGE_SIZE, true); | ||
195 | } | ||
196 | } | ||
197 | } | ||
198 | |||
181 | /* | 199 | /* |
182 | * e1000e_dump - Print registers, Tx-ring and Rx-ring | 200 | * e1000e_dump - Print registers, Tx-ring and Rx-ring |
183 | */ | 201 | */ |
@@ -299,10 +317,10 @@ static void e1000e_dump(struct e1000_adapter *adapter) | |||
299 | (unsigned long long)buffer_info->time_stamp, | 317 | (unsigned long long)buffer_info->time_stamp, |
300 | buffer_info->skb, next_desc); | 318 | buffer_info->skb, next_desc); |
301 | 319 | ||
302 | if (netif_msg_pktdata(adapter) && buffer_info->dma != 0) | 320 | if (netif_msg_pktdata(adapter) && buffer_info->skb) |
303 | print_hex_dump(KERN_INFO, "", DUMP_PREFIX_ADDRESS, | 321 | print_hex_dump(KERN_INFO, "", DUMP_PREFIX_ADDRESS, |
304 | 16, 1, phys_to_virt(buffer_info->dma), | 322 | 16, 1, buffer_info->skb->data, |
305 | buffer_info->length, true); | 323 | buffer_info->skb->len, true); |
306 | } | 324 | } |
307 | 325 | ||
308 | /* Print Rx Ring Summary */ | 326 | /* Print Rx Ring Summary */ |
@@ -381,10 +399,8 @@ rx_ring_summary: | |||
381 | buffer_info->skb, next_desc); | 399 | buffer_info->skb, next_desc); |
382 | 400 | ||
383 | if (netif_msg_pktdata(adapter)) | 401 | if (netif_msg_pktdata(adapter)) |
384 | print_hex_dump(KERN_INFO, "", | 402 | e1000e_dump_ps_pages(adapter, |
385 | DUMP_PREFIX_ADDRESS, 16, 1, | 403 | buffer_info); |
386 | phys_to_virt(buffer_info->dma), | ||
387 | adapter->rx_ps_bsize0, true); | ||
388 | } | 404 | } |
389 | } | 405 | } |
390 | break; | 406 | break; |
@@ -444,12 +460,12 @@ rx_ring_summary: | |||
444 | (unsigned long long)buffer_info->dma, | 460 | (unsigned long long)buffer_info->dma, |
445 | buffer_info->skb, next_desc); | 461 | buffer_info->skb, next_desc); |
446 | 462 | ||
447 | if (netif_msg_pktdata(adapter)) | 463 | if (netif_msg_pktdata(adapter) && |
464 | buffer_info->skb) | ||
448 | print_hex_dump(KERN_INFO, "", | 465 | print_hex_dump(KERN_INFO, "", |
449 | DUMP_PREFIX_ADDRESS, 16, | 466 | DUMP_PREFIX_ADDRESS, 16, |
450 | 1, | 467 | 1, |
451 | phys_to_virt | 468 | buffer_info->skb->data, |
452 | (buffer_info->dma), | ||
453 | adapter->rx_buffer_len, | 469 | adapter->rx_buffer_len, |
454 | true); | 470 | true); |
455 | } | 471 | } |