From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: xen-devel@lists.xen.org, netdev@vger.kernel.org,
Ian Campbell <ian.campbell@citrix.com>,
David Vrabel <david.vrabel@citrix.com>
Subject: Re: [PATCH net] xen-netback: bookkeep number of queues in our own module
Date: Wed, 18 Jun 2014 10:30:37 -0400 [thread overview]
Message-ID: <53A1A28D.6060203@oracle.com> (raw)
In-Reply-To: <20140618142152.GC20819@zion.uk.xensource.com>
On 06/18/2014 10:21 AM, Wei Liu wrote:
> On Wed, Jun 18, 2014 at 10:18:50AM -0400, Boris Ostrovsky wrote:
>> On 06/18/2014 10:09 AM, Wei Liu wrote:
>>> The original code uses netdev->real_num_tx_queues to bookkeep number of
>>> queues and invokes netif_set_real_num_tx_queues to set the number of
>>> queues. However, netif_set_real_num_tx_queues doesn't allow
>>> real_num_tx_queues to be smaller than 1, which means setting the number
>>> to 0 will not work and real_num_tx_queues is untouched.
>>>
>>> This is bogus when xenvif_free is invoked before any number of queues is
>>> allocated. That function needs to iterate through all queues to free
>>> resources. Using the wrong number of queues results in NULL pointer
>>> dereference.
>>>
>>> So we bookkeep the number of queues in xen-netback to solve this
>>> problem. The usage of real_num_tx_queues in core driver is to cap queue
>>> index to a valid value. In start_xmit we've already guarded against out
>>> of range queue index so we should be fine.
>>>
>>> This fixes a regression introduced by multiqueue patchset in 3.16-rc1.
>>
>> David sent a couple of patches earlier today that I have been testing and
>> they appear to fix both netfront and netback. (I am waiting for 32-bit to
>> finish)
>>
>> http://lists.xenproject.org/archives/html/xen-devel/2014-06/msg02308.html
>>
> I saw that, but they don't fix this backend bug. Try crashing the guest
> before it connects to backend. As I said in commit message:
Apparently it doesn't indeed since 32-bit just crashed on me in
xenvif_free() (the moment I hit Send on my response to you). But 64-bit
run completed without failures. And even 32-bit test ran fine for a while.
-boris
>
>>> This is bogus when xenvif_free is invoked before any number of queues is
>>> allocated. That function needs to iterate through all queues to free
> netif_set_real_num_tx_queues will need to be removed anyway.
>
> Wei.
next prev parent reply other threads:[~2014-06-18 14:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-18 14:09 [PATCH net] xen-netback: bookkeep number of queues in our own module Wei Liu
2014-06-18 14:18 ` Boris Ostrovsky
2014-06-18 14:21 ` Wei Liu
2014-06-18 14:30 ` Boris Ostrovsky [this message]
2014-06-18 14:34 ` [Xen-devel] " Sander Eikelenboom
2014-06-18 14:49 ` Wei Liu
2014-06-22 7:13 ` David Miller
2014-06-22 11:16 ` Wei Liu
2014-06-23 7:59 ` Paul Durrant
2014-06-23 8:48 ` Wei Liu
2014-06-23 9:18 ` Paul Durrant
2014-06-23 9:25 ` David Miller
2014-06-23 9:30 ` Paul Durrant
2014-06-23 9:08 ` David Miller
2014-06-23 9:20 ` Paul Durrant
2014-06-23 10:14 ` [Xen-devel] " David Vrabel
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=53A1A28D.6060203@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=david.vrabel@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=netdev@vger.kernel.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/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).