[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170327.205026.1935467634311224337.davem@davemloft.net>
Date: Mon, 27 Mar 2017 20:50:26 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: jonas.jensen@...il.com
Cc: netdev@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] net: moxa: fix TX overrun memory leak
From: Jonas Jensen <jonas.jensen@...il.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.
Powered by blists - more mailing lists