This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
networking:napi [2016/10/06 06:50] shirai fix in mentioned function name |
networking:napi [2022/10/16 16:55] joser93 Missed the issues header. now fixed. |
||
---|---|---|---|
Line 11: | Line 11: | ||
=====Contents===== | =====Contents===== | ||
- | * [[https://www.linuxfoundation.org/#NAPI_Driver_design|1 NAPI Driver design]] | + | * [[#NAPI_Driver_design|1 NAPI Driver design]] |
- | * [[https://www.linuxfoundation.org/#Hardware_Architecture|1.1 Hardware Architecture]] | + | * [[#Hardware_Architecture|1.1 Hardware Architecture]] |
- | * [[https://www.linuxfoundation.org/#Locking_rules_and_environmental_guarantees|1.2 Locking rules and environmental guarantees]] | + | * [[#Locking_rules_and_environmental_guarantees|1.2 Locking rules and environmental guarantees]] |
- | * [[https://www.linuxfoundation.org/#NAPI_API|2 NAPI API]] | + | * [[#NAPI_API|2 NAPI API]] |
- | * [[https://www.linuxfoundation.org/#Advantages|3 Advantages]] | + | * [[#Advantages|3 Advantages]] |
- | * [[https://www.linuxfoundation.org/#Performance_under_high_packet_load|3.1 Performance under high packet load]] | + | * [[#Performance_under_high_packet_load|3.1 Performance under high packet load]] |
- | * [[https://www.linuxfoundation.org/#Use_of_softirq_for_other_optimizations|3.2 Use of softirq for other optimizations]] | + | * [[#Use_of_softirq_for_other_optimizations|3.2 Use of softirq for other optimizations]] |
- | * [[https://www.linuxfoundation.org/#Hardware_Flow_control|3.3 Hardware Flow control]] | + | * [[#Hardware_Flow_control|3.3 Hardware Flow control]] |
- | * [[https://www.linuxfoundation.org/#Disadvantages|4 Disadvantages]] | + | * [[#Disadvantages|4 Disadvantages]] |
- | * [[https://www.linuxfoundation.org/#Latency|4.1 Latency]] | + | * [[#Latency|4.1 Latency]] |
- | * [[https://www.linuxfoundation.org/#IRQ_masking|4.2 IRQ masking]] | + | * [[#IRQ_masking|4.2 IRQ masking]] |
- | * [[https://www.linuxfoundation.org/#Issues|5 Issues]] | + | * [[#Issues|5 Issues]] |
- | * [[https://www.linuxfoundation.org/#IRQ_race_a.k.a_rotting_packet|5.1 IRQ race a.k.a rotting packet]] | + | * [[#IRQ_race_a.k.a_rotting_packet|5.1 IRQ race a.k.a rotting packet]] |
- | * [[https://www.linuxfoundation.org/#IRQ_mask_and_level-triggered|5.1.1 IRQ mask and level-triggered]] | + | * [[#IRQ_mask_and_level-triggered|5.1.1 IRQ mask and level-triggered]] |
- | * [[https://www.linuxfoundation.org/#non-level_sensitive_IRQs|5.1.2 non-level sensitive IRQs]] | + | * [[#non-level_sensitive_IRQs|5.1.2 non-level sensitive IRQs]] |
- | * [[https://www.linuxfoundation.org/#Scheduling_issues|5.2 Scheduling issues]] | + | * [[#Scheduling_issues|5.2 Scheduling issues]] |
- | * [[https://www.linuxfoundation.org/#External_Links|6 External Links]] | + | * [[#External_Links|6 External Links]] |
=====NAPI Driver design===== | =====NAPI Driver design===== | ||
Line 95: | Line 95: | ||
* Only one CPU at any time can call napi->poll(); for each ''napi_struct'' this is because only one CPU can pick the initial interrupt and hence the initial //napi_schedule(napi)// | * Only one CPU at any time can call napi->poll(); for each ''napi_struct'' this is because only one CPU can pick the initial interrupt and hence the initial //napi_schedule(napi)// | ||
- | * The core layer invokes devices to send packets in a round robin format. This implies receive is totaly lockless because of the guarantee only that one CPU is executing it. | + | * The core layer invokes devices to send packets in a round robin format. This implies receive is totaly lockless because of the guarantee that only one CPU is executing it. |
* Contention can only be the result of some other CPU accessing the rx ring. This happens only in close() and suspend() (when these methods try to clean the rx ring); Driver authors need not worry about this; synchronization is taken care for them by the top net layer. | * Contention can only be the result of some other CPU accessing the rx ring. This happens only in close() and suspend() (when these methods try to clean the rx ring); Driver authors need not worry about this; synchronization is taken care for them by the top net layer. | ||