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

Synchronous or asynchronous stream reader that reads UDP packets using the Infiniband verbs API.

It currently only supports multicast IPv4, with no fragmentation, IP header options, or VLAN tags.

Inherits from spead2::recv::udp_reader_base

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 stream
  • endpoint: Multicast group and port
  • max_size: Maximum packet size that will be accepted
  • buffer_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.
  • interface_address: Address of the interface which should join the group and listen for data
  • 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 not an IPv4 multicast address
  • std::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 stream
  • endpoints: Multicast groups and ports
  • max_size: Maximum packet size that will be accepted
  • buffer_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.
  • interface_address: Address of the interface which should join the group and listen for data
  • 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 not an IPv4 multicast address
  • std::invalid_argument: If interface_address is not an IPv4 address

class spead2::send::udp_ibv_stream

Stream using Infiniband versions for acceleration.

Only IPv4 multicast with an explicit source address are supported.

Inherits from spead2::send::stream_impl< udp_ibv_stream >

Public Functions

udp_ibv_stream(boost::asio::io_service &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 data
  • endpoint: Multicast group and port
  • config: Stream configuration
  • interface_address: Address of the outgoing interface
  • buffer_size: Socket buffer size (0 for OS default)
  • ttl: Maximum number of hops
  • 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 not an IPv4 multicast address
  • std::invalid_argument: if interface_address is not an IPv4 address