All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] IRQ number used by virtio-net-device in vexpress-a15
@ 2016-04-14 12:58 Inti Gonzalez-Herrera
  2016-04-14 13:19 ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Inti Gonzalez-Herrera @ 2016-04-14 12:58 UTC (permalink / raw)
  To: qemu-devel

Hello,

I am writing a simple OS that must access the network. The platform I'm 
using can  be seen below:

qemu-system-arm -redir tcp:5555::80 -m 256M -smp 1 -M vexpress-a15 -cpu 
cortex-a15 -netdev user,id=net0 -device virtio-net-device,netdev=net0 
-kernel ~/work/src/simple-arm-os/bin/kernel.bin -nographic -serial /dev/tty

I have some problems using virtio-net-device. In particular, th system 
is not receiving an interrupt when it transmits a package. However, I 
can see how the buffer descriptors are moved to the used ring. I was 
thinking that maybe the problem is related to the fact that I don't know 
what is the exact IRQ number.

In other words, let's say that I have a function enable_irq(int, 
handler) that enables a given interrupt in the GIC. What is the number n 
that I should used as parameter in this platform?

Right now, I'm using the value (40 + k), where k is the index of the 
specific transporter where the network device is attached (from 0 to 3). 
It is not working.
I get that information from file hw/arm/vexpress.c, functions 
vexpress_common_init  and vexpress_modify_dtb (this one is not executed)

I am using qemu version 2.5.1

Thanks,
Inti

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] IRQ number used by virtio-net-device in vexpress-a15
  2016-04-14 12:58 [Qemu-devel] IRQ number used by virtio-net-device in vexpress-a15 Inti Gonzalez-Herrera
@ 2016-04-14 13:19 ` Peter Maydell
  2016-04-14 13:30   ` Inti Gonzalez-Herrera
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2016-04-14 13:19 UTC (permalink / raw)
  To: Inti Gonzalez-Herrera; +Cc: QEMU Developers

On 14 April 2016 at 13:58, Inti Gonzalez-Herrera <inti.glez@gmail.com> wrote:
> I have some problems using virtio-net-device. In particular, th system is
> not receiving an interrupt when it transmits a package. However, I can see
> how the buffer descriptors are moved to the used ring. I was thinking that
> maybe the problem is related to the fact that I don't know what is the exact
> IRQ number.
>
> In other words, let's say that I have a function enable_irq(int, handler)
> that enables a given interrupt in the GIC. What is the number n that I
> should used as parameter in this platform?
>
> Right now, I'm using the value (40 + k), where k is the index of the
> specific transporter where the network device is attached (from 0 to 3). It
> is not working.
> I get that information from file hw/arm/vexpress.c, functions
> vexpress_common_init  and vexpress_modify_dtb (this one is not executed)

Problems with interrupt numbers are almost always related to confusion
about whether the interrupt number starts with the 0 as the first
external interrupt, or 0 as the first internal interrupt (where 0..31
are SGIs and PPIs, and the first external (SPI) interrupt is 32).
The '40 + k' in the vexpress.c source code is an external interrupt
number (in which numbering scheme the PL011 UARTs are interrupts 5 to 8,
and the sp804 timer is interrupt 48, if that helps you cross-check
against some other devices in your OS which do have working interrupts).

thanks
-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] IRQ number used by virtio-net-device in vexpress-a15
  2016-04-14 13:19 ` Peter Maydell
@ 2016-04-14 13:30   ` Inti Gonzalez-Herrera
  0 siblings, 0 replies; 3+ messages in thread
From: Inti Gonzalez-Herrera @ 2016-04-14 13:30 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers



On 14/04/16 15:19, Peter Maydell wrote:
> On 14 April 2016 at 13:58, Inti Gonzalez-Herrera <inti.glez@gmail.com> wrote:
>> I have some problems using virtio-net-device. In particular, th system is
>> not receiving an interrupt when it transmits a package. However, I can see
>> how the buffer descriptors are moved to the used ring. I was thinking that
>> maybe the problem is related to the fact that I don't know what is the exact
>> IRQ number.
>>
>> In other words, let's say that I have a function enable_irq(int, handler)
>> that enables a given interrupt in the GIC. What is the number n that I
>> should used as parameter in this platform?
>>
>> Right now, I'm using the value (40 + k), where k is the index of the
>> specific transporter where the network device is attached (from 0 to 3). It
>> is not working.
>> I get that information from file hw/arm/vexpress.c, functions
>> vexpress_common_init  and vexpress_modify_dtb (this one is not executed)
> Problems with interrupt numbers are almost always related to confusion
> about whether the interrupt number starts with the 0 as the first
> external interrupt, or 0 as the first internal interrupt (where 0..31
> are SGIs and PPIs, and the first external (SPI) interrupt is 32).
> The '40 + k' in the vexpress.c source code is an external interrupt
> number (in which numbering scheme the PL011 UARTs are interrupts 5 to 8,
> and the sp804 timer is interrupt 48, if that helps you cross-check
> against some other devices in your OS which do have working interrupts).
yeah, that solved the issue.
Thanks a lot
>
> thanks
> -- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-14 13:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-14 12:58 [Qemu-devel] IRQ number used by virtio-net-device in vexpress-a15 Inti Gonzalez-Herrera
2016-04-14 13:19 ` Peter Maydell
2016-04-14 13:30   ` Inti Gonzalez-Herrera

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.