From patchwork Thu Apr 3 10:15:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhu Yanjun X-Patchwork-Id: 336584 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 2AE1C14009D for ; Thu, 3 Apr 2014 21:16:31 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751456AbaDCKPe (ORCPT ); Thu, 3 Apr 2014 06:15:34 -0400 Received: from mail-pb0-f47.google.com ([209.85.160.47]:52439 "EHLO mail-pb0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750891AbaDCKPc (ORCPT ); Thu, 3 Apr 2014 06:15:32 -0400 Received: by mail-pb0-f47.google.com with SMTP id up15so1624960pbc.34 for ; Thu, 03 Apr 2014 03:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=y9SzvGitsC7XgO28tlieOBRwbSNBfV3xlUch1+L3kLk=; b=wACEoI7V/+Ixn+36InLWIoXR6yuUAsdsR1+h7hS0kHBJp61lfWcRAnL8H25c/6WH6D 5MREMNrRHyYcGpSDUackQ27m1R2LoSXWNT97zceNuNZNzaoUkwlah3HigXAvTNWShNbI I6I93p9/T5sQBAS1yzSIe51Fr+iF/kxi24ECX0hGWzYW9CWpSCMXRhB0yrXMAXFWgM6Y uWo1mN2jXjECm1R4EdhT/EsLhY63xRJZWIk8K4qbPNPZzP6Udgklo+EPLdk8MDdNarV5 WfqrcIq6GB4iCBpaEcEs4iUtHH39gDaSumq1DaIY/Nu1PWij/IfJ0hfpvX7eX0sPKSUC UX9Q== X-Received: by 10.68.200.133 with SMTP id js5mr6393170pbc.138.1396520131551; Thu, 03 Apr 2014 03:15:31 -0700 (PDT) Received: from [128.224.162.224] ([1.202.252.122]) by mx.google.com with ESMTPSA id vg1sm10159880pbc.44.2014.04.03.03.15.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Apr 2014 03:15:30 -0700 (PDT) Message-ID: <533D34BD.900@gmail.com> Date: Thu, 03 Apr 2014 18:15:25 +0800 From: zhuyj User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Willy Tarreau CC: sandeep.kumar@freescale.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Tao, Yue" , "Yang, Zhangle (Eric)" , guang.yang@windriver.com, joe@perches.com, festevam@gmail.com, linuxppc-dev@lists.ozlabs.org, richardcochran@gmail.com, clarocq@gmail.com, yongjun_wei@trendmicro.com.cn, Claudiu Manoil , zhuyj Subject: Re: on kernel 2.6.34.15, vlan and raw packets can not be received with gfar-enet nic References: <53310F4E.4080104@gmail.com> <533D25D4.4000607@gmail.com> <20140403092727.GD16158@1wt.eu> In-Reply-To: <20140403092727.GD16158@1wt.eu> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 04/03/2014 05:27 PM, Willy Tarreau wrote: > Hi Zhu, > > On Thu, Apr 03, 2014 at 05:11:48PM +0800, zhuyj wrote: >> Hi, Claudiu >> >> Please help to review this patch. This patch is for kernel 2.6.x. Thanks >> a lot. >> >> Hi, Willy >> >> Please help to merge this patch to longterm: 2.6.32.61 since this >> problem also occurs on this kernel. Thanks a lot. > Could you please send the reference to the equivalent mainline commit (the one > which disables the tx vlan feature I'm assuming) ? I'll happily queue it for > 2.6.32.62. > > Thanks, > Willy > > Hi, Willy I made a new patch. In long commit message, I inserted the equivalent mainline commit about this feature. Maybe it is better. Now this patch is in the attachment. Please check and merge it into kernel 2.6.32.62. Thanks a lot. Zhu Yanjun From 3b74ad6134f8eccce9ee391fb02ff15863630c1b Mon Sep 17 00:00:00 2001 From: Zhu Yanjun Date: Thu, 3 Apr 2014 16:41:13 +0800 Subject: [PATCH 1/1] gianfar: disable TX vlan based on kernel 2.6.x 2.6.x kernels require a similar logic change as commit e1653c3e [gianfar: do vlan cleanup] and commit 51b8cbfc [gianfar: fix bug caused by e1653c3e] introduces for newer kernels. Since there is something wrong with tx vlan of gianfar nic driver, in kernel(3.1+), tx vlan is disabled. But in kernel 2.6.x, tx vlan is still enabled. Thus,gianfar nic driver can not support vlan packets and non-vlan packets at the same time. Signed-off-by: Zhu Yanjun --- drivers/net/gianfar.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 934a28f..8aa2cf6 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c @@ -365,7 +365,7 @@ static int gfar_probe(struct of_device *ofdev, priv->vlgrp = NULL; if (priv->device_flags & FSL_GIANFAR_DEV_HAS_VLAN) - dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; + dev->features |= NETIF_F_HW_VLAN_RX; if (priv->device_flags & FSL_GIANFAR_DEV_HAS_EXTENDED_HASH) { priv->extended_hash = 1; @@ -1451,12 +1451,6 @@ static void gfar_vlan_rx_register(struct net_device *dev, priv->vlgrp = grp; if (grp) { - /* Enable VLAN tag insertion */ - tempval = gfar_read(&priv->regs->tctrl); - tempval |= TCTRL_VLINS; - - gfar_write(&priv->regs->tctrl, tempval); - /* Enable VLAN tag extraction */ tempval = gfar_read(&priv->regs->rctrl); tempval |= (RCTRL_VLEX | RCTRL_PRSDEP_INIT); -- 1.7.9.5