aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/net_driver.h
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2013-01-10 23:51:54 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-28 12:06:01 -0700
commit67d8c1035e0c960a3d41abe532ea868bb3985f22 (patch)
tree9f08673bbb83325b1a7cf771ef20b6906d938cd7 /drivers/net/sfc/net_driver.h
parentbbd3cfb8cbb326f32f1daec0ea6ffbf855a7ecc8 (diff)
downloadkernel_samsung_smdk4412-67d8c1035e0c960a3d41abe532ea868bb3985f22.zip
kernel_samsung_smdk4412-67d8c1035e0c960a3d41abe532ea868bb3985f22.tar.gz
kernel_samsung_smdk4412-67d8c1035e0c960a3d41abe532ea868bb3985f22.tar.bz2
sfc: Fix efx_rx_buf_offset() in the presence of swiotlb
[ Upstream commits 06e63c57acbb1df7c35ebe846ae416a8b88dfafa, b590ace09d51cd39744e0f7662c5e4a0d1b5d952 and c73e787a8db9117d59b5180baf83203a42ecadca ] We assume that the mapping between DMA and virtual addresses is done on whole pages, so we can find the page offset of an RX buffer using the lower bits of the DMA address. However, swiotlb maps in units of 2K, breaking this assumption. Add an explicit page_offset field to struct efx_rx_buffer. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> [bwh: Backported to 3.0: adjust context] Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/sfc/net_driver.h')
-rw-r--r--drivers/net/sfc/net_driver.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h
index 47aff8e..2f932c5 100644
--- a/drivers/net/sfc/net_driver.h
+++ b/drivers/net/sfc/net_driver.h
@@ -214,6 +214,7 @@ struct efx_tx_queue {
* If both this and page are %NULL, the buffer slot is currently free.
* @page: The associated page buffer, if any.
* If both this and skb are %NULL, the buffer slot is currently free.
+ * @page_offset: Offset within page. Valid iff @flags & %EFX_RX_BUF_PAGE.
* @len: Buffer length, in bytes.
* @is_page: Indicates if @page is valid. If false, @skb is valid.
*/
@@ -223,7 +224,8 @@ struct efx_rx_buffer {
struct sk_buff *skb;
struct page *page;
} u;
- unsigned int len;
+ u16 page_offset;
+ u16 len;
bool is_page;
};