From owner-cvs-src@FreeBSD.ORG Tue Nov 23 22:28:41 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4337216A4CE; Tue, 23 Nov 2004 22:28:41 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 146CE43D3F; Tue, 23 Nov 2004 22:28:41 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id iANMSeEs077409; Tue, 23 Nov 2004 22:28:40 GMT (envelope-from rwatson@repoman.freebsd.org) Received: (from rwatson@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id iANMSe4s077408; Tue, 23 Nov 2004 22:28:40 GMT (envelope-from rwatson) Message-Id: <200411232228.iANMSe4s077408@repoman.freebsd.org> From: Robert Watson Date: Tue, 23 Nov 2004 22:28:40 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: RELENG_5 Subject: cvs commit: src/sys/dev/em if_em.c if_em.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Nov 2004 22:28:41 -0000 rwatson 2004-11-23 22:28:40 UTC FreeBSD src repository Modified files: (Branch: RELENG_5) sys/dev/em if_em.c if_em.h Log: Merge if_em.c:1.53, if_em.c:1.54, if_em.h:1.29 from HEAD to RELENG_5: date: 2004/11/14 20:20:28; author: rwatson; state: Exp; lines: +19 -4 Further refine the if_em vlan fix in if_em.c:1.53: - Because em_encap() can now fail in a way that leaves us without an mbuf chain, potentially set *m_headp to NULL if that happens, so that the caller can do the right thing. This case can occur when we try to prepend the vlan header mbuf but can't allocate additional memory. - Modify the caller of em_encap() to detect a NULL m_head and not try to queue the mbuf if that happens. - When em_encap() fails, make sure to call bus_dmamap_destroy() to clean up. date: 2004/11/12 11:03:07; author: rwatson; state: Exp; lines: +1 -0 date: 2004/11/12 11:03:07; author: rwatson; state: Exp; lines: +43 -6 Correct a bug in the if_em driver relating to the use of vlans with promiscuous mode introduced in 1.45, which programs the em card not to strip or prepend tags when in promiscuous mode without also modifying behavior to manually prepend a vlan header in the event that the card isn't doing it on transmit. Due to a feature of card operation, if the global VLAN prepend/strip register isn't set, setting the VLAN tag flag on individual packet descriptors will cause the packet to be transmitted using ISL encapsulation rather than 802.1Q VLAN encapsulation. This fix causes em_encap() to prepend the header by tracking whether the card is configured to temporarily disable prepending/stripping due to promiscuous mode. As a result, entering promiscuous mode on the parent em interface no longer causes vlans to appear to "wedge" or transmit ISL-encapsulated frames, which typically will not be configured/spoken by the other endpoints on the VLAN trunk. This bug may also exist in other drivers, and the additional vlan encapsulation logic should be abstracted and centralized in if_vlan.c if so. RELENG_5_3 candidate. MFC after: 1 week Tested by: pjd, rwatson Reported by: astesin at ukrtelecom dot net Reported by: Mike Tancsa Reported by: Iasen Kostov MFC after: 1 week Revision Changes Path 1.44.2.4 +59 -7 src/sys/dev/em/if_em.c 1.25.2.2 +1 -0 src/sys/dev/em/if_em.h