Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 08 Dec 2004 12:58:31 +0200
From:      Iasen Kostov <tbyte@OTEL.net>
To:        Robert Watson <rwatson@freebsd.org>
Cc:        freebsd-net@freebsd.org
Subject:   Re: em(4) VLAN + PROMISC still doesn't work with latest CVS version
Message-ID:  <41B6DE57.4030909@OTEL.net>
In-Reply-To: <Pine.NEB.3.96L.1041208102811.24305F-100000@fledge.watson.org>
References:  <Pine.NEB.3.96L.1041208102811.24305F-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 ?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41B6DE57.4030909>