From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Stefan Roese <sr@denx.de>
Cc: linuxppc-dev@ozlabs.org, Sathya Narayanan <sathyan@teamf1.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH] ibm_newemac: Fixes memory leak in ibm_newemac ethernet driver
Date: Tue, 24 Jun 2008 09:21:50 +1000 [thread overview]
Message-ID: <1214263310.8011.280.camel@pasglop> (raw)
In-Reply-To: <1214225712-25882-1-git-send-email-sr@denx.de>
On Mon, 2008-06-23 at 14:55 +0200, Stefan Roese wrote:
> From: Sathya Narayanan <sathyan@teamf1.com>
>
> This patch addresses the memory leak happenning in drivers transmit queue
> under heavy load condition. Once the transmit queue becomes full, driver
> does an automatic wrapup of queue. During which the untransmitted SKB's are
> lost without getting freed up.
This would be a bug. We should stop the queue when full instead.
> Signed-off-by: Sathya Narayanan <sathyan@teamf1.com>
> Signed-off-by: Stefan Roese <sr@denx.de>
> ---
> drivers/net/ibm_newemac/core.c | 7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c
> index aa407b2..ee868b6 100644
> --- a/drivers/net/ibm_newemac/core.c
> +++ b/drivers/net/ibm_newemac/core.c
> @@ -1328,6 +1328,13 @@ static int emac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
>
> DBG2(dev, "xmit(%u) %d" NL, len, slot);
>
> + if (dev->tx_skb[slot] && dev->tx_desc[slot].data_ptr) {
> + dev_kfree_skb(dev->tx_skb[slot]);
> + dev->tx_skb[slot] = NULL;
> + dev->tx_cnt--;
> + ++dev->estats.tx_dropped;
> + }
> +
> dev->tx_skb[slot] = skb;
> dev->tx_desc[slot].data_ptr = dma_map_single(&dev->ofdev->dev,
> skb->data, len,
WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Stefan Roese <sr@denx.de>
Cc: linuxppc-dev@ozlabs.org, netdev@vger.kernel.org,
Sathya Narayanan <sathyan@teamf1.com>
Subject: Re: [PATCH] ibm_newemac: Fixes memory leak in ibm_newemac ethernet driver
Date: Tue, 24 Jun 2008 09:21:50 +1000 [thread overview]
Message-ID: <1214263310.8011.280.camel@pasglop> (raw)
In-Reply-To: <1214225712-25882-1-git-send-email-sr@denx.de>
On Mon, 2008-06-23 at 14:55 +0200, Stefan Roese wrote:
> From: Sathya Narayanan <sathyan@teamf1.com>
>
> This patch addresses the memory leak happenning in drivers transmit queue
> under heavy load condition. Once the transmit queue becomes full, driver
> does an automatic wrapup of queue. During which the untransmitted SKB's are
> lost without getting freed up.
This would be a bug. We should stop the queue when full instead.
> Signed-off-by: Sathya Narayanan <sathyan@teamf1.com>
> Signed-off-by: Stefan Roese <sr@denx.de>
> ---
> drivers/net/ibm_newemac/core.c | 7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c
> index aa407b2..ee868b6 100644
> --- a/drivers/net/ibm_newemac/core.c
> +++ b/drivers/net/ibm_newemac/core.c
> @@ -1328,6 +1328,13 @@ static int emac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
>
> DBG2(dev, "xmit(%u) %d" NL, len, slot);
>
> + if (dev->tx_skb[slot] && dev->tx_desc[slot].data_ptr) {
> + dev_kfree_skb(dev->tx_skb[slot]);
> + dev->tx_skb[slot] = NULL;
> + dev->tx_cnt--;
> + ++dev->estats.tx_dropped;
> + }
> +
> dev->tx_skb[slot] = skb;
> dev->tx_desc[slot].data_ptr = dma_map_single(&dev->ofdev->dev,
> skb->data, len,
next prev parent reply other threads:[~2008-06-23 23:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-23 12:55 [PATCH] ibm_newemac: Fixes memory leak in ibm_newemac ethernet driver Stefan Roese
2008-06-23 12:55 ` Stefan Roese
2008-06-23 23:21 ` Benjamin Herrenschmidt [this message]
2008-06-23 23:21 ` Benjamin Herrenschmidt
2008-07-02 4:45 ` SathyaNarayanan
2008-07-02 4:45 ` SathyaNarayanan
2008-07-02 5:46 ` Benjamin Herrenschmidt
2008-07-02 5:46 ` Benjamin Herrenschmidt
2008-07-02 6:11 ` SathyaNarayanan
2008-07-02 6:11 ` SathyaNarayanan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1214263310.8011.280.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=sathyan@teamf1.com \
--cc=sr@denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.