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,
	Jonathan Davies <jonathan.davies@citrix.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 3.19 09/27] xen-netfront: transmit fully GSO-sized packets
Date: Sun, 26 Apr 2015 16:15:40 +0200	[thread overview]
Message-ID: <20150426134603.778410208@linuxfoundation.org> (raw)
In-Reply-To: <20150426134603.371719585@linuxfoundation.org>

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

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

From: Jonathan Davies <jonathan.davies@citrix.com>

[ Upstream commit 0c36820e2ab7d943ab1188230fdf2149826d33c0 ]

xen-netfront limits transmitted skbs to be at most 44 segments in size. However,
GSO permits up to 65536 bytes, which means a maximum of 45 segments of 1448
bytes each. This slight reduction in the size of packets means a slight loss in
efficiency.

Since c/s 9ecd1a75d, xen-netfront sets gso_max_size to
    XEN_NETIF_MAX_TX_SIZE - MAX_TCP_HEADER,
where XEN_NETIF_MAX_TX_SIZE is 65535 bytes.

The calculation used by tcp_tso_autosize (and also tcp_xmit_size_goal since c/s
6c09fa09d) in determining when to split an skb into two is
    sk->sk_gso_max_size - 1 - MAX_TCP_HEADER.

So the maximum permitted size of an skb is calculated to be
    (XEN_NETIF_MAX_TX_SIZE - MAX_TCP_HEADER) - 1 - MAX_TCP_HEADER.

Intuitively, this looks like the wrong formula -- we don't need two TCP headers.
Instead, there is no need to deviate from the default gso_max_size of 65536 as
this already accommodates the size of the header.

Currently, the largest skb transmitted by netfront is 63712 bytes (44 segments
of 1448 bytes each), as observed via tcpdump. This patch makes netfront send
skbs of up to 65160 bytes (45 segments of 1448 bytes each).

Similarly, the maximum allowable mtu does not need to subtract MAX_TCP_HEADER as
it relates to the size of the whole packet, including the header.

Fixes: 9ecd1a75d977 ("xen-netfront: reduce gso_max_size to account for max TCP header")
Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/xen-netfront.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1062,8 +1062,7 @@ err:
 
 static int xennet_change_mtu(struct net_device *dev, int mtu)
 {
-	int max = xennet_can_sg(dev) ?
-		XEN_NETIF_MAX_TX_SIZE - MAX_TCP_HEADER : ETH_DATA_LEN;
+	int max = xennet_can_sg(dev) ? XEN_NETIF_MAX_TX_SIZE : ETH_DATA_LEN;
 
 	if (mtu > max)
 		return -EINVAL;
@@ -1333,8 +1332,6 @@ static struct net_device *xennet_create_
 	netdev->ethtool_ops = &xennet_ethtool_ops;
 	SET_NETDEV_DEV(netdev, &dev->dev);
 
-	netif_set_gso_max_size(netdev, XEN_NETIF_MAX_TX_SIZE - MAX_TCP_HEADER);
-
 	np->netdev = netdev;
 
 	netif_carrier_off(netdev);



  parent reply	other threads:[~2015-04-26 14:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-26 14:15 [PATCH 3.19 00/27] 3.19.6-stable review Greg Kroah-Hartman
2015-04-26 14:15 ` [PATCH 3.19 01/27] tcp: prevent fetching dst twice in early demux code Greg Kroah-Hartman
2015-04-26 14:15 ` [PATCH 3.19 02/27] rocker: handle non-bridge master change Greg Kroah-Hartman
2015-04-26 14:15 ` [PATCH 3.19 03/27] net/mlx4_en: Call register_netdevice in the proper location Greg Kroah-Hartman
2015-04-26 14:15 ` [PATCH 3.19 04/27] ipv6: Dont reduce hop limit for an interface Greg Kroah-Hartman
2015-04-26 14:15 ` [PATCH 3.19 05/27] tun: return proper error code from tun_do_read Greg Kroah-Hartman
2015-04-26 14:15 ` [PATCH 3.19 06/27] net: tcp6: fix double call of tcp_v6_fill_cb() Greg Kroah-Hartman
2015-04-26 14:15 ` [PATCH 3.19 07/27] bonding: Bonding Overriding Configuration logic restored Greg Kroah-Hartman
2015-04-26 14:15 ` [PATCH 3.19 08/27] openvswitch: Return vport module ref before destruction Greg Kroah-Hartman
2015-04-26 14:15 ` Greg Kroah-Hartman [this message]
2015-04-26 14:15 ` [PATCH 3.19 10/27] tcp: fix FRTO undo on cumulative ACK of SACKed range Greg Kroah-Hartman
2015-04-26 14:15 ` [PATCH 3.19 11/27] ipv6: protect skb->sk accesses from recursive dereference inside the stack Greg Kroah-Hartman
2015-04-26 14:15 ` [PATCH 3.19 12/27] net/mlx4_core: Fix error message deprecation for ConnectX-2 cards Greg Kroah-Hartman
2015-04-26 14:15 ` [PATCH 3.19 13/27] tcp: tcp_make_synack() should clear skb->tstamp Greg Kroah-Hartman
2015-04-26 14:15 ` [PATCH 3.19 14/27] bnx2x: Fix busy_poll vs netpoll Greg Kroah-Hartman
2015-04-26 14:15 ` [PATCH 3.19 15/27] bpf: fix verifier memory corruption Greg Kroah-Hartman
2015-04-26 14:15 ` [PATCH 3.19 16/27] Revert "net: Reset secmark when scrubbing packet" Greg Kroah-Hartman
2015-04-26 14:15 ` [PATCH 3.19 18/27] udptunnels: Call handle_offloads after inserting vlan tag Greg Kroah-Hartman
2015-04-26 14:15 ` [PATCH 3.19 21/27] tg3: Hold tp->lock before calling tg3_halt() from tg3_init_one() Greg Kroah-Hartman
2015-04-26 14:15 ` [PATCH 3.19 23/27] staging: comedi: adv_pci1710: fix AI INSN_READ for non-zero channel Greg Kroah-Hartman
2015-04-26 14:15 ` [PATCH 3.19 24/27] mm/hugetlb: reduce arch dependent code around follow_huge_* Greg Kroah-Hartman
2015-04-26 14:15 ` [PATCH 3.19 25/27] mm/hugetlb: take page table lock in follow_huge_pmd() Greg Kroah-Hartman
2015-04-26 14:15 ` [PATCH 3.19 26/27] rtlwifi: rtl8192ee: Fix handling of new style descriptors Greg Kroah-Hartman
2015-04-26 14:15 ` [PATCH 3.19 27/27] fs: take i_mutex during prepare_binprm for set[ug]id executables Greg Kroah-Hartman
2015-04-26 20:04 ` [PATCH 3.19 00/27] 3.19.6-stable review Guenter Roeck
2015-04-27 17:20 ` 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=20150426134603.778410208@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=jonathan.davies@citrix.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;
as well as URLs for NNTP newsgroup(s).