From patchwork Wed Mar 2 14:07:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?G=C3=B6ran_Weinholt?= X-Patchwork-Id: 85086 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 D9B9DB6EDD for ; Thu, 3 Mar 2011 01:16:36 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752021Ab1CBOQa (ORCPT ); Wed, 2 Mar 2011 09:16:30 -0500 Received: from mail2.csbnet.se ([95.80.0.100]:36811 "EHLO mail2.csbnet.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751138Ab1CBOQa convert rfc822-to-8bit (ORCPT ); Wed, 2 Mar 2011 09:16:30 -0500 X-Greylist: delayed 543 seconds by postgrey-1.27 at vger.kernel.org; Wed, 02 Mar 2011 09:16:29 EST Received: from mail2.csbnet.se (localhost.localdomain [127.0.0.1]) by mail2.csbnet.se (Postfix) with ESMTP id DF27588096; Wed, 2 Mar 2011 15:07:21 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on service2.mgn X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.5 Received: from desktop3 (desktop3.csbnet.se [95.80.0.166]) by mail2.csbnet.se (Postfix) with ESMTP id 8C71288094; Wed, 2 Mar 2011 15:07:21 +0100 (CET) From: weinholt@csbnet.se (=?utf-8?Q?G=C3=B6ran?= Weinholt) To: Andrew Morton Cc: netdev@vger.kernel.org, bugzilla-daemon@bugzilla.kernel.org, bugme-daemon@bugzilla.kernel.org, Steve Glendinning Subject: Re: [Bugme-new] [Bug 30092] New: smsc911x.c drops long packets with VLAN tags References: <20110301161547.13480e90.akpm@linux-foundation.org> Organisation: Stiftelsen Chalmers Studenthem (AS48514) Date: Wed, 02 Mar 2011 15:07:21 +0100 In-Reply-To: <20110301161547.13480e90.akpm@linux-foundation.org> (Andrew Morton's message of "Tue, 1 Mar 2011 16:15:47 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Andrew Morton writes: > (switched to email. Please respond via emailed reply-to-all, not via the > bugzilla web interface). > > On Mon, 28 Feb 2011 15:57:14 GMT > bugzilla-daemon@bugzilla.kernel.org wrote: > >> https://bugzilla.kernel.org/show_bug.cgi?id=30092 >> > Thanks. Become famous, get more girls: send us a patch as per > Documentation/SubmittingPatches :) There's a register called VLAN1 that wasn't being configured. Setting it to 0x8100 fixes the problem I reported. There's also a VLAN2 register, possibly meant for stacked VLANs, but the description in the datasheet doesn't make sense to me, and I can't test stacked VLANs, so I'm not going to change it. Subject: [PATCH] net/smsc911x.c: Set the VLAN1 register to fix VLAN MTU problem From: Göran Weinholt The smsc911x driver would drop frames longer than 1518 bytes, which is a problem for networks with VLAN tagging. The VLAN1 tag register is used to increase the legal frame size to 1522 when a VLAN tag is identified. Signed-off-by: Göran Weinholt Acked-by: Steve Glendinning diff -uprN linux-2.6.36.4-vanilla/drivers/net/smsc911x.c linux-2.6.36.4/drivers/net/smsc911x.c --- linux-2.6.36.4-vanilla/drivers/net/smsc911x.c 2011-02-18 00:14:38.000000000 +0100 +++ linux-2.6.36.4/drivers/net/smsc911x.c 2011-03-02 14:29:11.884382251 +0100 @@ -1178,6 +1178,11 @@ static int smsc911x_open(struct net_devi smsc911x_reg_write(pdata, HW_CFG, 0x00050000); smsc911x_reg_write(pdata, AFC_CFG, 0x006E3740); + /* Increase the legal frame size of VLAN tagged frames to 1522 bytes */ + spin_lock_irq(&pdata->mac_lock); + smsc911x_mac_write(pdata, VLAN1, ETH_P_8021Q); + spin_unlock_irq(&pdata->mac_lock); + /* Make sure EEPROM has finished loading before setting GPIO_CFG */ timeout = 50; while ((smsc911x_reg_read(pdata, E2P_CMD) & E2P_CMD_EPC_BUSY_) &&