@@ -64,24 +64,22 @@ namespace mxl::lib::fabrics::ofi
6464 auto proto = selectIngressProtocol (mxlRegions.dataLayout (), mxlRegions.regions (), mxlRegions.maxSyncBatchSize ());
6565 auto targetInfo = std::make_unique<TargetInfo>(pep.id (), pep.localAddress (), proto->registerMemory (domain), proto->bounceBufferInfo ());
6666
67- auto const cqSize = options.cqDepth .value_or (CompletionQueue::Attributes::DEFAULT_SIZE );
68-
6967 // Helper struct to enable the std::make_unique function to access the private constructor of this class.
7068 struct MakeUniqueEnabler : RCTarget
7169 {
72- MakeUniqueEnabler (PassiveEndpoint pep, std::unique_ptr<IngressProtocol> proto, std::shared_ptr<Domain> domain, std:: size_t cqDepth )
73- : RCTarget(std::move(pep), std::move(proto), std::move(domain), cqDepth )
70+ MakeUniqueEnabler (PassiveEndpoint pep, std::unique_ptr<IngressProtocol> proto, std::shared_ptr<Domain> domain, TargetSetupOptions options )
71+ : RCTarget(std::move(pep), std::move(proto), std::move(domain), std::move(options) )
7472 {}
7573 };
7674
7775 // Return the constructed RCTarget and associated TargetInfo for remote peers to connect.
78- return {std::make_unique<MakeUniqueEnabler>(std::move (pep), std::move (proto), std::move (domain), cqSize ), std::move (targetInfo)};
76+ return {std::make_unique<MakeUniqueEnabler>(std::move (pep), std::move (proto), std::move (domain), options ), std::move (targetInfo)};
7977 }
8078
81- RCTarget::RCTarget (PassiveEndpoint pep, std::unique_ptr<IngressProtocol> proto, std::shared_ptr<Domain> domain, std:: size_t cqDepth )
79+ RCTarget::RCTarget (PassiveEndpoint pep, std::unique_ptr<IngressProtocol> proto, std::shared_ptr<Domain> domain, TargetSetupOptions options )
8280 : _proto(std::move(proto))
8381 , _domain(std::move(domain))
84- , _cqDepth(cqDepth )
82+ , _setupOptions(std::move(options) )
8583 , _state(WaitForConnectionRequest{std::move (pep)})
8684 {}
8785
@@ -162,7 +160,7 @@ namespace mxl::lib::fabrics::ofi
162160 auto endpoint = Endpoint::create (_domain, state.pep .id (), event->connReq ().info ());
163161
164162 auto cqAttr = CompletionQueue::Attributes::defaults ();
165- cqAttr.size = _cqDepth ;
163+ cqAttr.size = _setupOptions. cqDepth . value_or (CompletionQueue::Attributes:: DEFAULT_SIZE ) ;
166164 auto cq = CompletionQueue::open (_domain, cqAttr);
167165 endpoint.bind (cq, FI_RECV );
168166
0 commit comments