From patchwork Mon Oct 24 12:26:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Richter X-Patchwork-Id: 685799 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3t2bBY5JTZz9t0Z for ; Mon, 24 Oct 2016 23:27:01 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757464AbcJXM0j (ORCPT ); Mon, 24 Oct 2016 08:26:39 -0400 Received: from einhorn.in-berlin.de ([192.109.42.8]:58428 "EHLO einhorn.in-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756858AbcJXM0g (ORCPT ); Mon, 24 Oct 2016 08:26:36 -0400 X-Envelope-From: stefanr@s5r6.in-berlin.de Received: from kant ([83.221.231.68]) (authenticated bits=0) by einhorn.in-berlin.de (8.14.4/8.14.4/Debian-8+deb8u1) with ESMTP id u9OCQE7o005429 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 24 Oct 2016 14:26:15 +0200 Date: Mon, 24 Oct 2016 14:26:13 +0200 From: Stefan Richter To: "David S. Miller" Cc: Jarod Wilson , netdev@vger.kernel.org, linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/2 v2] firewire: net: set initial MTU = 1500 unconditionally, fix IPv6 on some CardBus cards Message-ID: <20161024142613.29145f32@kant> In-Reply-To: <20161024015013.GB42084@redhat.com> References: <20161019023333.15760-1-jarod@redhat.com> <20161020175524.6184-1-jarod@redhat.com> <20161020175524.6184-8-jarod@redhat.com> <20161022211606.3b5d137d@kant> <20161022212759.228c7642@kant> <20161023011824.GE32569@redhat.com> <20161023162903.4166a35d@kant> <20161023163056.6bc38610@kant> <20161024015013.GB42084@redhat.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org firewire-net, like the older eth1394 driver, reduced the initial MTU to less than 1500 octets if the local link layer controller's asynchronous packet reception limit was lower. This is bogus, since this reception limit does not have anything to do with the transmission limit. Neither did this reduction affect the TX path positively, nor could it prevent link fragmentation at the RX path. Many FireWire CardBus cards have a max_rec of 9, causing an initial MTU of 1024 - 16 = 1008. RFC 2734 and RFC 3146 allow a minimum max_rec = 8, which would result in an initial MTU of 512 - 16 = 496. On such cards, IPv6 could only be employed if the MTU was manually increased to 1280 or more, i.e. IPv6 would not work without intervention from userland. We now always initialize the MTU to 1500, which is the default according to RFC 2734 and RFC 3146. On a VIA VT6316 based CardBus card which was affected by this, changing the MTU from 1008 to 1500 also increases TX bandwidth by 6 %. RX remains unaffected. CC: netdev@vger.kernel.org CC: linux1394-devel@lists.sourceforge.net CC: Jarod Wilson Signed-off-by: Stefan Richter Acked-by: Jarod Wilson --- v2: use ETH_DATA_LEN, add comment drivers/firewire/net.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c index 99379542b263..29dbcba38f59 100644 --- a/drivers/firewire/net.c +++ b/drivers/firewire/net.c @@ -1463,13 +1463,8 @@ static int fwnet_probe(struct fw_unit *unit, goto out; dev->local_fifo = dev->handler.offset; - /* - * Use the RFC 2734 default 1500 octets or the maximum payload - * as initial MTU - */ - net->mtu = min(1500U, - (1U << (card->max_receive + 1)) - - RFC2374_FRAG_HDR_SIZE - IEEE1394_GASP_HDR_SIZE); + /* MTU range: 68 - 65535, RFC 2734 default: 1500 */ + net->mtu = ETH_DATA_LEN; net->min_mtu = ETH_MIN_MTU; net->max_mtu = ETH_MAX_MTU;