From owner-freebsd-net@FreeBSD.ORG Fri Mar 19 17:47:40 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC875106566B; Fri, 19 Mar 2010 17:47:40 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by mx1.freebsd.org (Postfix) with ESMTP id 1C7DB8FC0A; Fri, 19 Mar 2010 17:47:39 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 19so367918fgg.13 for ; Fri, 19 Mar 2010 10:47:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=IS8bhpjnqts85Nz2RHCRWGap9qVjcvJei2E/GHe2qSk=; b=ZgArmDCnnfRYTCrIBgexyN4Hs+vO1c7hJdOeXR/RsGcqa66lZXPN15OShGOrR6plgn SU2LtylIDcrugrZIgoZlU7WdLWJRbbxNPOLOFOAJ/PPViKMZlf+R/d+J5h+XY01tA6zA t6v185+0y4jh1Ce3L81zjf2x8xADzd+TKht3w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=G0hjf/LwX1hx6ouqZNuuJG2MwbcHW8zhT1mVKrU+KTRALacTPba6Zn34iyJ/5bfheO 1Z0cfJctvrS7U8imx8IB2T8aelEbnwksULt9LJx3kfW5qoPPtd+qvyUPfSOeaVWrdHj5 nEZ3sl02+HSVoyBOIO46SvXPYwmWUweXzyWcc= Received: by 10.86.6.40 with SMTP id 40mr7872437fgf.3.1269020858994; Fri, 19 Mar 2010 10:47:38 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id e3sm1671340fga.14.2010.03.19.10.47.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 19 Mar 2010 10:47:37 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Fri, 19 Mar 2010 10:47:09 -0700 From: Pyun YongHyeon Date: Fri, 19 Mar 2010 10:47:09 -0700 To: "Prokofyev S.P." Message-ID: <20100319174709.GQ9373@michelle.cdnetworks.com> References: <4BA38CEC.9060205@skylinetele.com> <20100319174450.GP9373@michelle.cdnetworks.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="qlTNgmc+xy1dBmNv" Content-Disposition: inline In-Reply-To: <20100319174450.GP9373@michelle.cdnetworks.com> User-Agent: Mutt/1.4.2.3i Cc: jfv@FreeBSD.org, freebsd-net@freebsd.org Subject: Re: Please pay attention to fix bug kern/141285 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Mar 2010 17:47:40 -0000 --qlTNgmc+xy1dBmNv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Mar 19, 2010 at 10:44:50AM -0700, Pyun YongHyeon wrote: > On Fri, Mar 19, 2010 at 04:40:44PM +0200, Prokofyev S.P. wrote: > > Hi ALL ! > > > > Please pay attention to fix bug kern/141285(kern/141843) ! > > > > igb(4) also has a similar issue but it seems igb(4) does not even > advertise IFCAP_VLAN_HWFILTER capability. igb(4) may have to remove > VLAN event handler or should implement IFCAP_VLAN_HWFILTER to > support VLAN hardware filtering. > > I have a patch for the hardware VLAN filtering of em(4). But it > wouldn't address the issue reported in the PR. The root cause of > issue was em(4) wants to reset controller whenever new VLAN is > registered/unregistered. I'm not sure this is requirement of > hardware. If this is requirement of hardware there is no way to > avoid the controller reset unless you disable vlanhwfilter feature. > > #ifconfig em0 -vlanhwfilter > > em(4) in HEAD disabled VLAN hardware filtering by default so if you > use that version you wouldn't encounter the issue again. Attached > patch is small diff for VLAN hardware filtering which tries to > avoid unnecessary controller reset and added missing lock. If > hardware allows dynamic changing of VLAN filtering table we could > completely bypass the controller reset. Jack may know the details. Oops, posted old patch. Here is new one. --qlTNgmc+xy1dBmNv Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="em.vlan_hwfilter.patch2" Index: sys/dev/e1000/if_em.c =================================================================== --- sys/dev/e1000/if_em.c (revision 205300) +++ sys/dev/e1000/if_em.c (working copy) @@ -4652,10 +4652,15 @@ index = (vtag >> 5) & 0x7F; bit = vtag & 0x1F; + EM_CORE_LOCK(adapter); em_shadow_vfta[index] |= (1 << bit); ++adapter->num_vlans; /* Re-init to load the changes */ - em_init(adapter); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWFILTER) != 0 && + (ifp->if_capenable & IFCAP_VLAN_HWFILTER) != 0) + em_init_locked(adapter); + EM_CORE_UNLOCK(adapter); } /* @@ -4676,10 +4681,15 @@ index = (vtag >> 5) & 0x7F; bit = vtag & 0x1F; + EM_CORE_LOCK(adapter); em_shadow_vfta[index] &= ~(1 << bit); --adapter->num_vlans; /* Re-init to load the changes */ - em_init(adapter); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWFILTER) != 0 && + (ifp->if_capenable & IFCAP_VLAN_HWFILTER) != 0) + em_init_locked(adapter); + EM_CORE_UNLOCK(adapter); } static void --qlTNgmc+xy1dBmNv--