[PATCH 1/2] supplicant: Use high-priority queue for management packets.

Ben Greear greearb
Mon Sep 23 09:04:38 PDT 2013

On 09/23/2013 01:08 AM, Jouni Malinen wrote:
> On Mon, Sep 09, 2013 at 11:49:04AM -0700, greearb at candelatech.com wrote:
>> Without this patch, wpa_supplicant EAPOL packets (at least)
>> are sent on normal best-effort TX queue.  I believe they
>> should be on the VO high-priority queue instead.
>> diff --git a/src/l2_packet/l2_packet_linux.c b/src/l2_packet/l2_packet_linux.c
>> @@ -97,6 +97,7 @@ struct l2_packet_data * l2_packet_init(
>> +	/* Use high-priority queue for management packets
>> +	 * http://wireless.kernel.org/en/developers/Documentation/mac80211/queues
>> +	 */
>> +	if (setsockopt(l2->fd, SOL_SOCKET,
>> +		       SO_PRIORITY, (char*)&val, sizeof(val)) < 0) {
> This seems to be assuming that mac80211 is used always. That is not
> really the case and I guess this SO_PRIORITY change to a special
> mac80211-specific value could result in undesired results with
> non-mac80211 drivers.

The special priority is defined in the net/wireless/ dir of the kernel,
and does not make special mention of mac80211 v/s other logic.

 From what I can tell, there is no other way to specify QoS when
sending on packet-sockets.  The skb->priority never hits the wire
directly, so either something should be using it properly, or it
will just be ignored and we are no worse off than before.  If
some driver is actually conflicting with the documentation, then
we just need to fix it.

from net/wireless/util.c:

/* Given a data frame determine the 802.1p/1d tag to use. */
unsigned int cfg80211_classify8021d(struct sk_buff *skb)
	unsigned int dscp;

	/* skb->priority values from 256->263 are magic values to
	 * directly indicate a specific 802.1d priority.  This is used
	 * to allow 802.1d priority to be passed directly in from VLAN
	 * tags, etc.
	if (skb->priority >= 256 && skb->priority <= 263)
		return skb->priority - 256;

	switch (skb->protocol) {
	case htons(ETH_P_IP):
		dscp = ipv4_get_dsfield(ip_hdr(skb)) & 0xfc;
	case htons(ETH_P_IPV6):
		dscp = ipv6_get_dsfield(ipv6_hdr(skb)) & 0xfc;
		return 0;

	return dscp >> 5;


Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

More information about the Hostap mailing list