Re: [PATCH v2] net: moxa: fix TX overrun memory leak

2017-03-28 Thread Jonas Jensen
On 28 March 2017 at 05:50, David Miller wrote: > Doing the wakeup unconditionally is very wasteful, you just need to do it > when enough space has been made available. Thanks, please see v3. Jonas

Re: [PATCH v2] net: moxa: fix TX overrun memory leak

2017-03-27 Thread David Miller
From: Jonas Jensen Date: Mon, 27 Mar 2017 14:31:19 +0200 > @@ -25,6 +25,7 @@ > #include > #include > #include > +#include > > #include "moxart_ether.h" > > @@ -297,6 +298,7 @@ static void moxart_tx_finished(struct net_device *ndev) > tx_tail = TX_NEXT(tx_tail); > }

[PATCH v2] net: moxa: fix TX overrun memory leak

2017-03-27 Thread Jonas Jensen
moxart_mac_start_xmit() doesn't care where tx_tail is, tx_head can catch and pass tx_tail, which is bad because moxart_tx_finished() isn't guaranteed to catch up on freeing resources from tx_tail. Add a check in moxart_mac_start_xmit() stopping the queue at the end of the circular buffer. Wake it