High-performance zero-copy networking interface.
More...
High-performance zero-copy networking interface.
The XLIO Ultra API is a performance-oriented, event-based networking interface designed for applications requiring maximum throughput and minimal latency. It provides zero-copy capabilities and efficient memory management for high-performance networking.
Key Features
- Native zero-copy TX and RX operations
- Immediate callback-based event notification without accumulation
- Optimized data path with fewer corner cases and non-performance-oriented features
- No blocking mode
- No partial writes
- Simplified application development:
- Fewer error conditions and corner cases to handle
- Flexible control of TX data aggregation
- High-level TX operation completion
- Concurrency and scalability:
- No global namespace - sockets grouped by polling groups
- Clear concurrency boundaries and scalability model
- Each group can be handled independently by different threads
Architecture Overview
The API is built around three main concepts:
- Polling Groups: Event management and callback registration
- Sockets: TCP socket abstraction with zero-copy capabilities
- Buffers: Memory management for zero-copy operations
Typical Workflow
- Initialize XLIO with xlio_init_ex()
- Create polling group with xlio_poll_group_create()
- Create socket with xlio_socket_create()
- Configure socket (bind, connect, listen)
- Poll for events with xlio_poll_group_poll()
- Handle events via registered callbacks
- Send/receive data using zero-copy operations
- Clean up resources
Concurrency and Thread Safety
The XLIO Ultra API is designed for high-performance applications with specific concurrency patterns and thread safety requirements.
Thread Safety Model
- The API is NOT thread-safe by default
- Applications are responsible for proper serialization when accessing XLIO objects from multiple threads
- No internal locking is provided to maximize performance
Polling Group Concurrency
Polling groups are the primary mechanism for achieving concurrency:
- Multiple polling groups can be polled concurrently from different threads
- Polling groups do not share resources with each other
- Sockets from different groups can be handled concurrently without serialization
Serialization Requirements
- Within a polling group: All operations require serialization
- Only one thread should call xlio_poll_group_poll() per group at a time
- Socket operations within the same group must be serialized
- Serialized polling group and socket calls can be executed by different threads
- Across polling groups: No serialization required
- Different threads can operate on different groups simultaneously
Thread Safety Exceptions
Some operations have specific thread safety characteristics:
- Initialization: xlio_init_ex() and xlio_exit() are not thread-safe
- A group created with the flag XLIO_GROUP_FLAG_SAFE can execute a polling and socket TX operations concurrently
Current Limitations
- TCP sockets only (no UDP support)
- No crypto offload support
- No bonding support
- Only busy polling is supported
- fork() is supported only without created polling groups