Support for ibverbs¶
The support for libibverbs is essentially the same as for Python, with the same limitations. The programmatic interface is via
the spead2::recv::udp_ibv_reader
and
spead2::send::udp_ibv_stream
classes:
-
class
spead2::recv
::
udp_ibv_reader
: public spead2::recv::detail::udp_ibv_reader_base<udp_ibv_reader>¶ Synchronous or asynchronous stream reader that reads UDP packets using the Infiniband verbs API.
It currently only supports IPv4, with no fragmentation, IP header options, or VLAN tags.
Public Functions
-
udp_ibv_reader
(stream &owner, const boost::asio::ip::udp::endpoint &endpoint, const boost::asio::ip::address &interface_address, std::size_t max_size = default_max_size, std::size_t buffer_size = default_buffer_size, int comp_vector = 0, int max_poll = default_max_poll)¶ Constructor.
- Parameters
owner
: Owning streamendpoint
: Address and port. Note that is it possible for the address to be unicast and different to the interface_address: the interface may have multiple IP addresses, in which case this filters packets on the interface by IP address. An unspecified address can also be used to skip address filtering.interface_address
: Address of the interface which should join the group and listen for datamax_size
: Maximum packet size that will be acceptedbuffer_size
: Requested memory allocation for work requests. Note that this is used to determine the number of packets to buffer; if the packets are smaller than max_size, then fewer bytes will be buffered.comp_vector
: Completion channel vector (interrupt) for asynchronous operation, or a negative value to poll continuously. Polling should not be used if there are other users of the thread pool. If a non-negative value is provided, it is taken modulo the number of available completion vectors. This allows a number of readers to be assigned sequential completion vectors and have them load-balanced, without concern for the number available.max_poll
: Maximum number of times to poll in a row, without waiting for an interrupt (if comp_vector is non-negative) or letting other code run on the thread (if comp_vector is negative).
- Exceptions
std::invalid_argument
: If endpoint is specified and is not an IPv4 addressstd::invalid_argument
: If interface_address is not an IPv4 address
-
udp_ibv_reader
(stream &owner, const std::vector<boost::asio::ip::udp::endpoint> &endpoints, const boost::asio::ip::address &interface_address, std::size_t max_size = default_max_size, std::size_t buffer_size = default_buffer_size, int comp_vector = 0, int max_poll = default_max_poll)¶ Constructor with multiple endpoints.
- Parameters
owner
: Owning streamendpoints
: Addresses and ports. Note that is it possible for the addresses to be unicast and different to the interface_address: the interface may have multiple IP addresses, in which case this filters packets on the interface by IP address. An unspecified address can also be used to skip address filtering.interface_address
: Address of the interface which should join the group and listen for datamax_size
: Maximum packet size that will be acceptedbuffer_size
: Requested memory allocation for work requests. Note that this is used to determine the number of packets to buffer; if the packets are smaller than max_size, then fewer bytes will be buffered.comp_vector
: Completion channel vector (interrupt) for asynchronous operation, or a negative value to poll continuously. Polling should not be used if there are other users of the thread pool. If a non-negative value is provided, it is taken modulo the number of available completion vectors. This allows a number of readers to be assigned sequential completion vectors and have them load-balanced, without concern for the number available.max_poll
: Maximum number of times to poll in a row, without waiting for an interrupt (if comp_vector is non-negative) or letting other code run on the thread (if comp_vector is negative).
- Exceptions
std::invalid_argument
: If any element of endpoints is specified and is not an IPv4 addressstd::invalid_argument
: If interface_address is not an IPv4 address
-
-
class
spead2::send
::
udp_ibv_stream
: public spead2::send::stream_impl<udp_ibv_stream>¶ Stream using Infiniband versions for acceleration.
Only IPv4 multicast with an explicit source address are supported.
Public Functions
-
udp_ibv_stream
(io_service_ref io_service, const boost::asio::ip::udp::endpoint &endpoint, const stream_config &config, const boost::asio::ip::address &interface_address, std::size_t buffer_size = default_buffer_size, int ttl = 1, int comp_vector = 0, int max_poll = default_max_poll)¶ Constructor.
- Parameters
io_service
: I/O service for sending dataendpoint
: Multicast group and portconfig
: Stream configurationinterface_address
: Address of the outgoing interfacebuffer_size
: Socket buffer size (0 for OS default)ttl
: Maximum number of hopscomp_vector
: Completion channel vector (interrupt) for asynchronous operation, or a negative value to poll continuously. Polling should not be used if there are other users of the thread pool. If a non-negative value is provided, it is taken modulo the number of available completion vectors. This allows a number of readers to be assigned sequential completion vectors and have them load-balanced, without concern for the number available.max_poll
: Maximum number of times to poll in a row, without waiting for an interrupt (if comp_vector is non-negative) or letting other code run on the thread (if comp_vector is negative).
- Exceptions
std::invalid_argument
: if endpoint is not an IPv4 multicast addressstd::invalid_argument
: if interface_address is not an IPv4 address
-