Bug 183727 - [wlan] ENOBUFFS incorrectly returned when tx packet is deferred due to power management
Summary: [wlan] ENOBUFFS incorrectly returned when tx packet is deferred due to power ...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: wireless (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-wireless (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-06 20:10 UTC by Gavin Atkinson
Modified: 2018-12-09 04:56 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gavin Atkinson freebsd_committer freebsd_triage 2013-11-06 20:10:02 UTC
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.

Fix: 

r257754, hopefully.
How-To-Repeat: Attach to an 11n network, ping something remote.
Comment 1 Gavin Atkinson freebsd_committer freebsd_triage 2013-11-06 20:45:41 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-wireless

Over to -wireless
Comment 2 dfilter service freebsd_committer freebsd_triage 2013-12-10 13:35:13 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"
Comment 3 dfilter service freebsd_committer freebsd_triage 2013-12-10 19:12:24 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"
Comment 4 Eitan Adler freebsd_committer freebsd_triage 2018-05-28 19:46:30 UTC
batch change:

For bugs that match the following
-  Status Is In progress 
AND
- Untouched since 2018-01-01.
AND
- Affects Base System OR Documentation

DO:

Reset to open status.


Note:
I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
Comment 5 Andriy Voskoboinyk freebsd_committer freebsd_triage 2018-12-09 04:56:17 UTC
Already fixed in r257754 (as noted in comments).