public inbox for linux-kernel@vger.kernel.org
 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, Eric Dumazet <edumazet@google.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [ 19/22] usbnet: do not pretend to support SG/TSO
Date: Thu,  8 Aug 2013 18:41:35 -0700	[thread overview]
Message-ID: <20130809013953.465282498@linuxfoundation.org> (raw)
In-Reply-To: <20130809013949.226228694@linuxfoundation.org>

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

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

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit 20f0170377264e8449b6987041f0bcc4d746d3ed ]

usbnet doesn't support yet SG, so drivers should not advertise SG or TSO
capabilities, as they allow TCP stack to build large TSO packets that
need to be linearized and might use order-5 pages.

This adds an extra copy overhead and possible allocation failures.

Current code ignore skb_linearize() return code so crashes are even
possible.

Best is to not pretend SG/TSO is supported, and add this again when/if
usbnet really supports SG for devices who could get a performance gain.

Based on a prior patch from Freddy Xin <freddy@asix.com.tw>

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/usb/smsc75xx.c |   12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -43,7 +43,6 @@
 #define EEPROM_MAC_OFFSET		(0x01)
 #define DEFAULT_TX_CSUM_ENABLE		(true)
 #define DEFAULT_RX_CSUM_ENABLE		(true)
-#define DEFAULT_TSO_ENABLE		(true)
 #define SMSC75XX_INTERNAL_PHY_ID	(1)
 #define SMSC75XX_TX_OVERHEAD		(8)
 #define MAX_RX_FIFO_SIZE		(20 * 1024)
@@ -1034,17 +1033,14 @@ static int smsc75xx_bind(struct usbnet *
 
 	INIT_WORK(&pdata->set_multicast, smsc75xx_deferred_multicast_write);
 
-	if (DEFAULT_TX_CSUM_ENABLE) {
+	if (DEFAULT_TX_CSUM_ENABLE)
 		dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
-		if (DEFAULT_TSO_ENABLE)
-			dev->net->features |= NETIF_F_SG |
-				NETIF_F_TSO | NETIF_F_TSO6;
-	}
+
 	if (DEFAULT_RX_CSUM_ENABLE)
 		dev->net->features |= NETIF_F_RXCSUM;
 
 	dev->net->hw_features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
-		NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_RXCSUM;
+				NETIF_F_RXCSUM;
 
 	/* Init all registers */
 	ret = smsc75xx_reset(dev);
@@ -1169,8 +1165,6 @@ static struct sk_buff *smsc75xx_tx_fixup
 {
 	u32 tx_cmd_a, tx_cmd_b;
 
-	skb_linearize(skb);
-
 	if (skb_headroom(skb) < SMSC75XX_TX_OVERHEAD) {
 		struct sk_buff *skb2 =
 			skb_copy_expand(skb, SMSC75XX_TX_OVERHEAD, 0, flags);



  parent reply	other threads:[~2013-08-09  1:42 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-09  1:41 [ 00/22] 3.0.90-stable review Greg Kroah-Hartman
2013-08-09  1:41 ` [ 01/22] serial/mxs-auart: fix race condition in interrupt handler Greg Kroah-Hartman
2013-08-09  1:41 ` [ 02/22] serial/mxs-auart: increase time to wait for transmitter to become idle Greg Kroah-Hartman
2013-08-09  1:41 ` [ 03/22] ath9k_htc: do some initial hardware configuration Greg Kroah-Hartman
2013-08-09  1:41 ` [ 04/22] nl80211: fix mgmt tx status and testmode reporting for netns Greg Kroah-Hartman
2013-08-09  1:41 ` [ 05/22] mac80211: fix duplicate retransmission detection Greg Kroah-Hartman
2013-08-09  1:41 ` [ 06/22] rt2x00: fix stop queue Greg Kroah-Hartman
2013-08-09  1:41 ` [ 07/22] mwifiex: Add missing endian conversion Greg Kroah-Hartman
2013-08-09  1:41 ` [ 08/22] ACPI / battery: Fix parsing _BIX return value Greg Kroah-Hartman
2013-08-09  1:41 ` [ 09/22] sched: Fix the broken sched_rr_get_interval() Greg Kroah-Hartman
2013-08-09  1:41 ` [ 10/22] fanotify: info leak in copy_event_to_user() Greg Kroah-Hartman
2013-08-09  1:41 ` [ 11/22] MAINTAINERS: fix up stable_kernel_rules.txt location Greg Kroah-Hartman
2013-08-09  1:41 ` [ 12/22] perf: Fix event group context move Greg Kroah-Hartman
2013-08-09  1:41 ` [ 13/22] x86, fpu: correct the asm constraints for fxsave, unbreak mxcsr.daz Greg Kroah-Hartman
2013-08-09  1:41 ` [ 14/22] perf: Use css_tryget() to avoid propping up css refcount Greg Kroah-Hartman
2013-08-09  1:41 ` [ 15/22] arcnet: cleanup sizeof parameter Greg Kroah-Hartman
2013-08-09  1:41 ` [ 16/22] sysctl net: Keep tcp_syn_retries inside the boundary Greg Kroah-Hartman
2013-08-09  1:41 ` [ 17/22] sctp: fully initialize sctp_outq in sctp_outq_init Greg Kroah-Hartman
2013-08-09  1:41 ` [ 18/22] ipv6: take rtnl_lock and mark mrt6 table as freed on namespace cleanup Greg Kroah-Hartman
2013-08-09  1:41 ` Greg Kroah-Hartman [this message]
2013-08-09  1:41 ` [ 20/22] net_sched: Fix stack info leak in cbq_dump_wrr() Greg Kroah-Hartman
2013-08-09  1:41 ` [ 21/22] af_key: more info leaks in pfkey messages Greg Kroah-Hartman
2013-08-09  1:41 ` [ 22/22] net_sched: info leak in atm_tc_dump_class() Greg Kroah-Hartman
2013-08-09  3:42 ` [ 00/22] 3.0.90-stable review Guenter Roeck
2013-08-09  3:56   ` Greg Kroah-Hartman
2013-08-10 22:08 ` Shuah Khan

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=20130809013953.465282498@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --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