Patchwork [2/2] hostapd: Use high-priority queue for management packets.

login
register
mail settings
Submitter Ben Greear
Date Sept. 9, 2013, 6:49 p.m.
Message ID <1378752545-9783-2-git-send-email-greearb@candelatech.com>
Download mbox | patch
Permalink /patch/273650/
State Rejected
Headers show

Comments

Ben Greear - Sept. 9, 2013, 6:49 p.m.
From: Ben Greear <greearb@candelatech.com>

Without this patch, wpa_supplicant EAPOL packets (at least)
are sent on normal best-effort TX queue when using the new
Linux tx-status-completion API.  I believe they should be on
the VO high-priority queue instead.

Signed-hostap: Ben Greear <greearb@candelatech.com>
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 b643b3f... f4102ab... M	src/drivers/driver_nl80211.c
 src/drivers/driver_nl80211.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

Patch

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index b643b3f..f4102ab 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -3658,10 +3658,22 @@  static void * wpa_driver_nl80211_init(void *ctx, const char *ifname,
 		goto failed;
 
 	if (drv->data_tx_status) {
-		int enabled = 1;
+		int val = (256 + 7);
 
+		/* Use high-priority queue for EAPOL packets
+		 * http://wireless.kernel.org/en/developers/Documentation/mac80211/queues
+		 */
+		if (setsockopt(drv->eapol_tx_sock, SOL_SOCKET,
+			       SO_PRIORITY, (char*)&val, sizeof(val)) < 0) {
+			/* Carry on...this is not fatal. */
+			wpa_printf(MSG_DEBUG,
+				   "nl80211: eapol sock priority sockopt (%i) failed\n",
+				   val);
+		}
+
+		val = 1;
 		if (setsockopt(drv->eapol_tx_sock, SOL_SOCKET, SO_WIFI_STATUS,
-			       &enabled, sizeof(enabled)) < 0) {
+			       &val, sizeof(val)) < 0) {
 			wpa_printf(MSG_DEBUG,
 				"nl80211: wifi status sockopt failed\n");
 			drv->data_tx_status = 0;