Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1610277 > unrolled thread

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

Started byDavid Miller <davem@davemloft.net>
First post2017-03-28 06:00 +0200
Last post2017-03-28 12:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v2] net: moxa: fix TX overrun memory leak David Miller <davem@davemloft.net> - 2017-03-28 06:00 +0200
    Re: [PATCH v2] net: moxa: fix TX overrun memory leak Jonas Jensen <jonas.jensen@gmail.com> - 2017-03-28 12:20 +0200

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

FromDavid Miller <davem@davemloft.net>
Date2017-03-28 06:00 +0200
SubjectRe: [PATCH v2] net: moxa: fix TX overrun memory leak
Message-ID<tpQsx-1Jz-1@gated-at.bofh.it>
From: Jonas Jensen <jonas.jensen@gmail.com>
Date: Mon, 27 Mar 2017 14:31:19 +0200

> @@ -25,6 +25,7 @@
>  #include <linux/of_irq.h>
>  #include <linux/crc32.h>
>  #include <linux/crc32c.h>
> +#include <linux/circ_buf.h>
>  
>  #include "moxart_ether.h"
>  
> @@ -297,6 +298,7 @@ static void moxart_tx_finished(struct net_device *ndev)
>  		tx_tail = TX_NEXT(tx_tail);
>  	}
>  	priv->tx_tail = tx_tail;
> +	netif_wake_queue(ndev);
>  }
>  
>  static irqreturn_t moxart_mac_interrupt(int irq, void *dev_id)

Doing the wakeup unconditionally is very wasteful, you just need to do it
when enough space has been made available.

Therefore the wakeup should be more like:

	if (netif_queue_stopped(ndev) &&
	    moxart_tx_queue_space(ndev) >= MOXART_TX_WAKEUP_THRESHOLD)
		netif_wake_queue();

Otherwise you're just going to flap back and forth under high load and
get almost not packet batching at all, hurting performance.

[toc] | [next] | [standalone]


#1610530

FromJonas Jensen <jonas.jensen@gmail.com>
Date2017-03-28 12:20 +0200
Message-ID<tpWoi-65Z-9@gated-at.bofh.it>
In reply to#1610277
On 28 March 2017 at 05:50, David Miller <davem@davemloft.net> 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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web