From owner-freebsd-net@FreeBSD.ORG Fri Mar 19 17:45:25 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 3E93A106566B; Fri, 19 Mar 2010 17:45:25 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by mx1.freebsd.org (Postfix) with ESMTP id 95C7F8FC0A; Fri, 19 Mar 2010 17:45:24 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 19so367196fgg.13 for ; Fri, 19 Mar 2010 10:45:23 -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=bjsunp+t8i+eBfblN0t5dV+QltVifIlststfzsEBFFY=; b=kreXNx/n7Alp02ReoMVuP4W/RD5qDYOKvNgjo7gku0H9vG++HwEXnXt68mHcqacDsc AHeekyqpGdOoieVUrsuWP+i1eZMGFyDIF6FdL3L+D2PBnh0udGvzIzLDMp0pbD4kVIpD 2yEPViFbqwc2Q6ZfuPt3y4gMIcqsHAFktHCQs= 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=Meg3ewtvPG65S1RultCYz9CeHX34f5N3ETAdcV/w8RVb72GKHJ9tb8CELxhNv1IsGx mA6vhjCEbc6nV4ejVB3EEsGhrTBC+8JEfzlkgK9tAj5uAOKCBT2tIi10nXtyKOM9tlwH uWUb4s3bNbQ6Foivn+WmiA+dm+ZoyPxWG2+uU= Received: by 10.87.15.19 with SMTP id s19mr41222fgi.0.1269020722993; Fri, 19 Mar 2010 10:45:22 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id e3sm1659382fga.4.2010.03.19.10.45.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 19 Mar 2010 10:45:21 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Fri, 19 Mar 2010 10:44:50 -0700 From: Pyun YongHyeon Date: Fri, 19 Mar 2010 10:44:50 -0700 To: "Prokofyev S.P." Message-ID: <20100319174450.GP9373@michelle.cdnetworks.com> References: <4BA38CEC.9060205@skylinetele.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0F1p//8PRICkK4MW" Content-Disposition: inline In-Reply-To: <4BA38CEC.9060205@skylinetele.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:45:25 -0000 --0F1p//8PRICkK4MW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. --0F1p//8PRICkK4MW Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="em.vlan_hwfilter.patch" 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); } /* @@ -4677,9 +4682,14 @@ index = (vtag >> 5) & 0x7F; bit = vtag & 0x1F; em_shadow_vfta[index] &= ~(1 << bit); + EM_CORE_LOCK(adapter); --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 --0F1p//8PRICkK4MW--