PERFORCE change 135086 for review

Sam Leffler sam at FreeBSD.org
Fri Feb 8 20:44:40 PST 2008


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

Change 135086 by sam at sam_ebb on 2008/02/09 04:44:03

	make addba parameters tunable through net.wlan knobs

Affected files ...

.. //depot/projects/vap/sys/net80211/ieee80211_freebsd.c#18 edit
.. //depot/projects/vap/sys/net80211/ieee80211_ht.c#11 edit

Differences ...

==== //depot/projects/vap/sys/net80211/ieee80211_freebsd.c#18 (text+ko) ====

@@ -94,23 +94,37 @@
 }
 IFC_SIMPLE_DECLARE(wlan, 0);
 
-#ifdef IEEE80211_AMPDU_AGE
 static int
-ieee80211_sysctl_ampdu_age(SYSCTL_HANDLER_ARGS)
+ieee80211_sysctl_msecs_ticks(SYSCTL_HANDLER_ARGS)
 {
-	extern int ieee80211_ampdu_age;
-	int ampdu_age = ticks_to_msecs(ieee80211_ampdu_age);
-	int error;
+	int msecs = ticks_to_msecs(*(int *)arg1);
+	int error, t;
 
-	error = sysctl_handle_int(oidp, &ampdu_age, 0, req);
+	error = sysctl_handle_int(oidp, &msecs, 0, req);
 	if (error || !req->newptr)
 		return error;
-	ieee80211_ampdu_age = msecs_to_ticks(ampdu_age);
+	t = msecs_to_ticks(msecs);
+	*(int *)arg1 = (t < 1) ? 1 : t;
 	return 0;
 }
-SYSCTL_PROC(_net_wlan, OID_AUTO, "ampdu_age", CTLFLAG_RW, NULL, 0,
-	ieee80211_sysctl_ampdu_age, "A", "AMPDU max reorder age (ms)");
+
+#ifdef IEEE80211_AMPDU_AGE
+extern int ieee80211_ampdu_age;
+SYSCTL_PROC(_net_wlan, OID_AUTO, ampdu_age, CTLFLAG_RW,
+	&ieee80211_ampdu_age, 0, ieee80211_sysctl_msecs_ticks, "I",
+	"AMPDU max reorder age (ms)");
 #endif
+extern int ieee80211_addba_timeout;
+SYSCTL_PROC(_net_wlan, OID_AUTO, addba_timeout, CTLFLAG_RW,
+	&ieee80211_addba_timeout, 0, ieee80211_sysctl_msecs_ticks, "I",
+	"ADDBA request timeout (ms)");
+extern int ieee80211_addba_backoff;
+SYSCTL_PROC(_net_wlan, OID_AUTO, addba_backoff, CTLFLAG_RW,
+	&ieee80211_addba_backoff, 0, ieee80211_sysctl_msecs_ticks, "I",
+	"ADDBA request backoff (ms)");
+extern int ieee80211_addba_maxtries;
+SYSCTL_INT(_net_wlan, OID_AUTO, addba_maxtries, CTLFLAG_RW,
+	&ieee80211_addba_maxtries, 0, "max ADDBA requests sent before backoff");
 
 static int
 ieee80211_sysctl_inact(SYSCTL_HANDLER_ARGS)

==== //depot/projects/vap/sys/net80211/ieee80211_ht.c#11 (text+ko) ====

@@ -87,10 +87,23 @@
 int	ieee80211_ampdu_age = -1;	/* threshold for ampdu reorder q (ms) */
 #endif
 int	ieee80211_recv_bar_ena = 1;
+int	ieee80211_addba_timeout = -1;
+int	ieee80211_addba_backoff = -1;
+int	ieee80211_addba_maxtries = 3;
 
-#define	IEEE80211_AGGR_TIMEOUT	msecs_to_ticks(250)
-#define	IEEE80211_AGGR_MINRETRY	msecs_to_ticks(10*1000)
-#define	IEEE80211_AGGR_MAXTRIES	3
+/*
+ * Setup HT parameters that depends on the clock frequency.
+ */
+static void
+ieee80211_ht_setup(void)
+{
+#ifdef IEEE80211_AMPDU_AGE
+	ieee80211_ampdu_age = msecs_to_ticks(500);
+#endif
+	ieee80211_addba_timeout = msecs_to_ticks(250);
+	ieee80211_addba_backoff = msecs_to_ticks(10*1000);
+}
+SYSINIT(wlan_ht, SI_SUB_DRIVERS, SI_ORDER_FIRST, ieee80211_ht_setup, NULL);
 
 static int ieee80211_addba_request(struct ieee80211_node *ni,
 	struct ieee80211_tx_ampdu *tap,
@@ -106,10 +119,6 @@
 void
 ieee80211_ht_attach(struct ieee80211com *ic)
 {
-#ifdef IEEE80211_AMPDU_AGE
-	if (ieee80211_ampdu_age == -1)
-		ieee80211_ampdu_age = msecs_to_ticks(500);
-#endif
 	/* setup default aggregation policy */
 	ic->ic_recv_action = ieee80211_aggr_recv_action;
 	ic->ic_send_action = ieee80211_send_action;
@@ -1232,7 +1241,7 @@
 addba_start_timeout(struct ieee80211_tx_ampdu *tap)
 {
 	/* XXX use CALLOUT_PENDING instead? */
-	callout_reset(&tap->txa_timer, IEEE80211_AGGR_TIMEOUT,
+	callout_reset(&tap->txa_timer, ieee80211_addba_timeout,
 	    addba_timeout, tap);
 	tap->txa_flags |= IEEE80211_AGGR_XCHGPEND;
 	tap->txa_lastrequest = ticks;
@@ -1546,12 +1555,12 @@
 		callout_init(&tap->txa_timer, CALLOUT_MPSAFE);
 		tap->txa_flags |= IEEE80211_AGGR_SETUP;
 	}
-	if (tap->txa_attempts >= IEEE80211_AGGR_MAXTRIES &&
-	    (ticks - tap->txa_lastrequest) < IEEE80211_AGGR_MINRETRY) {
+	if (tap->txa_attempts >= ieee80211_addba_maxtries &&
+	    (ticks - tap->txa_lastrequest) < ieee80211_addba_backoff) {
 		/*
-		 * Don't retry too often; IEEE80211_AGGR_MINRETRY
+		 * Don't retry too often; ieee80211_addba_backoff
 		 * defines the minimum interval we'll retry after
-		 * IEEE80211_AGGR_MAXTRIES failed attempts to
+		 * ieee80211_addba_maxtries failed attempts to
 		 * negotiate use.
 		 */
 		return 0;
@@ -1583,7 +1592,7 @@
 		    ni, "%s: could not setup BA stream for AC %d",
 		    __func__, tap->txa_ac);
 		/* defer next try so we don't slam the driver with requests */
-		tap->txa_attempts = IEEE80211_AGGR_MAXTRIES;
+		tap->txa_attempts = ieee80211_addba_maxtries;
 		tap->txa_lastrequest = ticks;
 		return 0;
 	}


More information about the p4-projects mailing list