From owner-p4-projects@FreeBSD.ORG Mon Mar 3 18:54:22 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EDF3D1065674; Mon, 3 Mar 2008 18:54:21 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD83A1065672 for ; Mon, 3 Mar 2008 18:54:21 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id ADAFB8FC1F for ; Mon, 3 Mar 2008 18:54:21 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m23IsLVd073933 for ; Mon, 3 Mar 2008 18:54:21 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m23IsLuJ073931 for perforce@freebsd.org; Mon, 3 Mar 2008 18:54:21 GMT (envelope-from sam@freebsd.org) Date: Mon, 3 Mar 2008 18:54:21 GMT Message-Id: <200803031854.m23IsLuJ073931@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 136761 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2008 18:54:22 -0000 http://perforce.freebsd.org/chv.cgi?CH=136761 Change 136761 by sam@sam_ebb on 2008/03/03 18:54:11 Track mbuf flag changes: o use M_PROTO* defs for all flags o reclaim 2 flag bits used to encode the AC by re-using the vlan tag; this should be safe since use the vlan only when classifying packets in the tx path before they go to the driver o remove hack to propagate special mbuf flags when copying the packet header; it's not needed any more now that are flags are part of M_COPYFLAGS Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211_freebsd.h#20 edit .. //depot/projects/vap/sys/net80211/ieee80211_output.c#37 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211_freebsd.h#20 (text+ko) ==== @@ -228,33 +228,29 @@ /* tx path usage */ #define M_LINK0 M_PROTO1 /* WEP requested */ +#define M_WDS M_PROTO2 /* WDS frame */ +#define M_EAPOL M_PROTO3 /* PAE/EAPOL frame */ #define M_PWR_SAV M_PROTO4 /* bypass PS handling */ #define M_MORE_DATA M_PROTO5 /* more data frames to follow */ -#define M_FF 0x020000 /* fast frame */ -#define M_TXCB 0x040000 /* do tx complete callback */ -#define M_WDS 0x080000 /* WDS frame */ -#define M_EAPOL 0x100000 /* PAE/EAPOL frame */ +#define M_FF M_PROTO6 /* fast frame */ +#define M_TXCB M_PROTO7 /* do tx complete callback */ #define M_80211_TX \ - (0x60000|M_PROTO1|M_WME_AC_MASK|M_PROTO4|M_PROTO5|M_WDS|M_EAPOL) + (M_LINK0|M_WDS|M_EAPOL|M_PWR_SAV|M_MORE_DATA|M_FF|M_TXCB) /* rx path usage */ #define M_AMPDU M_PROTO1 /* A-MPDU processing done */ #define M_WEP M_PROTO2 /* WEP done by hardware */ #define M_80211_RX (M_AMPDU|M_WEP) /* - * Encode WME access control bits in the PROTO flags. - * This is safe since it's passed directly in to the - * driver and there's no chance someone else will clobber - * them on us. + * Store WME access control bits in the vlan tag. + * This is safe since it's done after the packet is classified + * (where we use any previous tag) and because it's passed + * directly in to the driver and there's no chance someone + * else will clobber them on us. */ -#define M_WME_AC_MASK (M_PROTO2|M_PROTO3) -/* XXX 5 is wrong if M_PROTO* are redefined */ -#define M_WME_AC_SHIFT 5 - #define M_WME_SETAC(m, ac) \ - ((m)->m_flags = ((m)->m_flags &~ M_WME_AC_MASK) | \ - ((ac) << M_WME_AC_SHIFT)) -#define M_WME_GETAC(m) (((m)->m_flags >> M_WME_AC_SHIFT) & 0x3) + ((m)->m_pkthdr.ether_vtag = (ac)) +#define M_WME_GETAC(m) ((m)->m_pkthdr.ether_vtag) /* * Mbufs on the power save queue are tagged with an age and ==== //depot/projects/vap/sys/net80211/ieee80211_output.c#37 (text+ko) ==== @@ -737,7 +737,6 @@ m_move_pkthdr(n, m); n->m_len = 0; /* NB: m_gethdr does not set */ n->m_data += needed_space; - n->m_flags |= m->m_flags & M_80211_TX; /* * Pull up Ethernet header to create the expected layout. * We could use m_pullup but that's overkill (i.e. we don't