summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/net_driver.h
diff options
context:
space:
mode:
authorAlexandre Rames2013-10-31 13:42:32 +0100
committerBen Hutchings2013-10-31 21:58:14 +0100
commit2acdb92e85412bf791a3c01f2173695b6e0a3f72 (patch)
tree9ba015810efc7ba0e2eb35827310853eccc437e5 /drivers/net/ethernet/sfc/net_driver.h
parentipv6: remove the unnecessary statement in find_match() (diff)
downloadkernel-qcow2-linux-2acdb92e85412bf791a3c01f2173695b6e0a3f72.tar.gz
kernel-qcow2-linux-2acdb92e85412bf791a3c01f2173695b6e0a3f72.tar.xz
kernel-qcow2-linux-2acdb92e85412bf791a3c01f2173695b6e0a3f72.zip
sfc: Fix DMA unmapping issue with firmware assisted TSO
When using firmware assisted TSO, we use a single DMA mapping for the linear area of a TSO skb. We still have to segment the super-packet and insert a descriptor containing the original headers before each segment of payload, so we can unmap the linear area only after the last segment is completed. The unmapping information for the linear area is therefore associated with the last header descriptor. We calculate the DMA address to unmap from using the map length and the invariant that the end of the DMA mapping matches the end of the data referenced by the last descriptor. But this invariant is broken when there is TCP payload in the linear area. Fix this by adding and using an explicit dma_offset field. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet/sfc/net_driver.h')
-rw-r--r--drivers/net/ethernet/sfc/net_driver.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index aac22a1e85b8..b14a717ac3e8 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -141,6 +141,8 @@ struct efx_special_buffer {
* @len: Length of this fragment.
* This field is zero when the queue slot is empty.
* @unmap_len: Length of this fragment to unmap
+ * @dma_offset: Offset of @dma_addr from the address of the backing DMA mapping.
+ * Only valid if @unmap_len != 0.
*/
struct efx_tx_buffer {
union {
@@ -154,6 +156,7 @@ struct efx_tx_buffer {
unsigned short flags;
unsigned short len;
unsigned short unmap_len;
+ unsigned short dma_offset;
};
#define EFX_TX_BUF_CONT 1 /* not last descriptor of packet */
#define EFX_TX_BUF_SKB 2 /* buffer is last part of skb */