sfc: Fix efx_rx_buf_offset() in the presence of swiotlb
authorBen Hutchings <bhutchings@solarflare.com>
Thu, 10 Jan 2013 23:51:54 +0000 (23:51 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 27 Mar 2013 02:41:09 +0000 (02:41 +0000)
commit7a825480915c0d846c3f152f210fe22a5cc7a95f
treea1fd44e9ec1b0708cbe242b3c2eeca43cce8645e
parent2abb802779b6dca5bafa8a16923ea222189a35cc
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.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/ethernet/sfc/net_driver.h
drivers/net/ethernet/sfc/rx.c