Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Mar 2013 09:26:59 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r247616 - user/adrian/net80211_tx/sys/net80211
Message-ID:  <201303020926.r229QxkW024331@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Sat Mar  2 09:26:59 2013
New Revision: 247616
URL: http://svnweb.freebsd.org/changeset/base/247616

Log:
  Revert the VAP TX task stuff and go back to direct dispatch.
  
  Deferring the VAP TX side of things doesn't buy us anything.
  The only thing is currently buys is serialising the AMPDU TX handling
  in this path - but it doesn't at all serialise the AMPDU TX handling
  from other paths (eg mesh TX.)
  
  The current locking implementation still serialises the TX path correctly
  for 802.11 sequence number handling and driver dispatch, so that's good.

Modified:
  user/adrian/net80211_tx/sys/net80211/ieee80211.c
  user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.c
  user/adrian/net80211_tx/sys/net80211/ieee80211_output.c
  user/adrian/net80211_tx/sys/net80211/ieee80211_proto.c
  user/adrian/net80211_tx/sys/net80211/ieee80211_proto.h
  user/adrian/net80211_tx/sys/net80211/ieee80211_var.h

Modified: user/adrian/net80211_tx/sys/net80211/ieee80211.c
==============================================================================
--- user/adrian/net80211_tx/sys/net80211/ieee80211.c	Sat Mar  2 08:12:41 2013	(r247615)
+++ user/adrian/net80211_tx/sys/net80211/ieee80211.c	Sat Mar  2 09:26:59 2013	(r247616)
@@ -427,8 +427,7 @@ ieee80211_vap_setup(struct ieee80211com 
 	if_initname(ifp, name, unit);
 	ifp->if_softc = vap;			/* back pointer */
 	ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST;
-	ifp->if_transmit = ieee80211_vap_transmit;
-	ifp->if_qflush = ieee80211_vap_qflush;
+	ifp->if_start = ieee80211_start;
 	ifp->if_ioctl = ieee80211_ioctl;
 	ifp->if_init = ieee80211_init;
 	/* NB: input+output filled in by ether_ifattach */
@@ -623,7 +622,6 @@ ieee80211_vap_detach(struct ieee80211vap
 	 */
 	ieee80211_draintask(ic, &vap->iv_nstate_task);
 	ieee80211_draintask(ic, &vap->iv_swbmiss_task);
-	ieee80211_draintask(ic, &vap->iv_tx_task);
 
 	/* XXX band-aid until ifnet handles this for us */
 	taskqueue_drain(taskqueue_swi, &ifp->if_linktask);

Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.c
==============================================================================
--- user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.c	Sat Mar  2 08:12:41 2013	(r247615)
+++ user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.c	Sat Mar  2 09:26:59 2013	(r247616)
@@ -761,7 +761,7 @@ static void
 bpf_track(void *arg, struct ifnet *ifp, int dlt, int attach)
 {
 	/* NB: identify vap's by if_start */
-	if (dlt == DLT_IEEE802_11_RADIO && ifp->if_transmit == ieee80211_vap_transmit) {
+	if (dlt == DLT_IEEE802_11_RADIO && ifp->if_start == ieee80211_start) {
 		struct ieee80211vap *vap = ifp->if_softc;
 		/*
 		 * Track bpf radiotap listener state.  We mark the vap

Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_output.c
==============================================================================
--- user/adrian/net80211_tx/sys/net80211/ieee80211_output.c	Sat Mar  2 08:12:41 2013	(r247615)
+++ user/adrian/net80211_tx/sys/net80211/ieee80211_output.c	Sat Mar  2 09:26:59 2013	(r247616)
@@ -360,81 +360,14 @@ ieee80211_start_pkt(struct ieee80211vap 
 }
 
 /*
- * Entry point for transmission for all VAPs.
- *
- * This sanitises the mbuf flags and queues it into the transmit
- * queue.
- */
-int
-ieee80211_vap_transmit(struct ifnet *ifp, struct mbuf *m)
-{
-	struct ieee80211vap *vap = ifp->if_softc;
-	struct ieee80211com *ic = vap->iv_ic;
-	struct ifnet *parent = ic->ic_ifp;
-
-	/* NB: parent must be up and running */
-	if (!IFNET_IS_UP_RUNNING(parent)) {
-		IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
-		    "%s: ignore queue, parent %s not up+running\n",
-		    __func__, parent->if_xname);
-		/* XXX stat */
-		m_free(m);
-		return (EINVAL);/* XXX errno? */
-	}
-
-	IF_LOCK(&ifp->if_snd);
-
-	/* Enforce queue limits */
-	if (_IF_QFULL(&ifp->if_snd)) {
-		IF_UNLOCK(&ifp->if_snd);
-		m_free(m);
-		return (ENOBUFS);	/* XXX errno? */
-	}
-
-	/*
-	 * Sanitize mbuf flags for net80211 use.  We cannot
-	 * clear M_PWR_SAV or M_MORE_DATA because these may
-	 * be set for frames that are re-submitted from the
-	 * power save queue.
-	 *
-	 * NB: This must be done before ieee80211_classify as
-	 *     it marks EAPOL in frames with M_EAPOL.
-	 *
-	 * XXX TODO: for VAP frames coming in from the stack
-	 * itself, we should just inject them directly into
-	 * the vap rather than via ieee80211_vap_transmit().
-	 * Yes, they still need to go into the ifnet queue
-	 * and be dequeued, but we can skip this particular
-	 * check as they're already "in" the net80211 layer.
-	 */
-	m->m_flags &= ~(M_80211_TX - M_PWR_SAV - M_MORE_DATA);
-	_IF_ENQUEUE(&ifp->if_snd, m);
-	IF_UNLOCK(&ifp->if_snd);
-
-	/* Schedule the deferred TX task */
-	ieee80211_runtask(ic, &vap->iv_tx_task);
-
-	return (0);
-}
-
-void
-ieee80211_vap_qflush(struct ifnet *ifp)
-{
-
-	/* XXX TODO */
-}
-
-
-/*
  * Start method for vap's.  All packets from the stack come
  * through here.  We handle common processing of the packets
  * before dispatching them to the underlying device.
  */
 void
-ieee80211_vap_tx_task(void *arg, int npending)
+ieee80211_start(struct ifnet *ifp)
 {
-	struct ieee80211vap *vap = (struct ieee80211vap *) arg;
-	struct ifnet *ifp = vap->iv_ifp;
+	struct ieee80211vap *vap = ifp->if_softc;
 	struct ieee80211com *ic = vap->iv_ic;
 	struct ifnet *parent = ic->ic_ifp;
 	struct mbuf *m;
@@ -481,6 +414,19 @@ ieee80211_vap_tx_task(void *arg, int npe
 		IFQ_DEQUEUE(&ifp->if_snd, m);
 		if (m == NULL)
 			break;
+		/*
+		 * Sanitize mbuf flags for net80211 use.  We cannot
+		 * clear M_PWR_SAV or M_MORE_DATA because these may
+		 * be set for frames that are re-submitted from the
+		 * power save queue.
+		 *
+		 * NB: This must be done before ieee80211_classify as
+		 *     it marks EAPOL in frames with M_EAPOL.
+		 */
+		m->m_flags &= ~(M_80211_TX - M_PWR_SAV - M_MORE_DATA);
+		/*
+		 * Bump to the packet transmission path.
+		 */
 		(void) ieee80211_start_pkt(vap, m);
 		/* mbuf is consumed here */
 	}

Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_proto.c
==============================================================================
--- user/adrian/net80211_tx/sys/net80211/ieee80211_proto.c	Sat Mar  2 08:12:41 2013	(r247615)
+++ user/adrian/net80211_tx/sys/net80211/ieee80211_proto.c	Sat Mar  2 09:26:59 2013	(r247616)
@@ -199,7 +199,6 @@ ieee80211_proto_vattach(struct ieee80211
 	callout_init(&vap->iv_mgtsend, CALLOUT_MPSAFE);
 	TASK_INIT(&vap->iv_nstate_task, 0, ieee80211_newstate_cb, vap);
 	TASK_INIT(&vap->iv_swbmiss_task, 0, beacon_swmiss, vap);
-	TASK_INIT(&vap->iv_tx_task, 0, ieee80211_vap_tx_task, vap);
 	/*
 	 * Install default tx rate handling: no fixed rate, lowest
 	 * supported rate for mgmt and multicast frames.  Default
@@ -1793,7 +1792,7 @@ ieee80211_newstate_cb(void *xvap, int np
 		 * XXX Kick-start a VAP queue - this should be a method,
 		 * not if_start()!
 		 */
-		ieee80211_runtask(ic, &vap->iv_tx_task);
+		if_start(vap->iv_ifp);
 
 		/* bring up any vaps waiting on us */
 		wakeupwaiting(vap);

Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_proto.h
==============================================================================
--- user/adrian/net80211_tx/sys/net80211/ieee80211_proto.h	Sat Mar  2 08:12:41 2013	(r247615)
+++ user/adrian/net80211_tx/sys/net80211/ieee80211_proto.h	Sat Mar  2 09:26:59 2013	(r247616)
@@ -103,9 +103,7 @@ int	ieee80211_raw_output(struct ieee8021
 void	ieee80211_send_setup(struct ieee80211_node *, struct mbuf *, int, int,
         const uint8_t [IEEE80211_ADDR_LEN], const uint8_t [IEEE80211_ADDR_LEN],
         const uint8_t [IEEE80211_ADDR_LEN]);
-int	ieee80211_vap_transmit(struct ifnet *ifp, struct mbuf *m);
-void	ieee80211_vap_qflush(struct ifnet *ifp);
-void	ieee80211_vap_tx_task(void *, int);
+void	ieee80211_start(struct ifnet *ifp);
 int	ieee80211_send_nulldata(struct ieee80211_node *);
 int	ieee80211_classify(struct ieee80211_node *, struct mbuf *m);
 struct mbuf *ieee80211_mbuf_adjust(struct ieee80211vap *, int,

Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_var.h
==============================================================================
--- user/adrian/net80211_tx/sys/net80211/ieee80211_var.h	Sat Mar  2 08:12:41 2013	(r247615)
+++ user/adrian/net80211_tx/sys/net80211/ieee80211_var.h	Sat Mar  2 09:26:59 2013	(r247616)
@@ -362,7 +362,6 @@ struct ieee80211vap {
 	int			iv_nstate_arg;	/* pending state arg */
 	struct task		iv_nstate_task;	/* deferred state processing */
 	struct task		iv_swbmiss_task;/* deferred iv_bmiss call */
-	struct task		iv_tx_task;	/* VAP deferred TX task */
 	struct callout		iv_mgtsend;	/* mgmt frame response timer */
 						/* inactivity timer settings */
 	int			iv_inact_init;	/* setting for new station */



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