diff --git a/debian/changelog b/debian/changelog index 97096715e..9be6f6f99 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,8 @@ linux (3.16.7-3) UNRELEASED; urgency=medium [ Ian Campbell ] * [xen] Backport various netback fixes (Closes: #767261). + * Backport fix for TSO with mv643xx_eth driver, replacing previous workaround + (#764162) -- Ben Hutchings Sun, 09 Nov 2014 10:13:09 +0000 diff --git a/debian/patches/bugfix/all/net-mv643xx-disable-tso-by-default.patch b/debian/patches/bugfix/all/net-mv643xx-disable-tso-by-default.patch deleted file mode 100644 index f8dda00af..000000000 --- a/debian/patches/bugfix/all/net-mv643xx-disable-tso-by-default.patch +++ /dev/null @@ -1,42 +0,0 @@ -Subject: [1/1] net: mv643xx_eth: Make TSO disabled by default -From: Ezequiel Garcia -Date: Sat, 1 Nov 2014 12:30:20 -0300 -Origin: http://patchwork.ozlabs.org/patch/405792/ - -Data corruption has been observed to be produced by TSO. For instance, -accessing files on a NFS-server with TSO enabled results in different data -transferred each time. - -This has been observed only on Kirkwood platforms, i.e. with the mv643xx_eth -driver. Same tests on platforms using the mvneta ethernet driver have -passed without errors. - -Make TSO disabled by default for now, until we can found a proper fix -for the regression. - -Fixes: 3ae8f4e0b98 ('net: mv643xx_eth: Implement software TSO') -Reported-by: Slawomir Gajzner -Reported-by: Julien D'Ascenzio -Signed-off-by: Ezequiel Garcia ---- - drivers/net/ethernet/marvell/mv643xx_eth.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c -index b151a94..8b72780 100644 ---- a/drivers/net/ethernet/marvell/mv643xx_eth.c -+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c -@@ -3110,11 +3110,11 @@ static int mv643xx_eth_probe(struct platform_device *pdev) - dev->watchdog_timeo = 2 * HZ; - dev->base_addr = 0; - -- dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO; -+ dev->features = NETIF_F_SG | NETIF_F_IP_CSUM; - dev->vlan_features = dev->features; - - dev->features |= NETIF_F_RXCSUM; -- dev->hw_features = dev->features; -+ dev->hw_features = dev->features | NETIF_F_TSO; - - dev->priv_flags |= IFF_UNICAST_FLT; - dev->gso_max_segs = MV643XX_MAX_TSO_SEGS; diff --git a/debian/patches/bugfix/all/net-mv643xx_eth-reclaim-TX-skbs-only-when-released-b.patch b/debian/patches/bugfix/all/net-mv643xx_eth-reclaim-TX-skbs-only-when-released-b.patch new file mode 100644 index 000000000..0e3fd662c --- /dev/null +++ b/debian/patches/bugfix/all/net-mv643xx_eth-reclaim-TX-skbs-only-when-released-b.patch @@ -0,0 +1,75 @@ +From 2c2a9cbd64387d6b70ac5db013e9bfe9412c7354 Mon Sep 17 00:00:00 2001 +From: Karl Beldan +Date: Wed, 5 Nov 2014 15:32:59 +0100 +Subject: [PATCH] net: mv643xx_eth: reclaim TX skbs only when released by the + HW +Origin: https://git.kernel.org/cgit/linux/kernel/git/davem/net.git/commit/?id=2c2a9cbd64387d6b70ac5db013e9bfe9412c7354 + +ATM, txq_reclaim will dequeue and free an skb for each tx desc released +by the hw that has TX_LAST_DESC set. However, in case of TSO, each +hw desc embedding the last part of a segment has TX_LAST_DESC set, +losing the one-to-one 'last skb frag'/'TX_LAST_DESC set' correspondance, +which causes data corruption. + +Fix this by checking TX_ENABLE_INTERRUPT instead of TX_LAST_DESC, and +warn when trying to dequeue from an empty txq (which can be symptomatic +of releasing skbs prematurely). + +Fixes: 3ae8f4e0b98 ('net: mv643xx_eth: Implement software TSO') +Reported-by: Slawomir Gajzner +Reported-by: Julien D'Ascenzio +Signed-off-by: Karl Beldan +Cc: Ian Campbell +Cc: Eric Dumazet +Cc: Ezequiel Garcia +Cc: Sebastian Hesselbarth +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/marvell/mv643xx_eth.c | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c +index b151a94..d44560d 100644 +--- a/drivers/net/ethernet/marvell/mv643xx_eth.c ++++ b/drivers/net/ethernet/marvell/mv643xx_eth.c +@@ -1047,7 +1047,6 @@ static int txq_reclaim(struct tx_queue *txq, int budget, int force) + int tx_index; + struct tx_desc *desc; + u32 cmd_sts; +- struct sk_buff *skb; + + tx_index = txq->tx_used_desc; + desc = &txq->tx_desc_area[tx_index]; +@@ -1066,19 +1065,22 @@ static int txq_reclaim(struct tx_queue *txq, int budget, int force) + reclaimed++; + txq->tx_desc_count--; + +- skb = NULL; +- if (cmd_sts & TX_LAST_DESC) +- skb = __skb_dequeue(&txq->tx_skb); ++ if (!IS_TSO_HEADER(txq, desc->buf_ptr)) ++ dma_unmap_single(mp->dev->dev.parent, desc->buf_ptr, ++ desc->byte_cnt, DMA_TO_DEVICE); ++ ++ if (cmd_sts & TX_ENABLE_INTERRUPT) { ++ struct sk_buff *skb = __skb_dequeue(&txq->tx_skb); ++ ++ if (!WARN_ON(!skb)) ++ dev_kfree_skb(skb); ++ } + + if (cmd_sts & ERROR_SUMMARY) { + netdev_info(mp->dev, "tx error\n"); + mp->dev->stats.tx_errors++; + } + +- if (!IS_TSO_HEADER(txq, desc->buf_ptr)) +- dma_unmap_single(mp->dev->dev.parent, desc->buf_ptr, +- desc->byte_cnt, DMA_TO_DEVICE); +- dev_kfree_skb(skb); + } + + __netif_tx_unlock_bh(nq); +-- +1.7.10.4 + diff --git a/debian/patches/series b/debian/patches/series index 52ebe3b10..40514274f 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -145,7 +145,7 @@ bugfix/all/net-sctp-fix-skb_over_panic-when-receiving-malformed.patch bugfix/all/net-sctp-fix-panic-on-duplicate-ASCONF-chunks.patch bugfix/all/net-sctp-fix-remote-memory-pressure-from-excessive-q.patch bugfix/all/mnt-Prevent-pivot_root-from-creating-a-loop-in-the-m.patch -bugfix/all/net-mv643xx-disable-tso-by-default.patch +bugfix/all/net-mv643xx_eth-reclaim-TX-skbs-only-when-released-b.patch bugfix/all/xen-netback-Adding-debugfs-io_ring_qX-files.patch bugfix/all/xen-netback-Using-a-new-state-bit-instead-of-carrier.patch bugfix/all/xen-netback-Turn-off-the-carrier-if-the-guest-is-not.patch