From patchwork Sat Oct 29 20:16:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Richter X-Patchwork-Id: 688842 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 3t5sPC1Nc7z9t1F for ; Sun, 30 Oct 2016 07:17:35 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754718AbcJ2URU (ORCPT ); Sat, 29 Oct 2016 16:17:20 -0400 Received: from einhorn.in-berlin.de ([192.109.42.8]:41349 "EHLO einhorn.in-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752794AbcJ2URT (ORCPT ); Sat, 29 Oct 2016 16:17:19 -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 u9TKGwRm002919 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 29 Oct 2016 22:16:59 +0200 Date: Sat, 29 Oct 2016 22:16:58 +0200 From: Stefan Richter To: "David S. Miller" Cc: netdev@vger.kernel.org, linux1394-devel@lists.sourceforge.net, Jarod Wilson , linux-kernel@vger.kernel.org Subject: [PATCH net-next] firewire: net: really fix maximum possible MTU Message-ID: <20161029221658.03942ff6@kant> In-Reply-To: <20161023163056.6bc38610@kant> 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> 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 The maximum unicast datagram size /without/ link fragmentation is 4096 - 4 = 4092 (max IEEE 1394 async payload size at >= S800 bus speed, minus unfragmented encapssulation header). Max broadcast datagram size without fragmentation is 8 bytes less than that (due to GASP header). The maximum datagram size /with/ link fragmentation is 0xfff = 4095 for unicast and broadcast. This is because the RFC 2734 fragment encapsulation header field for datagram size is only 12 bits wide. Fixes: 5d48f00d836a('firewire: net: fix maximum possible MTU') Signed-off-by: Stefan Richter --- drivers/firewire/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c index 03715e7d9d92..363fc5ec1a4e 100644 --- a/drivers/firewire/net.c +++ b/drivers/firewire/net.c @@ -1465,7 +1465,7 @@ static int fwnet_probe(struct fw_unit *unit, net->mtu = 1500U; net->min_mtu = ETH_MIN_MTU; - net->max_mtu = ETH_MAX_MTU; + net->max_mtu = 0xfff; /* Set our hardware address while we're at it */ ha = (union fwnet_hwaddr *)net->dev_addr;