netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: tlfalcon@linux.vnet.ibm.com
Cc: netdev@vger.kernel.org, nfont@linux.vnet.ibm.com,
	jallen@linux.vnet.ibm.com
Subject: Re: [PATCH net] ibmvnic: Clean RX pools only during a hard reset
Date: Mon, 19 Feb 2018 11:37:32 -0500 (EST)	[thread overview]
Message-ID: <20180219.113732.1002575230879716489.davem@davemloft.net> (raw)
In-Reply-To: <1518970121-8539-1-git-send-email-tlfalcon@linux.vnet.ibm.com>

From: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Date: Sun, 18 Feb 2018 10:08:40 -0600

> Sorry, this fixes a bug in commit d0869c0071e4. The cause of the
> bug is that "stale" RX buffers containing packet data are returned
> to the driver after device close and open. While most buffers will be
> returned with an error and handled by the polling routine, some buffers
> will be returned as containing valid data. Unfortunately, the socket
> buffers allocated were already freed when the device was closed, so
> attempts to process them result in a panic.
> 
> RX pools still need to be cleaned in some cases, such as during
> a fatal reset. In all other cases, the socket buffers will either
> be freed in the polling routine or processed by the kernel.
> 
> Fixes: d0869c0071e4 ("ibmvnic: Clean RX pool buffers during device close")
> Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>

It really shouldn't matter who, or how many times, clear_rx_pools() is
called.

Anyone who calls it and frees the SKBs will mark the SKB slots as NULL,
so any subsequent call cannot possibly double free the buffers.

At best you need to explain the problem better in the commit message.

  parent reply	other threads:[~2018-02-19 16:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-18 16:08 [PATCH net] ibmvnic: Clean RX pools only during a hard reset Thomas Falcon
2018-02-18 16:08 ` [PATCH net-next] ibmvnic: Keep track of supplementary TX descriptors Thomas Falcon
2018-02-20 18:20   ` David Miller
2018-02-19 16:37 ` David Miller [this message]
2018-02-19 19:24   ` [PATCH net] ibmvnic: Clean RX pools only during a hard reset Thomas Falcon
2018-02-19 19:30     ` David Miller
2018-02-19 20:01       ` Thomas Falcon
2018-02-20  2:12 ` [PATCH net v2] ibmvnic: Check for NULL skb's in NAPI poll routine Thomas Falcon

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=20180219.113732.1002575230879716489.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jallen@linux.vnet.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=nfont@linux.vnet.ibm.com \
    --cc=tlfalcon@linux.vnet.ibm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).