Skip to navigation

hololink::module::RoceDataChannelInterfaceV1

View as Markdown

Configures an HSB unit for RoCE data transport.

This object configures and HSB device with parameters necessary to generate RoCE compatible data packets, including setting QP and RKEY values. These values come from the RoceReceiverInterfaceV1 passed in to attach_receiver.

#include <hololink/module/roce_data_channel.hpp>

Inherits from: hololink::module::ConfigurableService< RoceDataChannelInterfaceV1 > (public)


Methods

attach_receiver

virtual hololink_module_status_t hololink::module::RoceDataChannelInterfaceV1::attach_receiver(
std::shared_ptr<RoceReceiverInterfaceV1> receiver
)

Configure the HSB device with settings necessary for generating RoCE data packets.

Returns: HOLOLINK_MODULE_OK on success, or an error status.

Throws: std::runtime_error if receiver is null.

Parameters

receiver
std::shared_ptr<RoceReceiverInterfaceV1>

Has RoCE configuration parameters.

detach_receiver

virtual hololink_module_status_t hololink::module::RoceDataChannelInterfaceV1::detach_receiver()

Deconfigure the RoCE configuration.

Disconnects the channel from the memory it was directed at, so the device no longer writes to it. Call this before releasing the receiver’s memory. It communicates with the device, so it can fail if the device has become unreachable.

Returns: HOLOLINK_MODULE_OK on success, or an error status.

frame_end_sequencer

template <typename T = SequencerInterfaceV1>
std::shared_ptr<T> hololink::module::RoceDataChannelInterfaceV1::frame_end_sequencer(
bool allow_null = false
)

The sequencer that the device runs each time a frame on this channel has been completely sent.

Receivers add operations to it, such as reading back frame metadata, that must happen at the end of each frame.

Returns: The sequencer for this channel.

Template parameters

T
typename

Service type to return; defaults to SequencerInterfaceV1.

Parameters

allow_null
boolDefaults to false

If false (the default), throws std::runtime_error if the sequencer is not available. If true, returns nullptr instead.

template <typename T = HololinkInterfaceV1>
std::shared_ptr<T> hololink::module::RoceDataChannelInterfaceV1::get_hololink(
bool allow_null = false
)

The device (HololinkInterfaceV1) this channel belongs to.

Same device as returned by DataChannelInterfaceV1::hololink(); provided so that code holding only this interface need not look up the other.

Returns: The device.

Template parameters

T
typename

Service type to return; defaults to HololinkInterfaceV1.

Parameters

allow_null
boolDefaults to false

If false (the default), throws std::runtime_error if the device is not available. If true, returns nullptr instead.

configure

virtual void hololink::module::ConfigurableService<RoceDataChannelInterfaceV1>::configure(
)

Use metadata contents to initialize this instance.

This routine is guaranteed to be called the first time a call to get_service(metadata) is called on a specific service instance.

module

std::shared_ptr<Module> hololink::module::ServiceBase::module() const

The Module that this service was published from.

The service holds no strong reference to its Module, so this does not extend the Module’s lifetime.

Returns: The owning Module, or an empty pointer if the service has not been published or its Module no longer exists.


Static methods

get_service

static std::shared_ptr<RoceDataChannelInterfaceV1> hololink::module::ConfigurableService<RoceDataChannelInterfaceV1>::get_service(
const EnumerationMetadata &metadata,
bool allow_null = false
)

Fetch a service, configured by EnumerationMetadata.

Module usually caches service objects; so when a specific service instance isn’t found, it will be constructed with the current values in EnumerationMetadata. Later calls to get_service are likely to return that cached instance, ignoring changes to any enumeration metadata that aren’t specifically related to service addressing.

Returns: A shared pointer to the requested service (<Derived>).

Throws: std::runtime_error when allow_null==false and the service lookup (or construction) fails.

Parameters

metadata
const EnumerationMetadata &

Addressing and configuration for the service.

allow_null
boolDefaults to false

Use true to return nullptr when the service cannot be resolved; the default false value raises a std::runtime_error.

for_each_type_id

static bool hololink::module::Service<RoceDataChannelInterfaceV1>::for_each_type_id(
Callback &&cb
)

Iterate over every type_id supported by this instance.

The callback signature is bool(const char*) — returning false halts the walk; true continues. Iteration is depth-first, so you’ll see the most specific implementation types first.