PERFORCE change 136761 for review

Sam Leffler sam at FreeBSD.org
Mon Mar 3 18:54:22 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=136761

Change 136761 by sam at 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


More information about the p4-projects mailing list