E1000 nic interrupt problem

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Kamal123
Member
Member
Posts: 99
Joined: Fri Nov 01, 2019 1:17 am

E1000 nic interrupt problem

Post by Kamal123 »

Hi, I am currently writing driver for e1000 nic. I can transmit packets. But the problem is, when I transmit packet it should fire an interrupt. I m using VBox for emulation, and I use pci express. No interruptLine is supported on pci express. So I search for msi, msi-x for e1000, no msi,msi-x. How can I setup interrupt for e1000? Since I need interrupt working for receiving packet.
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Re: E1000 nic interrupt problem

Post by nexos »

Since you talked about MSI, I suspect you are using the APIC. For this reason, its not easy.

To work on all machines, you must obtain the _PRT objects in ACPI. This requires an AML interpreter, which isn't a task for the faint of heart. If you feel up to the challenge, read through the ACPI spec to do it.
If you want ACPI, but don't want to write it, you Intel's ACPICA. Its well documented on the wiki.
Or, you could read the MP tables. That probably won't work on newer machines, as ACPI prevailed over MP / PnP / APM at the end of the 90's. But it will work on QEMU and Bochs.
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: E1000 nic interrupt problem

Post by Octocontrabass »

Kamal123 wrote:No interruptLine is supported on pci express.
Yes it is.
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Re: E1000 nic interrupt problem

Post by nexos »

Octocontrabass wrote:Yes it is.
The OP made it sound like their using APIC, if I'm not mistaken.
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
Ethin
Member
Member
Posts: 625
Joined: Sun Jun 23, 2019 5:36 pm
Location: North Dakota, United States

Re: E1000 nic interrupt problem

Post by Ethin »

At least Interrupt line, MSI or MSI-X must be supported for all devices (I believe this is mandated by both the PCI local bus spec and PCIe). You cannot (and should not) have a device that does not support at least one of these mechanisms. Are you sure your reading the PCIe configuration space correctly?
Kamal123
Member
Member
Posts: 99
Joined: Fri Nov 01, 2019 1:17 am

Re: E1000 nic interrupt problem

Post by Kamal123 »

I am using APIC and I am sure that my pcie config registers are correct. I need to go through acpica. But how to enable the msi or interrupt for any device through aml? Please provide the steps.
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Re: E1000 nic interrupt problem

Post by nexos »

You don't need ACPI for MSI. You only need ACPI for
non MSI devices with APIC. Simply follow the steps on the wiki PCI page for MSI.
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
Kamal123
Member
Member
Posts: 99
Joined: Fri Nov 01, 2019 1:17 am

Re: E1000 nic interrupt problem

Post by Kamal123 »

nexos wrote:You don't need ACPI for MSI. You only need ACPI for
non MSI devices with APIC. Simply follow the steps on the wiki PCI page for MSI.
Hi, thanks for reply. I have msi part working. But for non msi device, I need to handle interrupt.
Post Reply