Date: Mon, 02 Dec 2002 04:27:53 +0000 From: "Andrew - Supernews" <andrew+fbsd@supernews.net> To: FreeBSD-gnats-submit@FreeBSD.org Cc: andrew+fbsd@supernews.net Subject: kern/45907: vlan support broken in 'em' driver (includes suggested fix) Message-ID: <E18IiBV-000FEQ-00@trinity.supernews.net>
next in thread | raw e-mail | index | archive | help
>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: <Intel(R) PRO/1000 Network Connection, Version - 1.4.7> port 0x3000-0x303f mem 0xfc200000-0xfc21ffff irq 5 at device 2.0 on pci3 em0: Speed:N/A Duplex:N/A em1: <Intel(R) PRO/1000 Network Connection, Version - 1.4.7> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E18IiBV-000FEQ-00>