From nobody@FreeBSD.org  Wed Nov  6 20:09:40 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id 6DB38276
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  6 Nov 2013 20:09:40 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 5BB4A2A44
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  6 Nov 2013 20:09:40 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id rA6K9e4D004496
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 6 Nov 2013 20:09:40 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id rA6K9eUL004493;
	Wed, 6 Nov 2013 20:09:40 GMT
	(envelope-from nobody)
Message-Id: <201311062009.rA6K9eUL004493@oldred.freebsd.org>
Date: Wed, 6 Nov 2013 20:09:40 GMT
From: Gavin Atkinson <gavin@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [wlan] ENOBUFFS incorrectly returned when tx packet is deferred due to power management
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         183727
>Category:       kern
>Synopsis:       [wlan] ENOBUFFS incorrectly returned when tx packet is deferred due to power management
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-wireless
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 06 20:10:02 UTC 2013
>Closed-Date:    
>Last-Modified:  Tue Dec 10 19:20:00 UTC 2013
>Originator:     Gavin Atkinson
>Release:        11-CURRENT
>Organization:
>Environment:
head r254082
>Description:
r254082 introduced a bug where outgoing packets that were not immediately transmitted but ended up being enqueued would still return ENOBUFFS to the caller.  This manifests itself for me (iwn, Intel 5100) as up to five "No buffer space available" messages while pinging an external host, almost exactly 300 seconds apart.  This seems to only happen when using 11n, and can be worked around by "ifconfig wlan0 -ht" or similar.

Instrumenting ieee80211_output.c shows that ENOBUFFS is being returned by the IEEE80211_NODE_PWR_MGT check in ieee80211_vap_pkt_send_dest().

It is believed (though not yet confirmed) that r257754 will fix this issue; this PR is to provide extra referenced information for the MFC.
>How-To-Repeat:
Attach to an 11n network, ping something remote.
>Fix:
r257754, hopefully.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-wireless 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Wed Nov 6 20:45:41 UTC 2013 
Responsible-Changed-Why:  
Over to -wireless 

http://www.freebsd.org/cgi/query-pr.cgi?pr=183727 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/183727: commit references a PR
Date: Tue, 10 Dec 2013 13:35:13 +0000 (UTC)

 Author: gavin
 Date: Tue Dec 10 13:35:04 2013
 New Revision: 259172
 URL: http://svnweb.freebsd.org/changeset/base/259172
 
 Log:
   Merge r257754 (by adrian) from head:
   
     Don't return ENOBUFS if the transmit path handles the frame but queues
     it (eg in power save.)
   
   10.0 candidate.
   
   PR:		kern/183727
 
 Modified:
   stable/10/sys/net80211/ieee80211_output.c
 Directory Properties:
   stable/10/   (props changed)
 
 Modified: stable/10/sys/net80211/ieee80211_output.c
 ==============================================================================
 --- stable/10/sys/net80211/ieee80211_output.c	Tue Dec 10 13:34:28 2013	(r259171)
 +++ stable/10/sys/net80211/ieee80211_output.c	Tue Dec 10 13:35:04 2013	(r259172)
 @@ -143,8 +143,12 @@ ieee80211_vap_pkt_send_dest(struct ieee8
  		 */
  		(void) ieee80211_pwrsave(ni, m);
  		ieee80211_free_node(ni);
 -		/* XXX better status? */
 -		return (ENOBUFS);
 +
 +		/*
 +		 * We queued it fine, so tell the upper layer
 +		 * that we consumed it.
 +		 */
 +		return (0);
  	}
  	/* calculate priority so drivers can find the tx queue */
  	if (ieee80211_classify(ni, m)) {
 @@ -155,8 +159,9 @@ ieee80211_vap_pkt_send_dest(struct ieee8
  		ifp->if_oerrors++;
  		m_freem(m);
  		ieee80211_free_node(ni);
 +
  		/* XXX better status? */
 -		return (ENOBUFS);
 +		return (0);
  	}
  	/*
  	 * Stash the node pointer.  Note that we do this after
 @@ -168,7 +173,6 @@ ieee80211_vap_pkt_send_dest(struct ieee8
  
  	BPF_MTAP(ifp, m);		/* 802.3 tx */
  
 -
  	/*
  	 * Check if A-MPDU tx aggregation is setup or if we
  	 * should try to enable it.  The sta must be associated
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/183727: commit references a PR
Date: Tue, 10 Dec 2013 19:12:24 +0000 (UTC)

 Author: gavin
 Date: Tue Dec 10 19:12:16 2013
 New Revision: 259184
 URL: http://svnweb.freebsd.org/changeset/base/259184
 
 Log:
   Merge r259172 from stable/10 (head r257754 by adrian):
   
     Don't return ENOBUFS if the transmit path handles the frame but queues
     it (eg in power save.)
   
   PR:		kern/183727
   Approved by:	re (glebius)
 
 Modified:
   releng/10.0/sys/net80211/ieee80211_output.c
 Directory Properties:
   releng/10.0/   (props changed)
 
 Modified: releng/10.0/sys/net80211/ieee80211_output.c
 ==============================================================================
 --- releng/10.0/sys/net80211/ieee80211_output.c	Tue Dec 10 18:18:39 2013	(r259183)
 +++ releng/10.0/sys/net80211/ieee80211_output.c	Tue Dec 10 19:12:16 2013	(r259184)
 @@ -143,8 +143,12 @@ ieee80211_vap_pkt_send_dest(struct ieee8
  		 */
  		(void) ieee80211_pwrsave(ni, m);
  		ieee80211_free_node(ni);
 -		/* XXX better status? */
 -		return (ENOBUFS);
 +
 +		/*
 +		 * We queued it fine, so tell the upper layer
 +		 * that we consumed it.
 +		 */
 +		return (0);
  	}
  	/* calculate priority so drivers can find the tx queue */
  	if (ieee80211_classify(ni, m)) {
 @@ -155,8 +159,9 @@ ieee80211_vap_pkt_send_dest(struct ieee8
  		ifp->if_oerrors++;
  		m_freem(m);
  		ieee80211_free_node(ni);
 +
  		/* XXX better status? */
 -		return (ENOBUFS);
 +		return (0);
  	}
  	/*
  	 * Stash the node pointer.  Note that we do this after
 @@ -168,7 +173,6 @@ ieee80211_vap_pkt_send_dest(struct ieee8
  
  	BPF_MTAP(ifp, m);		/* 802.3 tx */
  
 -
  	/*
  	 * Check if A-MPDU tx aggregation is setup or if we
  	 * should try to enable it.  The sta must be associated
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
