From owner-freebsd-net@FreeBSD.ORG Wed Dec 8 11:54:21 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 A85A116A4D0 for ; Wed, 8 Dec 2004 11:54:21 +0000 (GMT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3DCF243D5C for ; Wed, 8 Dec 2004 11:54:21 +0000 (GMT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.13.1/8.13.1) with ESMTP id iB8BpsUZ099489; Wed, 8 Dec 2004 06:51:54 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)iB8BpsMc099486; Wed, 8 Dec 2004 11:51:54 GMT (envelope-from robert@fledge.watson.org) Date: Wed, 8 Dec 2004 11:51:54 +0000 (GMT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Iasen Kostov In-Reply-To: <41B6E8B3.8090009@OTEL.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 11:54:21 -0000 On Wed, 8 Dec 2004, Iasen Kostov wrote: > #:> ident if_em.c > if_em.c: > $FreeBSD: src/sys/dev/em/if_em.c,v 1.44.2.4 2004/11/23 22:28:40 > rwatson Exp $ > > I've deleted the whole dir and cvsuped. Does 1.54 differs much from > 1.44.2.4 ? Very odd. I have 1.44.2.4 checked out here, and if_em.diff applied without a hitch. Here's a version of the patch generated using cvs diff against the older revision. It should be basically identical to the version I sent you before, though. Diffing the two diffs generates only line number differences. If this doesn't work, drop me a copy of your if_em.c and I'll apply the change manually. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Principal Research Scientist, McAfee Research Index: if_em.c =================================================================== RCS file: /home/ncvs/src/sys/dev/em/if_em.c,v retrieving revision 1.44.2.4 diff -u -r1.44.2.4 if_em.c --- if_em.c 23 Nov 2004 22:28:40 -0000 1.44.2.4 +++ if_em.c 8 Dec 2004 11:01:19 -0000 @@ -1220,36 +1220,6 @@ } } - /* - * Map the packet for DMA. - */ - if (bus_dmamap_create(adapter->txtag, BUS_DMA_NOWAIT, &q.map)) { - adapter->no_tx_map_avail++; - return (ENOMEM); - } - error = bus_dmamap_load_mbuf(adapter->txtag, q.map, - m_head, em_tx_cb, &q, BUS_DMA_NOWAIT); - if (error != 0) { - adapter->no_tx_dma_setup++; - bus_dmamap_destroy(adapter->txtag, q.map); - return (error); - } - KASSERT(q.nsegs != 0, ("em_encap: empty packet")); - - if (q.nsegs > adapter->num_tx_desc_avail) { - adapter->no_tx_desc_avail2++; - bus_dmamap_destroy(adapter->txtag, q.map); - return (ENOBUFS); - } - - - if (ifp->if_hwassist > 0) { - em_transmit_checksum_setup(adapter, m_head, - &txd_upper, &txd_lower); - } else - txd_upper = txd_lower = 0; - - /* Find out if we are in vlan mode */ #if __FreeBSD_version < 500000 if ((m_head->m_flags & (M_PROTO1|M_PKTHDR)) == (M_PROTO1|M_PKTHDR) && @@ -1273,20 +1243,17 @@ 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 *); @@ -1299,6 +1266,36 @@ *m_headp = m_head; } + /* + * Map the packet for DMA. + */ + if (bus_dmamap_create(adapter->txtag, BUS_DMA_NOWAIT, &q.map)) { + adapter->no_tx_map_avail++; + return (ENOMEM); + } + error = bus_dmamap_load_mbuf(adapter->txtag, q.map, + m_head, em_tx_cb, &q, BUS_DMA_NOWAIT); + if (error != 0) { + adapter->no_tx_dma_setup++; + bus_dmamap_destroy(adapter->txtag, q.map); + return (error); + } + KASSERT(q.nsegs != 0, ("em_encap: empty packet")); + + if (q.nsegs > adapter->num_tx_desc_avail) { + adapter->no_tx_desc_avail2++; + bus_dmamap_destroy(adapter->txtag, q.map); + return (ENOBUFS); + } + + + if (ifp->if_hwassist > 0) { + em_transmit_checksum_setup(adapter, m_head, + &txd_upper, &txd_lower); + } else + txd_upper = txd_lower = 0; + + i = adapter->next_avail_tx_desc; if (adapter->pcix_82544) { txd_saved = i;