stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	Prashant Sreedharan <prashant@broadcom.com>,
	Michael Chan <mchan@broadcom.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 3.16 11/17] tg3: Modify tg3_tso_bug() to handle multiple TX rings
Date: Fri,  8 Aug 2014 14:35:33 -0700	[thread overview]
Message-ID: <20140808213457.977999010@linuxfoundation.org> (raw)
In-Reply-To: <20140808213457.511493898@linuxfoundation.org>

3.16-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Prashant Sreedharan <prashant@broadcom.com>

[ Upstream commit 4d8fdc95c60e90d84c8257a0067ff4b1729a3757 ]

tg3_tso_bug() was originally designed to handle only HW TX ring 0, Commit
d3f6f3a1d818410c17445bce4f4caab52eb102f1 ("tg3: Prevent page allocation failure
during TSO workaround") changed the driver logic to use tg3_tso_bug() for all
HW TX rings that are enabled. This patch fixes the regression by modifying
tg3_tso_bug() to handle multiple HW TX rings.

Signed-off-by: Prashant Sreedharan <prashant@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/broadcom/tg3.c |   22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -7830,17 +7830,18 @@ static int tigon3_dma_hwbug_workaround(s
 
 static netdev_tx_t tg3_start_xmit(struct sk_buff *, struct net_device *);
 
-/* Use GSO to workaround a rare TSO bug that may be triggered when the
- * TSO header is greater than 80 bytes.
+/* Use GSO to workaround all TSO packets that meet HW bug conditions
+ * indicated in tg3_tx_frag_set()
  */
-static int tg3_tso_bug(struct tg3 *tp, struct sk_buff *skb)
+static int tg3_tso_bug(struct tg3 *tp, struct tg3_napi *tnapi,
+		       struct netdev_queue *txq, struct sk_buff *skb)
 {
 	struct sk_buff *segs, *nskb;
 	u32 frag_cnt_est = skb_shinfo(skb)->gso_segs * 3;
 
 	/* Estimate the number of fragments in the worst case */
-	if (unlikely(tg3_tx_avail(&tp->napi[0]) <= frag_cnt_est)) {
-		netif_stop_queue(tp->dev);
+	if (unlikely(tg3_tx_avail(tnapi) <= frag_cnt_est)) {
+		netif_tx_stop_queue(txq);
 
 		/* netif_tx_stop_queue() must be done before checking
 		 * checking tx index in tg3_tx_avail() below, because in
@@ -7848,13 +7849,14 @@ static int tg3_tso_bug(struct tg3 *tp, s
 		 * netif_tx_queue_stopped().
 		 */
 		smp_mb();
-		if (tg3_tx_avail(&tp->napi[0]) <= frag_cnt_est)
+		if (tg3_tx_avail(tnapi) <= frag_cnt_est)
 			return NETDEV_TX_BUSY;
 
-		netif_wake_queue(tp->dev);
+		netif_tx_wake_queue(txq);
 	}
 
-	segs = skb_gso_segment(skb, tp->dev->features & ~(NETIF_F_TSO | NETIF_F_TSO6));
+	segs = skb_gso_segment(skb, tp->dev->features &
+				    ~(NETIF_F_TSO | NETIF_F_TSO6));
 	if (IS_ERR(segs) || !segs)
 		goto tg3_tso_bug_end;
 
@@ -7930,7 +7932,7 @@ static netdev_tx_t tg3_start_xmit(struct
 		if (!skb_is_gso_v6(skb)) {
 			if (unlikely((ETH_HLEN + hdr_len) > 80) &&
 			    tg3_flag(tp, TSO_BUG))
-				return tg3_tso_bug(tp, skb);
+				return tg3_tso_bug(tp, tnapi, txq, skb);
 
 			ip_csum = iph->check;
 			ip_tot_len = iph->tot_len;
@@ -8061,7 +8063,7 @@ static netdev_tx_t tg3_start_xmit(struct
 				iph->tot_len = ip_tot_len;
 			}
 			tcph->check = tcp_csum;
-			return tg3_tso_bug(tp, skb);
+			return tg3_tso_bug(tp, tnapi, txq, skb);
 		}
 
 		/* If the workaround fails due to memory/mapping



  parent reply	other threads:[~2014-08-08 21:35 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-08 21:35 [PATCH 3.16 00/17] 3.16.1-stable review Greg Kroah-Hartman
2014-08-08 21:35 ` [PATCH 3.16 01/17] ip_tunnel(ipv4): fix tunnels with "local any remote $remote_ip" Greg Kroah-Hartman
2014-08-08 21:35 ` [PATCH 3.16 02/17] tcp: Fix integer-overflows in TCP veno Greg Kroah-Hartman
2014-08-08 21:35 ` [PATCH 3.16 03/17] tcp: Fix integer-overflow in TCP vegas Greg Kroah-Hartman
2014-08-08 21:35 ` [PATCH 3.16 04/17] bna: fix performance regression Greg Kroah-Hartman
2014-08-08 21:35 ` [PATCH 3.16 05/17] macvlan: Initialize vlan_features to turn on offload support Greg Kroah-Hartman
2014-08-08 21:35 ` [PATCH 3.16 06/17] net: Correctly set segment mac_len in skb_segment() Greg Kroah-Hartman
2014-08-08 21:35 ` [PATCH 3.16 07/17] iovec: make sure the caller actually wants anything in memcpy_fromiovecend Greg Kroah-Hartman
2014-08-08 21:35 ` [PATCH 3.16 08/17] batman-adv: Fix out-of-order fragmentation support Greg Kroah-Hartman
2014-08-08 21:35 ` [PATCH 3.16 09/17] Revert "net: phy: Set the driver when registering an MDIO bus device" Greg Kroah-Hartman
2014-08-08 21:35 ` [PATCH 3.16 10/17] sctp: fix possible seqlock seadlock in sctp_packet_transmit() Greg Kroah-Hartman
2014-08-08 21:35 ` Greg Kroah-Hartman [this message]
2014-08-08 21:35 ` [PATCH 3.16 12/17] sparc64: Do not insert non-valid PTEs into the TSB hash table Greg Kroah-Hartman
2014-08-08 21:35 ` [PATCH 3.16 13/17] sparc64: Guard against flushing openfirmware mappings Greg Kroah-Hartman
2014-08-08 21:35 ` [PATCH 3.16 14/17] bbc-i2c: Fix BBC I2C envctrl on SunBlade 2000 Greg Kroah-Hartman
2014-08-08 21:35 ` [PATCH 3.16 15/17] sunsab: Fix detection of BREAK on sunsab serial console Greg Kroah-Hartman
2014-08-08 21:35 ` [PATCH 3.16 16/17] sparc64: ldc_connect() should not return EINVAL when handshake is in progress Greg Kroah-Hartman
2014-08-08 21:35 ` [PATCH 3.16 17/17] arch/sparc/math-emu/math_32.c: drop stray break operator Greg Kroah-Hartman
2014-08-09  0:59 ` [PATCH 3.16 00/17] 3.16.1-stable review Guenter Roeck
2014-08-09  3:49   ` Greg Kroah-Hartman
2014-08-09  3:49     ` Greg Kroah-Hartman
2014-08-09  4:17       ` Guenter Roeck
2014-08-09 14:16         ` Greg Kroah-Hartman
2014-08-09 15:04           ` Guenter Roeck
2014-08-09 16:07             ` Linus Torvalds
2014-08-09 17:15               ` Guenter Roeck
2014-08-09 17:43                 ` Linus Torvalds
2014-08-10  1:21                   ` Stephen Rothwell
2014-08-10  2:06                     ` Olof Johansson
2014-08-11  0:22                       ` Kukjin Kim
2014-08-09 14:43 ` Shuah Khan
2014-08-09 15:49   ` Greg Kroah-Hartman
2014-08-10 11:48     ` Satoru Takeuchi
2014-08-10 12:18       ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140808213457.977999010@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchan@broadcom.com \
    --cc=prashant@broadcom.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).