Skip to content

Commit aabba21

Browse files
author
Elena Crenguta Lindqvist
committed
bla
1 parent 840b76d commit aabba21

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

itnot/index.html

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -328,25 +328,22 @@
328328
<p>Kernel Space vs User Space</p>
329329

330330
<aside class="notes">
331-
332-
331+
333332
If you care about latency and packet processing performance there are a few options.
334-
333+
<br><br>
335334
We basically need to overcome the limitations in the Linux kernel which is not ideal for *lots* of packet-processing.
336-
335+
<br><br>
337336
Why is the Linux kernel a problem when we talk about latency and performance ( with performance, I mean higher throughput at a lower CPU cost)?
338-
Well, the Linux kernel is monolithic, it's millions of lines of code.
339-
It contains lots of things like drivers (which makes the Linux kernel work with any hw, not just your specific hw/smartNIC), it allows running many applications at the same time by using a time sharing layer. Resources like CPU, mem exposed by the kernel are shared between all the processes running.
337+
<br>Well, the Linux kernel is monolithic, it's millions of lines of code.
338+
<br>It contains lots of things like drivers (which makes the Linux kernel work with any hw, not just your specific hw/smartNIC), it allows running many applications at the same time by using a time sharing layer. Resources like CPU, mem exposed by the kernel are shared between all the processes running.
339+
<br><br>The networking stack inside the Linux kernel limits how many packets per second it can process, it was conceived to be slow, a decision taken 20 25 years ago, that packets should be delivered into sockets. If you want to be fast you dont do this upfront.
340+
<br><br>Too many packets per second means CPUs get busy just receiving packets, then either the packets are dropped or we CPU starve the applications.
340341

341-
The networking stack inside the Linux kernel limits how many packets per second it can process, it was conceived to be slow, a decision taken 20 25 years ago, that packets should be delivered into sockets. If you want to be fast you dont do this upfront.
342-
Too many packets per second means CPUs get busy just receiving packets, then either the packets are dropped or we CPU starve the applications.
343-
344-
345-
346-
<!–– TAKE IT OUT this paragraph or rephrase it ––>
347-
How your operating system deals with data
348-
Data destined to a particular system is first received by the NIC and is stored in the ring buffer of the reception (RX) present in the NIC, which also has TX (for data transmission). Once the packet is accessible to the kernel, the device driver raises softirq (software interrupt), which makes the DMA (data memory access) of the system send that packet to the Linux kernel. The packet data in the Linux kernel gets stored in the sk_buff data structure to hold the packet up to MTU (maximum transfer unit). When all the packets are filled in the kernel buffer, they get sent to the upper processing layer – IP, TCP or UDP. The data then gets copied to the preferred data receiving process.
349-
Note: Initially, a hard interrupt is raised by the device driver to send data to the kernel, but since this is an expensive task, it is replaced by a software interrupt. This is handled by the NAPI (new API), which makes the processing of incoming packets more efficient by putting the device driver in polling mode.
342+
<br><br>
343+
When a packet comes in, it is stored in the RX ring buffer. The device driver sends a software interrrupt to the kernel. The packet gets stored in sk_buff to be hold up to MTU.
344+
<br> When all packets are received, they get sent to higher in the kernel stack. Then they get copied to the receiving process.
345+
<br><br>
346+
Note: Initially, a hard interrupt is used followed by sw interrupts.
350347
</aside>
351348
</section>
352349

0 commit comments

Comments
 (0)