Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-28 Thread Stefano Stabellini
On Fri, 28 Jun 2013, Zhenzhong Duan wrote: > On 2013-06-27 19:52, Stefano Stabellini wrote: > > On Thu, 27 Jun 2013, Zhenzhong Duan wrote: > > > On 2013-06-27 02:08, Stefano Stabellini wrote: > > > > On Wed, 26 Jun 2013, Zhenzhong Duan wrote: > > > > > On 2013-06-26 01:51, Stefano Stabellini

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-28 Thread Stefano Stabellini
On Fri, 28 Jun 2013, Zhenzhong Duan wrote: On 2013-06-27 19:52, Stefano Stabellini wrote: On Thu, 27 Jun 2013, Zhenzhong Duan wrote: On 2013-06-27 02:08, Stefano Stabellini wrote: On Wed, 26 Jun 2013, Zhenzhong Duan wrote: On 2013-06-26 01:51, Stefano Stabellini wrote: On Tue,

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-27 Thread Zhenzhong Duan
On 2013-06-27 19:52, Stefano Stabellini wrote: On Thu, 27 Jun 2013, Zhenzhong Duan wrote: On 2013-06-27 02:08, Stefano Stabellini wrote: On Wed, 26 Jun 2013, Zhenzhong Duan wrote: On 2013-06-26 01:51, Stefano Stabellini wrote: On Tue, 25 Jun 2013, DuanZhenzhong wrote: Stefano Stabellini

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-27 Thread Stefano Stabellini
On Thu, 27 Jun 2013, Zhenzhong Duan wrote: > On 2013-06-27 02:08, Stefano Stabellini wrote: > > On Wed, 26 Jun 2013, Zhenzhong Duan wrote: > > > On 2013-06-26 01:51, Stefano Stabellini wrote: > > > > On Tue, 25 Jun 2013, DuanZhenzhong wrote: > > > > > Stefano Stabellini wrote: > > > > > > Trimming

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-27 Thread Stefano Stabellini
On Thu, 27 Jun 2013, Zhenzhong Duan wrote: On 2013-06-27 02:08, Stefano Stabellini wrote: On Wed, 26 Jun 2013, Zhenzhong Duan wrote: On 2013-06-26 01:51, Stefano Stabellini wrote: On Tue, 25 Jun 2013, DuanZhenzhong wrote: Stefano Stabellini wrote: Trimming some of the people

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-27 Thread Zhenzhong Duan
On 2013-06-27 19:52, Stefano Stabellini wrote: On Thu, 27 Jun 2013, Zhenzhong Duan wrote: On 2013-06-27 02:08, Stefano Stabellini wrote: On Wed, 26 Jun 2013, Zhenzhong Duan wrote: On 2013-06-26 01:51, Stefano Stabellini wrote: On Tue, 25 Jun 2013, DuanZhenzhong wrote: Stefano Stabellini

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-26 Thread Zhenzhong Duan
On 2013-06-27 02:08, Stefano Stabellini wrote: On Wed, 26 Jun 2013, Zhenzhong Duan wrote: On 2013-06-26 01:51, Stefano Stabellini wrote: On Tue, 25 Jun 2013, DuanZhenzhong wrote: Stefano Stabellini wrote: Trimming some of the people in CC On Mon, 24 Jun 2013, Zhenzhong Duan wrote: On

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-26 Thread Stefano Stabellini
On Wed, 26 Jun 2013, Zhenzhong Duan wrote: > On 2013-06-26 01:51, Stefano Stabellini wrote: > > On Tue, 25 Jun 2013, DuanZhenzhong wrote: > > > Stefano Stabellini wrote: > > > > Trimming some of the people in CC > > > > > > > > On Mon, 24 Jun 2013, Zhenzhong Duan wrote: > > > > > > > > > On

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-26 Thread Stefano Stabellini
On Wed, 26 Jun 2013, Zhenzhong Duan wrote: On 2013-06-26 01:51, Stefano Stabellini wrote: On Tue, 25 Jun 2013, DuanZhenzhong wrote: Stefano Stabellini wrote: Trimming some of the people in CC On Mon, 24 Jun 2013, Zhenzhong Duan wrote: On 2013-06-20 22:21, Stefano

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-26 Thread Zhenzhong Duan
On 2013-06-27 02:08, Stefano Stabellini wrote: On Wed, 26 Jun 2013, Zhenzhong Duan wrote: On 2013-06-26 01:51, Stefano Stabellini wrote: On Tue, 25 Jun 2013, DuanZhenzhong wrote: Stefano Stabellini wrote: Trimming some of the people in CC On Mon, 24 Jun 2013, Zhenzhong Duan wrote: On

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-25 Thread Zhenzhong Duan
On 2013-06-26 01:51, Stefano Stabellini wrote: On Tue, 25 Jun 2013, DuanZhenzhong wrote: Stefano Stabellini wrote: Trimming some of the people in CC On Mon, 24 Jun 2013, Zhenzhong Duan wrote: On 2013-06-20 22:21, Stefano Stabellini wrote: On Thu, 20 Jun 2013, Zhenzhong Duan

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-25 Thread Stefano Stabellini
On Tue, 25 Jun 2013, DuanZhenzhong wrote: > Stefano Stabellini wrote: > > Trimming some of the people in CC > > > > On Mon, 24 Jun 2013, Zhenzhong Duan wrote: > > > > > On 2013-06-20 22:21, Stefano Stabellini wrote: > > > > > > > On Thu, 20 Jun 2013, Zhenzhong Duan wrote: > > > > >

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-25 Thread Stefano Stabellini
On Tue, 25 Jun 2013, DuanZhenzhong wrote: Stefano Stabellini wrote: Trimming some of the people in CC On Mon, 24 Jun 2013, Zhenzhong Duan wrote: On 2013-06-20 22:21, Stefano Stabellini wrote: On Thu, 20 Jun 2013, Zhenzhong Duan wrote: On 2013-06-05

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-25 Thread Zhenzhong Duan
On 2013-06-26 01:51, Stefano Stabellini wrote: On Tue, 25 Jun 2013, DuanZhenzhong wrote: Stefano Stabellini wrote: Trimming some of the people in CC On Mon, 24 Jun 2013, Zhenzhong Duan wrote: On 2013-06-20 22:21, Stefano Stabellini wrote: On Thu, 20 Jun 2013, Zhenzhong Duan

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-24 Thread DuanZhenzhong
Stefano Stabellini wrote: Trimming some of the people in CC On Mon, 24 Jun 2013, Zhenzhong Duan wrote: On 2013-06-20 22:21, Stefano Stabellini wrote: On Thu, 20 Jun 2013, Zhenzhong Duan wrote: On 2013-06-05 20:50, Stefano Stabellini wrote: On Wed, 5 Jun 2013,

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-24 Thread Stefano Stabellini
Trimming some of the people in CC On Mon, 24 Jun 2013, Zhenzhong Duan wrote: > On 2013-06-20 22:21, Stefano Stabellini wrote: > > On Thu, 20 Jun 2013, Zhenzhong Duan wrote: > > > On 2013-06-05 20:50, Stefano Stabellini wrote: > > > > On Wed, 5 Jun 2013, Zhenzhong Duan wrote: > > > > > Stefano

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-24 Thread Zhenzhong Duan
On 2013-06-20 22:21, Stefano Stabellini wrote: On Thu, 20 Jun 2013, Zhenzhong Duan wrote: On 2013-06-05 20:50, Stefano Stabellini wrote: On Wed, 5 Jun 2013, Zhenzhong Duan wrote: Stefano Stabellini wrote: On Tue, 21 May 2013, Stefano Stabellini wrote: On Tue, 21 May 2013, Konrad

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-24 Thread Zhenzhong Duan
On 2013-06-20 22:21, Stefano Stabellini wrote: On Thu, 20 Jun 2013, Zhenzhong Duan wrote: On 2013-06-05 20:50, Stefano Stabellini wrote: On Wed, 5 Jun 2013, Zhenzhong Duan wrote: Stefano Stabellini wrote: On Tue, 21 May 2013, Stefano Stabellini wrote: On Tue, 21 May 2013, Konrad

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-24 Thread Stefano Stabellini
Trimming some of the people in CC On Mon, 24 Jun 2013, Zhenzhong Duan wrote: On 2013-06-20 22:21, Stefano Stabellini wrote: On Thu, 20 Jun 2013, Zhenzhong Duan wrote: On 2013-06-05 20:50, Stefano Stabellini wrote: On Wed, 5 Jun 2013, Zhenzhong Duan wrote: Stefano Stabellini wrote:

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-24 Thread DuanZhenzhong
Stefano Stabellini wrote: Trimming some of the people in CC On Mon, 24 Jun 2013, Zhenzhong Duan wrote: On 2013-06-20 22:21, Stefano Stabellini wrote: On Thu, 20 Jun 2013, Zhenzhong Duan wrote: On 2013-06-05 20:50, Stefano Stabellini wrote: On Wed, 5 Jun 2013,

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-20 Thread Stefano Stabellini
On Thu, 20 Jun 2013, Zhenzhong Duan wrote: > On 2013-06-05 20:50, Stefano Stabellini wrote: > > On Wed, 5 Jun 2013, Zhenzhong Duan wrote: > > > Stefano Stabellini wrote: > > > > > > On Tue, 21 May 2013, Stefano Stabellini wrote: > > > > > > On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: >

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-20 Thread Stefano Stabellini
On Thu, 20 Jun 2013, Zhenzhong Duan wrote: On 2013-06-05 20:50, Stefano Stabellini wrote: On Wed, 5 Jun 2013, Zhenzhong Duan wrote: Stefano Stabellini wrote: On Tue, 21 May 2013, Stefano Stabellini wrote: On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: Looking

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-19 Thread Zhenzhong Duan
On 2013-06-05 20:50, Stefano Stabellini wrote: On Wed, 5 Jun 2013, Zhenzhong Duan wrote: Stefano Stabellini wrote: On Tue, 21 May 2013, Stefano Stabellini wrote: On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: Looking at the hypervisor code I couldn't see anything obviously

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-19 Thread Zhenzhong Duan
On 2013-06-05 20:50, Stefano Stabellini wrote: On Wed, 5 Jun 2013, Zhenzhong Duan wrote: Stefano Stabellini wrote: On Tue, 21 May 2013, Stefano Stabellini wrote: On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: Looking at the hypervisor code I couldn't see anything obviously

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-05 Thread Stefano Stabellini
On Wed, 5 Jun 2013, Zhenzhong Duan wrote: > Stefano Stabellini wrote: > > On Tue, 21 May 2013, Stefano Stabellini wrote: > > > On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: > > > Looking at the hypervisor code I couldn't see anything obviously wrong. > > > I think the

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-06-05 Thread Stefano Stabellini
On Wed, 5 Jun 2013, Zhenzhong Duan wrote: Stefano Stabellini wrote: On Tue, 21 May 2013, Stefano Stabellini wrote: On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: Looking at the hypervisor code I couldn't see anything obviously wrong. I think the culprit is

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-30 Thread Konrad Rzeszutek Wilk
On Wed, May 29, 2013 at 06:50:41PM +0100, Stefano Stabellini wrote: > On Tue, 21 May 2013, Stefano Stabellini wrote: > > On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: > > > > Looking at the hypervisor code I couldn't see anything obviously wrong. > > > > > > I think the culprit is

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-30 Thread Konrad Rzeszutek Wilk
On Wed, May 29, 2013 at 06:50:41PM +0100, Stefano Stabellini wrote: On Tue, 21 May 2013, Stefano Stabellini wrote: On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: Looking at the hypervisor code I couldn't see anything obviously wrong. I think the culprit is physdev_unmap_pirq:

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-29 Thread Stefano Stabellini
On Tue, 21 May 2013, Stefano Stabellini wrote: > On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: > > > Looking at the hypervisor code I couldn't see anything obviously wrong. > > > > I think the culprit is "physdev_unmap_pirq": > > > >if ( is_hvm_domain(d) )

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-29 Thread Stefano Stabellini
On Tue, 21 May 2013, Stefano Stabellini wrote: On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: Looking at the hypervisor code I couldn't see anything obviously wrong. I think the culprit is physdev_unmap_pirq: if ( is_hvm_domain(d) )

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-23 Thread Jan Beulich
>>> On 22.05.13 at 18:41, Konrad Rzeszutek Wilk wrote: > On Wed, May 22, 2013 at 04:25:10PM +0100, Jan Beulich wrote: >> Okay, that clarifies it quite a bit. For one, I'll leave any of the >> emuirq stuff to Stefano, who wrote this originally. And then, from >> the beginning of this thread, I'm

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-23 Thread Jan Beulich
On 22.05.13 at 18:41, Konrad Rzeszutek Wilk konrad.w...@oracle.com wrote: On Wed, May 22, 2013 at 04:25:10PM +0100, Jan Beulich wrote: Okay, that clarifies it quite a bit. For one, I'll leave any of the emuirq stuff to Stefano, who wrote this originally. And then, from the beginning of this

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-22 Thread Konrad Rzeszutek Wilk
On Wed, May 22, 2013 at 04:25:10PM +0100, Jan Beulich wrote: > >>> On 22.05.13 at 17:14, Konrad Rzeszutek Wilk > >>> wrote: > > The physdev_unmap_pirq (from PHYSDEVOP_unmap_pirq), only has this > > check: > > if (domain_pirq_to_emuirq(d, pirq) != IRQ_UNBOUND) > > > > and since the

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-22 Thread Jan Beulich
>>> On 22.05.13 at 17:14, Konrad Rzeszutek Wilk wrote: > The physdev_unmap_pirq (from PHYSDEVOP_unmap_pirq), only has this > check: > if (domain_pirq_to_emuirq(d, pirq) != IRQ_UNBOUND) > > and since the arch.hvm.emuirq is IRQ_UNBOUND (-1), it does not > call unmap_domain_pirq_emuirq. It

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-22 Thread Konrad Rzeszutek Wilk
On Wed, May 22, 2013 at 10:37:39AM +0100, Jan Beulich wrote: > >>> On 22.05.13 at 00:41, Konrad Rzeszutek Wilk > >>> wrote: > > On Tue, May 21, 2013 at 10:50:09PM +0100, Stefano Stabellini wrote: > >> We have to be careful about this: the point of PHYSDEVOP_get_free_pirq is > >> that Linux can

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-22 Thread Jan Beulich
>>> On 22.05.13 at 00:41, Konrad Rzeszutek Wilk wrote: > On Tue, May 21, 2013 at 10:50:09PM +0100, Stefano Stabellini wrote: >> We have to be careful about this: the point of PHYSDEVOP_get_free_pirq is >> that Linux can know for sure the pirq that is going to be used to map the >> MSI by QEMU. If

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-22 Thread Jan Beulich
On 22.05.13 at 00:41, Konrad Rzeszutek Wilk konrad.w...@oracle.com wrote: On Tue, May 21, 2013 at 10:50:09PM +0100, Stefano Stabellini wrote: We have to be careful about this: the point of PHYSDEVOP_get_free_pirq is that Linux can know for sure the pirq that is going to be used to map the MSI

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-22 Thread Konrad Rzeszutek Wilk
On Wed, May 22, 2013 at 10:37:39AM +0100, Jan Beulich wrote: On 22.05.13 at 00:41, Konrad Rzeszutek Wilk konrad.w...@oracle.com wrote: On Tue, May 21, 2013 at 10:50:09PM +0100, Stefano Stabellini wrote: We have to be careful about this: the point of PHYSDEVOP_get_free_pirq is that Linux

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-22 Thread Jan Beulich
On 22.05.13 at 17:14, Konrad Rzeszutek Wilk konrad.w...@oracle.com wrote: The physdev_unmap_pirq (from PHYSDEVOP_unmap_pirq), only has this check: if (domain_pirq_to_emuirq(d, pirq) != IRQ_UNBOUND) and since the arch.hvm.emuirq is IRQ_UNBOUND (-1), it does not call

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-22 Thread Konrad Rzeszutek Wilk
On Wed, May 22, 2013 at 04:25:10PM +0100, Jan Beulich wrote: On 22.05.13 at 17:14, Konrad Rzeszutek Wilk konrad.w...@oracle.com wrote: The physdev_unmap_pirq (from PHYSDEVOP_unmap_pirq), only has this check: if (domain_pirq_to_emuirq(d, pirq) != IRQ_UNBOUND) and since the

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-21 Thread Konrad Rzeszutek Wilk
On Tue, May 21, 2013 at 10:50:09PM +0100, Stefano Stabellini wrote: > On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: > > On Tue, May 21, 2013 at 05:51:02PM +0100, Stefano Stabellini wrote: > > > On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: > > > > > Looking at the hypervisor code I

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-21 Thread Stefano Stabellini
On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: > On Tue, May 21, 2013 at 05:51:02PM +0100, Stefano Stabellini wrote: > > On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: > > > > Looking at the hypervisor code I couldn't see anything obviously wrong. > > > > > > I think the culprit is

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-21 Thread Konrad Rzeszutek Wilk
On Tue, May 21, 2013 at 05:51:02PM +0100, Stefano Stabellini wrote: > On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: > > > Looking at the hypervisor code I couldn't see anything obviously wrong. > > > > I think the culprit is "physdev_unmap_pirq": > > > >if ( is_hvm_domain(d) )

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-21 Thread Stefano Stabellini
On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: > > Looking at the hypervisor code I couldn't see anything obviously wrong. > > I think the culprit is "physdev_unmap_pirq": > >if ( is_hvm_domain(d) ) > > {

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-21 Thread Konrad Rzeszutek Wilk
> Looking at the hypervisor code I couldn't see anything obviously wrong. I think the culprit is "physdev_unmap_pirq": if ( is_hvm_domain(d) ) {

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-21 Thread David Vrabel
On 20/05/13 21:38, Konrad Rzeszutek Wilk wrote: >> At this point I think that upstream option is to save the PIRQ value and >> re-use it. >> Will post a patch for it. > > Here is the patch. It works for me when passing in a NIC driver. > >>From 509499568d1cdf1f2a3fb53773c991f4b063eb56 Mon Sep

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-21 Thread David Vrabel
On 20/05/13 21:38, Konrad Rzeszutek Wilk wrote: At this point I think that upstream option is to save the PIRQ value and re-use it. Will post a patch for it. Here is the patch. It works for me when passing in a NIC driver. From 509499568d1cdf1f2a3fb53773c991f4b063eb56 Mon Sep 17 00:00:00

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-21 Thread Konrad Rzeszutek Wilk
Looking at the hypervisor code I couldn't see anything obviously wrong. I think the culprit is physdev_unmap_pirq: if ( is_hvm_domain(d) ) {

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-21 Thread Stefano Stabellini
On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: Looking at the hypervisor code I couldn't see anything obviously wrong. I think the culprit is physdev_unmap_pirq: if ( is_hvm_domain(d) ) {

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-21 Thread Konrad Rzeszutek Wilk
On Tue, May 21, 2013 at 05:51:02PM +0100, Stefano Stabellini wrote: On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: Looking at the hypervisor code I couldn't see anything obviously wrong. I think the culprit is physdev_unmap_pirq: if ( is_hvm_domain(d) )

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-21 Thread Stefano Stabellini
On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: On Tue, May 21, 2013 at 05:51:02PM +0100, Stefano Stabellini wrote: On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: Looking at the hypervisor code I couldn't see anything obviously wrong. I think the culprit is physdev_unmap_pirq:

Re: [Xen-devel] [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-21 Thread Konrad Rzeszutek Wilk
On Tue, May 21, 2013 at 10:50:09PM +0100, Stefano Stabellini wrote: On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: On Tue, May 21, 2013 at 05:51:02PM +0100, Stefano Stabellini wrote: On Tue, 21 May 2013, Konrad Rzeszutek Wilk wrote: Looking at the hypervisor code I couldn't see

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-20 Thread Konrad Rzeszutek Wilk
> At this point I think that upstream option is to save the PIRQ value and > re-use it. > Will post a patch for it. Here is the patch. It works for me when passing in a NIC driver. >From 509499568d1cdf1f2a3fb53773c991f4b063eb56 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Mon, 20

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-20 Thread Konrad Rzeszutek Wilk
> > Hi Stefano, > > > > do you work out a patch for me to test? > > I'll be traveling/busy for a few weeks, maybe it's best if someone else > picks up this work item. This little test-case below should have worked: #include #include #include #include #include #include #include #include

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-20 Thread Konrad Rzeszutek Wilk
On Mon, May 20, 2013 at 11:24:04AM +0100, Stefano Stabellini wrote: > On Fri, 17 May 2013, Zhenzhong Duan wrote: > > On 2013-05-15 17:41, Stefano Stabellini wrote: > > > On Tue, 14 May 2013, Konrad Rzeszutek Wilk wrote: > > > > On Tue, May 14, 2013 at 02:49:50PM +0100, Stefano Stabellini wrote: >

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-20 Thread Stefano Stabellini
On Fri, 17 May 2013, Zhenzhong Duan wrote: > On 2013-05-15 17:41, Stefano Stabellini wrote: > > On Tue, 14 May 2013, Konrad Rzeszutek Wilk wrote: > > > On Tue, May 14, 2013 at 02:49:50PM +0100, Stefano Stabellini wrote: > > > > On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: > > > > > On Mon,

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-20 Thread Stefano Stabellini
On Fri, 17 May 2013, Zhenzhong Duan wrote: On 2013-05-15 17:41, Stefano Stabellini wrote: On Tue, 14 May 2013, Konrad Rzeszutek Wilk wrote: On Tue, May 14, 2013 at 02:49:50PM +0100, Stefano Stabellini wrote: On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: On Mon, May 13, 2013 at

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-20 Thread Konrad Rzeszutek Wilk
On Mon, May 20, 2013 at 11:24:04AM +0100, Stefano Stabellini wrote: On Fri, 17 May 2013, Zhenzhong Duan wrote: On 2013-05-15 17:41, Stefano Stabellini wrote: On Tue, 14 May 2013, Konrad Rzeszutek Wilk wrote: On Tue, May 14, 2013 at 02:49:50PM +0100, Stefano Stabellini wrote: On Mon,

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-20 Thread Konrad Rzeszutek Wilk
Hi Stefano, do you work out a patch for me to test? I'll be traveling/busy for a few weeks, maybe it's best if someone else picks up this work item. This little test-case below should have worked: #include linux/module.h #include linux/kthread.h #include linux/pagemap.h #include

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-20 Thread Konrad Rzeszutek Wilk
At this point I think that upstream option is to save the PIRQ value and re-use it. Will post a patch for it. Here is the patch. It works for me when passing in a NIC driver. From 509499568d1cdf1f2a3fb53773c991f4b063eb56 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-16 Thread Zhenzhong Duan
On 2013-05-15 17:41, Stefano Stabellini wrote: On Tue, 14 May 2013, Konrad Rzeszutek Wilk wrote: On Tue, May 14, 2013 at 02:49:50PM +0100, Stefano Stabellini wrote: On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: On Mon, May 13, 2013 at 06:24:46PM +0100, Stefano Stabellini wrote: On Mon,

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-16 Thread Zhenzhong Duan
On 2013-05-15 17:41, Stefano Stabellini wrote: On Tue, 14 May 2013, Konrad Rzeszutek Wilk wrote: On Tue, May 14, 2013 at 02:49:50PM +0100, Stefano Stabellini wrote: On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: On Mon, May 13, 2013 at 06:24:46PM +0100, Stefano Stabellini wrote: On Mon,

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-15 Thread Zhenzhong Duan
On 2013-05-15 17:41, Stefano Stabellini wrote: On Tue, 14 May 2013, Konrad Rzeszutek Wilk wrote: On Tue, May 14, 2013 at 02:49:50PM +0100, Stefano Stabellini wrote: On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: On Mon, May 13, 2013 at 06:24:46PM +0100, Stefano Stabellini wrote: On Mon,

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-15 Thread Stefano Stabellini
On Tue, 14 May 2013, Konrad Rzeszutek Wilk wrote: > On Tue, May 14, 2013 at 02:49:50PM +0100, Stefano Stabellini wrote: > > On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: > > > On Mon, May 13, 2013 at 06:24:46PM +0100, Stefano Stabellini wrote: > > > > On Mon, 13 May 2013, Konrad Rzeszutek Wilk

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-15 Thread Stefano Stabellini
On Tue, 14 May 2013, Konrad Rzeszutek Wilk wrote: On Tue, May 14, 2013 at 02:49:50PM +0100, Stefano Stabellini wrote: On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: On Mon, May 13, 2013 at 06:24:46PM +0100, Stefano Stabellini wrote: On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote:

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-15 Thread Zhenzhong Duan
On 2013-05-15 17:41, Stefano Stabellini wrote: On Tue, 14 May 2013, Konrad Rzeszutek Wilk wrote: On Tue, May 14, 2013 at 02:49:50PM +0100, Stefano Stabellini wrote: On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: On Mon, May 13, 2013 at 06:24:46PM +0100, Stefano Stabellini wrote: On Mon,

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-14 Thread Konrad Rzeszutek Wilk
On Tue, May 14, 2013 at 02:49:50PM +0100, Stefano Stabellini wrote: > On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: > > On Mon, May 13, 2013 at 06:24:46PM +0100, Stefano Stabellini wrote: > > > On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: > > > > On Mon, May 13, 2013 at 03:50:52PM +0100,

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-14 Thread Stefano Stabellini
On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: > On Mon, May 13, 2013 at 06:24:46PM +0100, Stefano Stabellini wrote: > > On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: > > > On Mon, May 13, 2013 at 03:50:52PM +0100, Stefano Stabellini wrote: > > > > On Mon, 13 May 2013, Konrad Rzeszutek Wilk

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-14 Thread Stefano Stabellini
On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: On Mon, May 13, 2013 at 06:24:46PM +0100, Stefano Stabellini wrote: On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: On Mon, May 13, 2013 at 03:50:52PM +0100, Stefano Stabellini wrote: On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote:

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-14 Thread Konrad Rzeszutek Wilk
On Tue, May 14, 2013 at 02:49:50PM +0100, Stefano Stabellini wrote: On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: On Mon, May 13, 2013 at 06:24:46PM +0100, Stefano Stabellini wrote: On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: On Mon, May 13, 2013 at 03:50:52PM +0100, Stefano

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-13 Thread Konrad Rzeszutek Wilk
On Mon, May 13, 2013 at 06:24:46PM +0100, Stefano Stabellini wrote: > On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: > > On Mon, May 13, 2013 at 03:50:52PM +0100, Stefano Stabellini wrote: > > > On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: > > > > On Mon, May 13, 2013 at 12:06:43PM +0100,

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-13 Thread Stefano Stabellini
On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: > On Mon, May 13, 2013 at 03:50:52PM +0100, Stefano Stabellini wrote: > > On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: > > > On Mon, May 13, 2013 at 12:06:43PM +0100, Stefano Stabellini wrote: > > > > On Fri, 10 May 2013, Konrad Rzeszutek Wilk

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-13 Thread Konrad Rzeszutek Wilk
On Mon, May 13, 2013 at 03:50:52PM +0100, Stefano Stabellini wrote: > On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: > > On Mon, May 13, 2013 at 12:06:43PM +0100, Stefano Stabellini wrote: > > > On Fri, 10 May 2013, Konrad Rzeszutek Wilk wrote: > > > > On Wed, May 08, 2013 at 04:18:24PM +0800,

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-13 Thread Stefano Stabellini
On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: > On Mon, May 13, 2013 at 12:06:43PM +0100, Stefano Stabellini wrote: > > On Fri, 10 May 2013, Konrad Rzeszutek Wilk wrote: > > > On Wed, May 08, 2013 at 04:18:24PM +0800, Zhenzhong Duan wrote: > > > > When driver load and unload in a loop, pirq

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-13 Thread Konrad Rzeszutek Wilk
On Mon, May 13, 2013 at 12:06:43PM +0100, Stefano Stabellini wrote: > On Fri, 10 May 2013, Konrad Rzeszutek Wilk wrote: > > On Wed, May 08, 2013 at 04:18:24PM +0800, Zhenzhong Duan wrote: > > > When driver load and unload in a loop, pirq will exhaust finally. > > > Try to use the same pirq which

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-13 Thread Stefano Stabellini
On Fri, 10 May 2013, Konrad Rzeszutek Wilk wrote: > On Wed, May 08, 2013 at 04:18:24PM +0800, Zhenzhong Duan wrote: > > When driver load and unload in a loop, pirq will exhaust finally. > > Try to use the same pirq which was already mapped and binded at first time > > So what happens if I unload

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-13 Thread Zhenzhong Duan
On 2013-05-11 02:53, Konrad Rzeszutek Wilk wrote: On Wed, May 08, 2013 at 04:18:24PM +0800, Zhenzhong Duan wrote: When driver load and unload in a loop, pirq will exhaust finally. Try to use the same pirq which was already mapped and binded at first time So what happens if I unload and reload

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-13 Thread Zhenzhong Duan
On 2013-05-11 02:53, Konrad Rzeszutek Wilk wrote: On Wed, May 08, 2013 at 04:18:24PM +0800, Zhenzhong Duan wrote: When driver load and unload in a loop, pirq will exhaust finally. Try to use the same pirq which was already mapped and binded at first time So what happens if I unload and reload

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-13 Thread Stefano Stabellini
On Fri, 10 May 2013, Konrad Rzeszutek Wilk wrote: On Wed, May 08, 2013 at 04:18:24PM +0800, Zhenzhong Duan wrote: When driver load and unload in a loop, pirq will exhaust finally. Try to use the same pirq which was already mapped and binded at first time So what happens if I unload and

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-13 Thread Konrad Rzeszutek Wilk
On Mon, May 13, 2013 at 12:06:43PM +0100, Stefano Stabellini wrote: On Fri, 10 May 2013, Konrad Rzeszutek Wilk wrote: On Wed, May 08, 2013 at 04:18:24PM +0800, Zhenzhong Duan wrote: When driver load and unload in a loop, pirq will exhaust finally. Try to use the same pirq which was

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-13 Thread Stefano Stabellini
On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: On Mon, May 13, 2013 at 12:06:43PM +0100, Stefano Stabellini wrote: On Fri, 10 May 2013, Konrad Rzeszutek Wilk wrote: On Wed, May 08, 2013 at 04:18:24PM +0800, Zhenzhong Duan wrote: When driver load and unload in a loop, pirq will exhaust

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-13 Thread Konrad Rzeszutek Wilk
On Mon, May 13, 2013 at 03:50:52PM +0100, Stefano Stabellini wrote: On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: On Mon, May 13, 2013 at 12:06:43PM +0100, Stefano Stabellini wrote: On Fri, 10 May 2013, Konrad Rzeszutek Wilk wrote: On Wed, May 08, 2013 at 04:18:24PM +0800, Zhenzhong

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-13 Thread Stefano Stabellini
On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: On Mon, May 13, 2013 at 03:50:52PM +0100, Stefano Stabellini wrote: On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: On Mon, May 13, 2013 at 12:06:43PM +0100, Stefano Stabellini wrote: On Fri, 10 May 2013, Konrad Rzeszutek Wilk wrote:

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-13 Thread Konrad Rzeszutek Wilk
On Mon, May 13, 2013 at 06:24:46PM +0100, Stefano Stabellini wrote: On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: On Mon, May 13, 2013 at 03:50:52PM +0100, Stefano Stabellini wrote: On Mon, 13 May 2013, Konrad Rzeszutek Wilk wrote: On Mon, May 13, 2013 at 12:06:43PM +0100, Stefano

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-10 Thread Konrad Rzeszutek Wilk
On Wed, May 08, 2013 at 04:18:24PM +0800, Zhenzhong Duan wrote: > When driver load and unload in a loop, pirq will exhaust finally. > Try to use the same pirq which was already mapped and binded at first time So what happens if I unload and reload two drivers in random order? > when driver

Re: [PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-10 Thread Konrad Rzeszutek Wilk
On Wed, May 08, 2013 at 04:18:24PM +0800, Zhenzhong Duan wrote: When driver load and unload in a loop, pirq will exhaust finally. Try to use the same pirq which was already mapped and binded at first time So what happens if I unload and reload two drivers in random order? when driver loaded.

[PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-08 Thread Zhenzhong Duan
When driver load and unload in a loop, pirq will exhaust finally. Try to use the same pirq which was already mapped and binded at first time when driver loaded. Read pirq from msix entry and test if data is XEN_PIRQ_MSI_DATA xen_irq_from_pirq(pirq) < 0 checking is wrong as irq will be freed when

[PATCH] xen: reuse the same pirq allocated when driver load first time

2013-05-08 Thread Zhenzhong Duan
When driver load and unload in a loop, pirq will exhaust finally. Try to use the same pirq which was already mapped and binded at first time when driver loaded. Read pirq from msix entry and test if data is XEN_PIRQ_MSI_DATA xen_irq_from_pirq(pirq) 0 checking is wrong as irq will be freed when