9#include <rdma/fabric.h>
10#include <rdma/fi_eq.h>
27 requireCapability(info, FI_REMOTE_WRITE,
"Interface is missing required remote write capability");
55 cqAttr.waitObject = FI_WAIT_NONE;
60 endpoint.bind(cq, FI_RECV | FI_TRANSMIT);
72 auto protocol =
selectIngressProtocol(mxlRegions.dataLayout(), mxlRegions.regions(), mxlRegions.maxSyncBatchSize());
73 auto targetInfo = std::make_unique<TargetInfo>(
74 endpoint.id(), endpoint.localAddress(), *provider, protocol->registerMemory(domain), protocol->bounceBufferInfo());
78 MakeUniqueEnabler(
Endpoint ep, std::unique_ptr<IngressProtocol> proto)
79 :
RDMTarget(std::move(ep), std::move(proto))
83 return {std::make_unique<MakeUniqueEnabler>(std::move(endpoint), std::move(protocol)), std::move(targetInfo)};
106 template<QueueReadMode queueReadMode>
122 return std::make_optional<Target::Interrupted>();
static std::shared_ptr< AddressVector > open(std::shared_ptr< Domain > domain, Attributes attr=Attributes::defaults())
Create an AddressVector.
static std::shared_ptr< CompletionQueue > open(std::shared_ptr< Domain > domain, Attributes const &attr=Attributes::defaults())
Create a new completion queue in the specified domain.
static bool isWaitObjectSupportedForEFA() noexcept
Check if wait any wait object type supported by the EFA provider for this libfabric version.
static std::shared_ptr< Domain > open(std::shared_ptr< Fabric > fabric)
Open a new domain associated with the specified fabric.
RAII Wrapper around a libfabric endpoint (fi_ep).
static Endpoint create(std::shared_ptr< Domain > domain, FabricInfoView info)
Allocates (active) new endpoint.
static std::shared_ptr< EventQueue > open(std::shared_ptr< Fabric >, Attributes const &attr=Attributes::defaults())
Create a new event queue associated with the specified fabric.
static Exception invalidArgument(fmt::format_string< T... > fmt, T &&... args)
Make an MXL_ERR_INVALID_ARG exception.
static Exception make(mxlStatus status, fmt::format_string< T... > fmt, T &&... args)
Make any type of exception.
static FabricAddress fromSource(FabricInfoView info) noexcept
Build a FabricAddress from the source address of info.
An internal exception type that extends.
bool isInterrupted() const noexcept
Non-owning view of a FabricInfo. Returned when iterating over a FabricInfoList.
static std::shared_ptr< Fabric > open(FabricInfoView info)
Open a fabric object based on the provided FabricInfoView.
static MxlRegions forWriter(mxlFlowWriter)
static std::pair< std::unique_ptr< RDMTarget >, std::unique_ptr< TargetInfo > > setup(mxlFabricsTargetConfig const &config, FabricInfoView info, TargetSetupOptions const &options)
Set up a fresh RDMTarget and its associated TargetInfo based on the given configuration.
std::optional< Target::ReadResult > readNext(std::chrono::steady_clock::duration timeout)
Internal method to drive progress based on the current state.
virtual std::optional< Target::ReadResult > read() final
Determine if new data can be consumed.
std::unique_ptr< IngressProtocol > _protocol
virtual std::optional< Target::ReadResult > readBlocking(std::chrono::steady_clock::duration timeout) final
RDMTarget(Endpoint ep, std::unique_ptr< IngressProtocol > protocol)
Construct an RDMTarget with the given endpoint and immediate data location.
virtual void shutdown() final
Shut down the target gracefully. Initiates a graceful shutdown of the target and blocks until the shu...
struct mxlFabricsTargetConfig_t mxlFabricsTargetConfig
@ MXL_FABRICS_IFACE_CAP_BLOCKING_OPERATIONS
void drainEventQueue(EventQueue &eq)
Read all entries from a connectionless endpoint's event queue and log the errors among them.
std::optional< Provider > providerFromString(std::string const &s) noexcept
Parse a provider name string, and return the enum value.
std::unique_ptr< IngressProtocol > selectIngressProtocol(DataLayout const &layout, std::vector< Region > regions, std::uint32_t maxSyncBatchSize)
Select an appropriate ingress protocol based on the data layout.
std::optional< Completion > readCompletionQueue(CompletionQueue &eq, std::chrono::steady_clock::duration timeout)
Helper to read a completion queue with blocking or non-blocking behaviour.
void requireCapability(FabricInfoView info, std::uint64_t cap, std::string_view message)
mxlFabricsInterfaceCaps caps
mxlFabricsInterfaceConfig interface
static Attributes defaults()
Returns the a CompletionQueueAttr with all of its attributes set to reasonable defaults.
Provider-independent tuning options for target setup.
std::optional< std::size_t > cqDepth
Desired completion-queue depth.