NIC Ring Buffer Dynamic Mode Switching for CPU Livelock

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current network interface card (NIC) systems experience performance degradation due to continuous interrupts from high-speed network traffic, leading to CPU livelock and delays in packet transmission, as the CPU's processing power cannot keep pace with the rapid arrival of packets, resulting in inefficient handling of network traffic.

Innovation Solution

Implementing a network interface card that can operate in multiple modes for each ring buffer, allowing the operating system kernel to dynamically switch between polling and interrupt modes based on traffic conditions, enabling optimized performance by controlling interrupt processing and packet handling.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of time

If the NIC operates in interrupt mode for each packet received, then packet processing responsiveness is improved, but CPU processing capability deteriorates due to continuous interrupts causing livelock

Engineering Contradiction:
Improvepacket processing delayVSAvoidCPU processing capability
Core Design Contradiction:
Loss of timeVSProductivity

Solution Approach 1:

The system dynamically switches between interrupt mode and polling mode based on traffic conditions. When network traffic is light, interrupt mode provides immediate responsiveness. When traffic becomes heavy and CPU utilization exceeds a threshold, the system transitions to polling mode to prevent livelock, and switches back when utilization decreases. This dynamic adaptation resolves the contradiction between responsiveness and CPU capability.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The invention changes the operational parameter of the NIC from a fixed interrupt mode to a variable mode that can switch between interrupt-driven and polling-based operation. This parameter change allows the system to adjust its interrupt handling behavior based on current load conditions, preventing CPU overload while maintaining packet processing effectiveness.

Inventive Principle:
Principle #35Parameter changes

2Reliability

If the server responds immediately to each interrupt, then packet reception handling is improved, but packet transmission priority deteriorates causing client-perceived delays

Engineering Contradiction:
Improvepacket reception handlingVSAvoidpacket transmission speed
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The system dynamically adjusts its interrupt response behavior based on current operational state. When transmission queues are backed up or CPU utilization is high, the system reduces interrupt responsiveness and transitions to polling mode, allowing transmission tasks to proceed without being constantly preempted by reception interrupts. This resolves the contradiction by making the response behavior adaptive rather than fixed.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The system monitors CPU utilization and queue depth as feedback metrics to determine when to switch between interrupt and polling modes. This feedback mechanism allows the system to automatically adjust its packet handling strategy based on real-time system state, ensuring that transmission priorities are maintained when reception traffic becomes excessive.

Inventive Principle:
Principle #23Feedback

3Reliability

If the CPU processes all interrupts continuously, then packet processing completeness is improved, but system stability deteriorates due to livelock freezing the CPU

Engineering Contradiction:
Improvepacket processing completenessVSAvoidCPU system stability
Core Design Contradiction:
ReliabilityVSStability of the object's composition

Solution Approach 1:

The system dynamically switches between interrupt mode and polling mode based on CPU utilization thresholds. When utilization exceeds a predefined threshold, the system transitions to polling mode to prevent livelock, ensuring system stability. When utilization drops below the threshold, it returns to interrupt mode to maintain packet processing completeness. This dynamic switching resolves the contradiction between processing completeness and system stability.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The system proactively switches to polling mode before CPU overload occurs by monitoring utilization thresholds. This beforehand cushioning prevents the livelock condition from developing by reducing interrupt frequency in advance, maintaining system stability while still ensuring packet processing through periodic polling checks.

Inventive Principle:
Principle #11Beforehand cushioning (Prior cushioning)

Data Source

PatentUS7937499B1Methods and apparatus for dynamically switching between polling and interrupt mode for a ring buffer of a network interface card
Publication Date: 2011.05.03 ORACLE AMERICAN INC
  • US7937499B1 patent drawing
  • US7937499B1 patent drawing
  • US7937499B1 patent drawing

AI summary

Methods and apparatus for processing packets in a computer system including an operating system and a network interface card (NIC) are disclosed. The NIC having a plurality of ring buffers is configured to operate in either a polling mode or an interrupt mode for a particular ring buffer. When the NIC is in the polling mode for a ring buffer, the NIC is periodically polled to determine whether one or more packets have been received by the ring buffer. When the NIC is in the interrupt mode, the operating system is capable of receiving an interrupt indicating that the ring buffer of the NIC has received one or more packets. The operating system is capable of instructing the NIC to change its mode from the polling mode to the interrupt mode for a particular ring buffer, and from the interrupt mode to the polling mode for a particular ring buffer.