From owner-freebsd-bugs Sun Dec 1 20:30: 5 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A81C637B401 for ; Sun, 1 Dec 2002 20:30:02 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E4A4F43EC2 for ; Sun, 1 Dec 2002 20:30:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id gB24U1x3012924 for ; Sun, 1 Dec 2002 20:30:01 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id gB24U1WU012923; Sun, 1 Dec 2002 20:30:01 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6562037B401 for ; Sun, 1 Dec 2002 20:27:53 -0800 (PST) Received: from trinity.supernews.net (trinity.ranger.supernews.net [216.168.1.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1FAE443EBE for ; Sun, 1 Dec 2002 20:27:53 -0800 (PST) (envelope-from andrew@supernews.net) Received: from andrew by trinity.supernews.net with local (Exim 3.36 #1) id 18IiBV-000FEQ-00; Mon, 02 Dec 2002 04:27:53 +0000 Message-Id: Date: Mon, 02 Dec 2002 04:27:53 +0000 From: "Andrew - Supernews" Reply-To: andrew+fbsd@supernews.net To: FreeBSD-gnats-submit@FreeBSD.org Cc: andrew+fbsd@supernews.net X-Send-Pr-Version: 3.113 Subject: kern/45907: vlan support broken in 'em' driver (includes suggested fix) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 45907 >Category: kern >Synopsis: vlan support broken in 'em' driver (includes suggested fix) >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Dec 01 20:30:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: "Andrew - Supernews" andrew+fbsd@supernews.net >Release: FreeBSD 4.7-STABLE i386 >Organization: Supernews >Environment: System: FreeBSD 4.7-STABLE i386 as of 1 Dec 2002 Using two em cards (with multiple vlans on each): em0: port 0x3000-0x303f mem 0xfc200000-0xfc21ffff irq 5 at device 2.0 on pci3 em0: Speed:N/A Duplex:N/A em1: port 0x3040-0x307f mem 0xfc220000-0xfc23ffff irq 5 at device 2.1 on pci3 em1: Speed:N/A Duplex:N/A >Description: Vlan support fails to function correctly because the priority/QoS bits are not masked off from the 802.1Q tag before using it as a pure vlan number. Accordingly traffic with these bits set (in our case, OSPF HELLO packets from a router) does not get matched up with the correct vlan device. Other drivers (such as pci/if_ti.c) mask off the offending bits before passing the packet to the vlan input code; the following suggested fix does likewise for this driver. >How-To-Repeat: Attach a vlan interface to the em interface in the usual way. Supply incoming traffic with the correct vlan number but non-zero priority. Observe that the affected packets are visible to the em interface (via, for example, tcpdump) but that they are discarded by the vlan code and not passed to the relevent vlan interface (tcpdump on the vlan interface fails to show the traffic). >Fix: By analogy to the ti driver, the following code in sys/dev/if_em.c: if (current_desc->status & E1000_RXD_STAT_VP) VLAN_INPUT_TAG(eh, adapter->fmp, current_desc->special); (which is the only occurrence of VLAN_INPUT_TAG in the file) should instead read if (current_desc->status & E1000_RXD_STAT_VP) VLAN_INPUT_TAG(eh, adapter->fmp, current_desc->special & 0xfff); (note that we have been running this fix in production use for a couple of weeks now at sustained high traffic levels.) >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message