From owner-freebsd-net@FreeBSD.ORG Wed Dec 8 10:58:05 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D8DF916A4CE; Wed, 8 Dec 2004 10:58:05 +0000 (GMT) Received: from BASE.OTEL.net (BASE.OTEL.net [212.36.8.132]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8BE9043D1F; Wed, 8 Dec 2004 10:58:05 +0000 (GMT) (envelope-from tbyte@OTEL.net) Received: from dragon.otel.net ([212.36.8.135]) by BASE.OTEL.net with esmtp (Exim 4.30; FreeBSD) id 1CbzWG-0007GN-R0; Wed, 08 Dec 2004 12:58:04 +0200 Message-ID: <41B6DE57.4030909@OTEL.net> Date: Wed, 08 Dec 2004 12:58:31 +0200 From: Iasen Kostov User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.3) Gecko/20041117 X-Accept-Language: bg, en-us, en MIME-Version: 1.0 To: Robert Watson References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-net@freebsd.org Subject: Re: em(4) VLAN + PROMISC still doesn't work with latest CVS version X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2004 10:58:06 -0000 Robert Watson wrote: >On Tue, 7 Dec 2004, Iasen Kostov wrote: > > > >> Is there an update on this case or I should find a way to disable >>all hw "things" in the driver ?:) (because things are getting hot here >>:). >> >> > >Try the attached patch? The vlan header in promisc mode was getting >inserted after the mbuf was mapped for dma, so under some circumstances >the remainder of the packet but not the header would be sent. Given that >the previous change tested fine before, I'm wondering if the recent busdma >changes have triggered this bug. > >I'm beginning to think the right fix here is actually to always leave the >hardware turned on and to re-insert the vlan header on receive, not insert >on transmit, in order to avoid races for queued packets during state >transitions. I'll have a chance to investigate that before going on >travel Friday, I hope. > > > The patch generates .rej against this version: /*$FreeBSD: src/sys/dev/em/if_em.c,v 1.44.2.4 2004/11/23 22:28:40 rwatson Exp $*/ *************** *** 1273,1292 **** m_head = m_pullup(m_head, sizeof(eh)); if (m_head == NULL) { *m_headp = NULL; - bus_dmamap_destroy(adapter->txtag, q.map); return (ENOBUFS); } eh = *mtod(m_head, struct ether_header *); M_PREPEND(m_head, sizeof(*evl), M_DONTWAIT); if (m_head == NULL) { *m_headp = NULL; - bus_dmamap_destroy(adapter->txtag, q.map); return (ENOBUFS); } m_head = m_pullup(m_head, sizeof(*evl)); if (m_head == NULL) { *m_headp = NULL; - bus_dmamap_destroy(adapter->txtag, q.map); return (ENOBUFS); } evl = mtod(m_head, struct ether_vlan_header *); --- 1243,1259 ---- m_head = m_pullup(m_head, sizeof(eh)); if (m_head == NULL) { *m_headp = NULL; return (ENOBUFS); } eh = *mtod(m_head, struct ether_header *); M_PREPEND(m_head, sizeof(*evl), M_DONTWAIT); if (m_head == NULL) { *m_headp = NULL; return (ENOBUFS); } m_head = m_pullup(m_head, sizeof(*evl)); if (m_head == NULL) { *m_headp = NULL; return (ENOBUFS); } evl = mtod(m_head, struct ether_vlan_header *); should I use the version from -CURRENT or it is possible (adjusted patch) to work with this one ?