Re: (untested) ath fix upon error

2015-11-04 Thread Adrian Chadd
On 3 November 2015 at 08:12, Andriy Voskoboinyk  wrote:
> Tue, 03 Nov 2015 17:31:18 +0200 було написано Adrian Chadd
> :
>
>
>> hiya,
>>
>> what do people think about this to fix ath(4) transmit errors:
>>
>> adrian@victoria:~/work/freebsd/head-embedded/src % svn diff sys/dev/ath
>> Index: sys/dev/ath/if_ath.c
>> ===
>> --- sys/dev/ath/if_ath.c(revision 290048)
>> +++ sys/dev/ath/if_ath.c(working copy)
>> @@ -3320,6 +3320,9 @@
>>  *
>>  * Note: if this fails, then the mbufs are freed but
>>  * not the node reference.
>> +*
>> +* So, we now have to free the node reference ourselves here
>> +* and return OK up to the stack.
>>  */
>> next = m->m_nextpkt;
>> if (ath_tx_start(sc, ni, bf, m)) {
>> @@ -3336,7 +3339,14 @@
>>  */
>> ath_txfrag_cleanup(sc, , ni);
>> ATH_TXBUF_UNLOCK(sc);
>> -   retval = ENOBUFS;
>> +
>> +   /*
>> +* XXX: And free the node/return OK; ath_tx_start() may
>> have
>> +*  modified the buffer.  We currently have no way to
>> +*  signify that the mbuf was freed but there was an
>> error.
>> +*/
>> +   ieee80211_node_free(ni);
>> +   retval = 0;
>> goto finish;
>> }
>>
>>
>> .. the idea is that we can't return failure once we've called
>> ath_tx_start(), as the mbuf needs to be consumed. So we return OK and
>> just count an error.
>>
>
> Yes, I think this (temporary?) workaround should fix the issue.
>

Cool, thanks!


-a
___
freebsd-wireless@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-wireless
To unsubscribe, send any mail to "freebsd-wireless-unsubscr...@freebsd.org"

Re: (untested) ath fix upon error

2015-11-04 Thread Mark Felder


On Wed, Nov 4, 2015, at 12:11, Adrian Chadd wrote:
> On 3 November 2015 at 08:12, Andriy Voskoboinyk  wrote:
> > Tue, 03 Nov 2015 17:31:18 +0200 було написано Adrian Chadd
> > :
> >
> >
> >> hiya,
> >>
> >> what do people think about this to fix ath(4) transmit errors:
> >>
> >> adrian@victoria:~/work/freebsd/head-embedded/src % svn diff sys/dev/ath
> >> Index: sys/dev/ath/if_ath.c
> >> ===
> >> --- sys/dev/ath/if_ath.c(revision 290048)
> >> +++ sys/dev/ath/if_ath.c(working copy)
> >> @@ -3320,6 +3320,9 @@
> >>  *
> >>  * Note: if this fails, then the mbufs are freed but
> >>  * not the node reference.
> >> +*
> >> +* So, we now have to free the node reference ourselves here
> >> +* and return OK up to the stack.
> >>  */
> >> next = m->m_nextpkt;
> >> if (ath_tx_start(sc, ni, bf, m)) {
> >> @@ -3336,7 +3339,14 @@
> >>  */
> >> ath_txfrag_cleanup(sc, , ni);
> >> ATH_TXBUF_UNLOCK(sc);
> >> -   retval = ENOBUFS;
> >> +
> >> +   /*
> >> +* XXX: And free the node/return OK; ath_tx_start() may
> >> have
> >> +*  modified the buffer.  We currently have no way to
> >> +*  signify that the mbuf was freed but there was an
> >> error.
> >> +*/
> >> +   ieee80211_node_free(ni);
> >> +   retval = 0;
> >> goto finish;
> >> }
> >>
> >>
> >> .. the idea is that we can't return failure once we've called
> >> ath_tx_start(), as the mbuf needs to be consumed. So we return OK and
> >> just count an error.
> >>
> >
> > Yes, I think this (temporary?) workaround should fix the issue.
> >
> 
> Cool, thanks!
> 
> 
> -a

I'm running it... if I can manage a few days uptime it has worked.

-- 
  Mark Felder
  ports-secteam member
  f...@freebsd.org
___
freebsd-wireless@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-wireless
To unsubscribe, send any mail to "freebsd-wireless-unsubscr...@freebsd.org"

(untested) ath fix upon error

2015-11-03 Thread Adrian Chadd
hiya,

what do people think about this to fix ath(4) transmit errors:

adrian@victoria:~/work/freebsd/head-embedded/src % svn diff sys/dev/ath
Index: sys/dev/ath/if_ath.c
===
--- sys/dev/ath/if_ath.c(revision 290048)
+++ sys/dev/ath/if_ath.c(working copy)
@@ -3320,6 +3320,9 @@
 *
 * Note: if this fails, then the mbufs are freed but
 * not the node reference.
+*
+* So, we now have to free the node reference ourselves here
+* and return OK up to the stack.
 */
next = m->m_nextpkt;
if (ath_tx_start(sc, ni, bf, m)) {
@@ -3336,7 +3339,14 @@
 */
ath_txfrag_cleanup(sc, , ni);
ATH_TXBUF_UNLOCK(sc);
-   retval = ENOBUFS;
+
+   /*
+* XXX: And free the node/return OK; ath_tx_start() may have
+*  modified the buffer.  We currently have no way to
+*  signify that the mbuf was freed but there was an error.
+*/
+   ieee80211_node_free(ni);
+   retval = 0;
goto finish;
}


.. the idea is that we can't return failure once we've called
ath_tx_start(), as the mbuf needs to be consumed. So we return OK and
just count an error.



-adrian
___
freebsd-wireless@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-wireless
To unsubscribe, send any mail to "freebsd-wireless-unsubscr...@freebsd.org"


Re: (untested) ath fix upon error

2015-11-03 Thread Andriy Voskoboinyk
Tue, 03 Nov 2015 17:31:18 +0200 було написано Adrian Chadd  
:



hiya,

what do people think about this to fix ath(4) transmit errors:

adrian@victoria:~/work/freebsd/head-embedded/src % svn diff sys/dev/ath
Index: sys/dev/ath/if_ath.c
===
--- sys/dev/ath/if_ath.c(revision 290048)
+++ sys/dev/ath/if_ath.c(working copy)
@@ -3320,6 +3320,9 @@
 *
 * Note: if this fails, then the mbufs are freed but
 * not the node reference.
+*
+* So, we now have to free the node reference ourselves here
+* and return OK up to the stack.
 */
next = m->m_nextpkt;
if (ath_tx_start(sc, ni, bf, m)) {
@@ -3336,7 +3339,14 @@
 */
ath_txfrag_cleanup(sc, , ni);
ATH_TXBUF_UNLOCK(sc);
-   retval = ENOBUFS;
+
+   /*
+* XXX: And free the node/return OK; ath_tx_start() may  
have

+*  modified the buffer.  We currently have no way to
+*  signify that the mbuf was freed but there was an  
error.

+*/
+   ieee80211_node_free(ni);
+   retval = 0;
goto finish;
}


.. the idea is that we can't return failure once we've called
ath_tx_start(), as the mbuf needs to be consumed. So we return OK and
just count an error.



Yes, I think this (temporary?) workaround should fix the issue.




-adrian

___
freebsd-wireless@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-wireless
To unsubscribe, send any mail to "freebsd-wireless-unsubscr...@freebsd.org"