Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153119459
D8282.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D8282.id.diff
View Options
Index: head/sys/dev/e1000/if_lem.c
===================================================================
--- head/sys/dev/e1000/if_lem.c
+++ head/sys/dev/e1000/if_lem.c
@@ -543,8 +543,16 @@
*/
adapter->hw.mac.report_tx_early = 1;
- tsize = roundup2(adapter->num_tx_desc * sizeof(struct e1000_tx_desc),
- EM_DBA_ALIGN);
+ /*
+ * It seems that the descriptor DMA engine on some PCI cards
+ * fetches memory past the end of the last descriptor in the
+ * ring. These reads are problematic when VT-d (DMAR) busdma
+ * is used. Allocate the scratch space to avoid getting
+ * faults from DMAR, by requesting scratch memory for one more
+ * descriptor.
+ */
+ tsize = roundup2((adapter->num_tx_desc + 1) *
+ sizeof(struct e1000_tx_desc), EM_DBA_ALIGN);
/* Allocate Transmit Descriptor ring */
if (lem_dma_malloc(adapter, tsize, &adapter->txdma, BUS_DMA_NOWAIT)) {
@@ -555,8 +563,11 @@
adapter->tx_desc_base =
(struct e1000_tx_desc *)adapter->txdma.dma_vaddr;
- rsize = roundup2(adapter->num_rx_desc * sizeof(struct e1000_rx_desc),
- EM_DBA_ALIGN);
+ /*
+ * See comment above txdma allocation for rationale behind +1.
+ */
+ rsize = roundup2((adapter->num_rx_desc + 1) *
+ sizeof(struct e1000_rx_desc), EM_DBA_ALIGN);
/* Allocate Receive Descriptor ring */
if (lem_dma_malloc(adapter, rsize, &adapter->rxdma, BUS_DMA_NOWAIT)) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 20, 7:21 AM (11 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31825242
Default Alt Text
D8282.id.diff (1 KB)
Attached To
Mode
D8282: Avoid some out-of-range DMA accesses with PCI intel ethernet adapters.
Attached
Detach File
Event Timeline
Log In to Comment