Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jan 2017 04:47:38 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r312662 - head/sys/dev/ath
Message-ID:  <201701230447.v0N4lcKj017916@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Mon Jan 23 04:47:38 2017
New Revision: 312662
URL: https://svnweb.freebsd.org/changeset/base/312662

Log:
  [ath] modify cabq and per-node packet usage limits.
  
  * limit cabq to 64 - in practice if this stays at ath_txbuf then
    all buffers can be tied up by a very busy broadcast domain (eg ARP
    storm, way too much MDNS/NETBIOS).  It's been like this in the
    freebsd-wifi-build AP project for the longest time.
  
  * Now that I figured out the hilarity inherent in aggregate forming
    and AR9380 EDMA work, change the per-node to 64 frames by default.
    I'll do some more work to shorten the queue latency introduced when
    doing data so TCP isn't so terrible, but it's now no longer /always/
    tens of milliseconds of extra latency  when doing active iperf tests.
  
  Notes:
  
  The reason for the extra latency is partly tx/rx taskqueue handling and
  scheduling, and partly due to a lack of airtime/QoS awareness of per-node
  traffic.  Ideally we'd have different limits/priorities on the QoS/TID
  levels per node so say, voice/video data got a better share of buffer
  allocations over best effort/bulk data, but we currently don't implement
  that.  It's not /hard/ to do, I just need to do it.
  
  Tested:
  
  * AR9380 (STA), AR9580 (hostap) - both with the relevant changes.
    TCP is now at around 180mbit with rate control and RTS protection
    enabled.  UDP stays at 355mbit at MCS23, no HT protection.

Modified:
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c	Mon Jan 23 04:30:08 2017	(r312661)
+++ head/sys/dev/ath/if_ath.c	Mon Jan 23 04:47:38 2017	(r312662)
@@ -1028,12 +1028,16 @@ ath_attach(u_int16_t devid, struct ath_s
 	 * otherwise) to be transmitted.
 	 */
 	sc->sc_txq_data_minfree = 10;
+
 	/*
-	 * Leave this as default to maintain legacy behaviour.
-	 * Shortening the cabq/mcastq may end up causing some
-	 * undesirable behaviour.
+	 * Shorten this to 64 packets, or 1/4 ath_txbuf, whichever
+	 * is smaller.
+	 *
+	 * Anything bigger can potentially see the cabq consume
+	 * almost all buffers, starving everything else, only to
+	 * see most fail to transmit in the given beacon interval.
 	 */
-	sc->sc_txq_mcastq_maxdepth = ath_txbuf;
+	sc->sc_txq_mcastq_maxdepth = MIN(64, ath_txbuf / 4);
 
 	/*
 	 * How deep can the node software TX queue get whilst it's asleep.
@@ -1041,11 +1045,10 @@ ath_attach(u_int16_t devid, struct ath_s
 	sc->sc_txq_node_psq_maxdepth = 16;
 
 	/*
-	 * Default the maximum queue depth for a given node
-	 * to 1/4'th the TX buffers, or 64, whichever
-	 * is larger.
+	 * Default the maximum queue to to 1/4'th the TX buffers, or
+	 * 64, whichever is smaller.
 	 */
-	sc->sc_txq_node_maxdepth = MAX(64, ath_txbuf / 4);
+	sc->sc_txq_node_maxdepth = MIN(64, ath_txbuf / 4);
 
 	/* Enable CABQ by default */
 	sc->sc_cabq_enable = 1;



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