lkml.org 
[lkml]   [2017]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2] net: moxa: fix TX overrun memory leak
From
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.


\
 
 \ /
  Last update: 2017-03-28 05:52    [W:0.178 / U:1.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site