From owner-freebsd-net@FreeBSD.ORG Fri Nov 26 20:46:14 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 B7D2910656C8 for ; Fri, 26 Nov 2010 20:46:14 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 87ABF8FC23 for ; Fri, 26 Nov 2010 20:46:14 +0000 (UTC) Received: by pzk32 with SMTP id 32so316389pzk.13 for ; Fri, 26 Nov 2010 12:46:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=yxZaUhSITR1Tjk4CHAVG0MCn18Lbwi1KZ8LuLzIWT2U=; b=SbB64LKGhTnasfqC9XE6ZLnvQ1QliwqNfBhbF0EvxGdM3na9vq7T4eZOib3DocbSi9 hnNlF16fzuJqzOx118IuEb12r/KO2kazV0mTMQwD22/z/8mnHabTInIdcXKBko3fo4/W 6IT2ydPlKnoh5tV4QnCfVZoIX08PPWVmwJ3is= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=k5baraNPpF8KnsOuOqNxC6QfpUDYTsG+KGsg/+KkX5m7Yhsbq6CQ+NTc2pWkqkivGy 8i83dFq69/FwX80hdRFVEbL7tB32TvUGKrlgn2Gp/IARc5MB8EkdyEee/4ZPabEVXt5L kXWysMvootY/pWDwFJ6udNJX9z0DmAX/56zOQ= MIME-Version: 1.0 Received: by 10.142.211.21 with SMTP id j21mr2859044wfg.213.1290804373065; Fri, 26 Nov 2010 12:46:13 -0800 (PST) Received: by 10.142.51.9 with HTTP; Fri, 26 Nov 2010 12:46:13 -0800 (PST) In-Reply-To: References: <201011261037105152721@yahoo.com.cn> Date: Fri, 26 Nov 2010 12:46:13 -0800 Message-ID: From: Jack Vogel To: Ryan Stone Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: beezarliu , freebsd-net Subject: Re: 82599 receiving packets with vlan tag=0 (vlan strip problem)? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Nov 2010 20:46:14 -0000 Ahh, OK, so how would this solution work: In rxeof, in addition to requiring VP to be set, also check that adapter->num_vlans is non-zero, in order to store the tag. Jack On Fri, Nov 26, 2010 at 12:42 PM, Ryan Stone wrote: > If vlan stripping is disabled on the 82599(i.e. RXDCTL.VME is 0 for > that queue is clear) and a vlan-tagged packet is received, then the > descriptor for that packet will have the VP bit set even though the > vlan was not stripped, and the VLAN Tag field in the descriptor is set > to 0. ixgbe_rxeof will see that the VP bit is set and set the > M_VLANTAG on the mbuf, and put 0 in m_pkthdr.ether_vtag. This means > that the stack will treat the packet as if it was double vlan tagged, > with outer tag being 0. > > Ryan Stone >