mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
i40e: fix bug in dma sync
Driver was using an offset based off a DMA handle while mapping and unmapping using sync_single_range_for[cpu|device], where it should be using DMA handle (returned from alloc_coherent) and the offset of the memory to be sync'd. Change-ID: I208256565b1595ff0e9171ab852de06b997917c6 Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Reviewed-by: Nelson, Shannon <shannon.nelson@intel.com> Reviewed-by: Williams, Mitch A <mitch.a.williams@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
parent
d89d967f71
commit
3578fa0a8c
@ -1226,8 +1226,8 @@ void i40e_alloc_rx_buffers_ps(struct i40e_ring *rx_ring, u16 cleaned_count)
|
|||||||
}
|
}
|
||||||
|
|
||||||
dma_sync_single_range_for_device(rx_ring->dev,
|
dma_sync_single_range_for_device(rx_ring->dev,
|
||||||
bi->dma,
|
rx_ring->rx_bi[0].dma,
|
||||||
0,
|
i * rx_ring->rx_hdr_len,
|
||||||
rx_ring->rx_hdr_len,
|
rx_ring->rx_hdr_len,
|
||||||
DMA_FROM_DEVICE);
|
DMA_FROM_DEVICE);
|
||||||
/* Refresh the desc even if buffer_addrs didn't change
|
/* Refresh the desc even if buffer_addrs didn't change
|
||||||
@ -1542,8 +1542,8 @@ static int i40e_clean_rx_irq_ps(struct i40e_ring *rx_ring, int budget)
|
|||||||
skb_record_rx_queue(skb, rx_ring->queue_index);
|
skb_record_rx_queue(skb, rx_ring->queue_index);
|
||||||
/* we are reusing so sync this buffer for CPU use */
|
/* we are reusing so sync this buffer for CPU use */
|
||||||
dma_sync_single_range_for_cpu(rx_ring->dev,
|
dma_sync_single_range_for_cpu(rx_ring->dev,
|
||||||
rx_bi->dma,
|
rx_ring->rx_bi[0].dma,
|
||||||
0,
|
i * rx_ring->rx_hdr_len,
|
||||||
rx_ring->rx_hdr_len,
|
rx_ring->rx_hdr_len,
|
||||||
DMA_FROM_DEVICE);
|
DMA_FROM_DEVICE);
|
||||||
}
|
}
|
||||||
|
@ -700,8 +700,8 @@ void i40evf_alloc_rx_buffers_ps(struct i40e_ring *rx_ring, u16 cleaned_count)
|
|||||||
}
|
}
|
||||||
|
|
||||||
dma_sync_single_range_for_device(rx_ring->dev,
|
dma_sync_single_range_for_device(rx_ring->dev,
|
||||||
bi->dma,
|
rx_ring->rx_bi[0].dma,
|
||||||
0,
|
i * rx_ring->rx_hdr_len,
|
||||||
rx_ring->rx_hdr_len,
|
rx_ring->rx_hdr_len,
|
||||||
DMA_FROM_DEVICE);
|
DMA_FROM_DEVICE);
|
||||||
/* Refresh the desc even if buffer_addrs didn't change
|
/* Refresh the desc even if buffer_addrs didn't change
|
||||||
@ -1007,8 +1007,8 @@ static int i40e_clean_rx_irq_ps(struct i40e_ring *rx_ring, int budget)
|
|||||||
skb_record_rx_queue(skb, rx_ring->queue_index);
|
skb_record_rx_queue(skb, rx_ring->queue_index);
|
||||||
/* we are reusing so sync this buffer for CPU use */
|
/* we are reusing so sync this buffer for CPU use */
|
||||||
dma_sync_single_range_for_cpu(rx_ring->dev,
|
dma_sync_single_range_for_cpu(rx_ring->dev,
|
||||||
rx_bi->dma,
|
rx_ring->rx_bi[0].dma,
|
||||||
0,
|
i * rx_ring->rx_hdr_len,
|
||||||
rx_ring->rx_hdr_len,
|
rx_ring->rx_hdr_len,
|
||||||
DMA_FROM_DEVICE);
|
DMA_FROM_DEVICE);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user