The default implementation of the Feed Engine is based on the standard socket API. Network card manufacturers offer ultra-low latency alternatives to this API. For example, Solarflare offers the ef_vi
API to send and receive multicast packets bypassing the kernel and avoiding copying data from internal buffers to user space.
The SDK includes the implementation of the Feed Engine abstraction based on the Solarflare ef_vi
API. The functionality is encapsulated into the OnixS::CME::MDH::SolarflareFeedEngine class. The design of this class is similar to the OnixS::CME::MDH::SocketFeedEngine class. The only difference is Solarflare-specific parameters.
ef_vi
API is available only for Solarflare network cards on Linux. To simplify the development process, the SDK exposes the OnixS::CME::MDH::SolarflareFeedEngine and related classes for all platforms. However, the instance creation will fail at runtime on platforms where the corresponding functionality is not supported.The Solarflare ef_vi
API uses the concept of virtual interfaces to receive network data. The corresponding configuration parameters are available via the OnixS::CME::MDH::SolarflareFeedEngineSettings class:
ef_vi
services on non-Solarflare network interfaces is not supported by the manufacturer and thus leads to a failure. In contrast, the mixed mode combines ef_vi
with the standard socket API, thus making possible multicast packets receiving on both Solarflare and non-Solarflare network interfaces. The mixed mode gives more flexibility for the users whose operating environments are configured in a particular way (for example, when Incremental data is available on a Solarflare network adapter and recovery data comes via a non-Solaflare network interface).The mixed mode for the Solarflare Feed Engine combines the ef_vi
SDK with standard network sockets. This mode allows taking advantage of using the ultra-low latency ef_vi
API on Solarflare network adapters while receiving some data from non-Solarflare network interfaces using the socket API.
The following code shows how to configure data receiving when Incremental data comes via the Solarflare network adapter (eth0
) and recovery data is available on a non-Solarflare network interface (eth2
).
Configuring consists of two steps.
The first step is to tell Solarlfare Feed Engine to work in the mixed mode:
The second step is to bind Handler's feeds to proper network interfaces: