Reputation: 13116
I use TCP/IP over Ethernet 10 Gbit/s on Linux x86_64.
But what happen when interrupt occured in one of CPU-Core?
Is it true, that happens:
Upvotes: 1
Views: 3192
Reputation: 802
I think this it the way of working of DMA (bus mastering) capable network interfaces with NAPI driver:
When packet(s) arrive, Socket Buffers are already allocated and mapped to DMA memory buffer, and DMA is armed.
sk_buff
and initializes new DMA buffers. if all packets (quota) are processed, IRQ is enabled and NAPI is told to stop polling.Upvotes: 2
Reputation: 509
Your question is a mix of hardware, protocol stack and user-space.
code of interrupt calculates checksum of IP-packet
this part is protocols - i think somewhere here net/ipv4/ip_input.c
code of interrupt copies data from kernel-space buffer to the required socket-buffer
mix of proto and user space for example here net/ipv4/tcp_input.c
code of interrupt copies data from the buffer on Ethernet-card to the buffer in kernel-space (or it occurs before an interrupt is generated, by using DMA-controller on Ethernet and is this initiated by Ethernet-card?)
this is hardware for example drivers/net/8139cp.c
Next - i think you are misunderstanding the "interrupt" term - there are hardware interrupts and software interrupts. The only hardware interrupt here are rx/tx interrupts from Ethernet controller.
Not a full answer to your question:
First of all it is possible to divide networking into two parts the actual protocols (net/ipv4 directory) and part which implements various network hardware (drivers/net).
Not all hardware drivers implement interrupt driven technique some drivers for high-bandwidth adapter use poll technique (NAPI interface - which i shortly describe).
I recommend you reading the following article:
Linux Networking Kernel (http://www.ecsl.cs.sunysb.edu/elibrary/linux/network/LinuxKernel.pdf)
Upvotes: 3