|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
Server side of an EbLfLink; synchronizes with the client before and after each exchange. More...
#include <EbLfLink.hh>
Inherits Pds::Eb::EbLfLink.
Public Member Functions | |
| EbLfSvrLink (Fabrics::Endpoint *, const unsigned rxDepth, const unsigned &verbose, volatile uint64_t &pending, volatile uint64_t &posting) | |
| Construct the base EbLfLink with rxDepth receive credits. | |
| int | exchangeId (unsigned id, const char *peer) |
| Synchronize with the client, receive its ID (stored as id()), send id, then synchronize again. | |
| int | prepare (size_t *size, const char *peer) |
| Synchronize with the client and receive the size of the memory region it asks for, storing it in size if size is non-null. | |
| int | setupMr (void *region, size_t size, const char *peer) |
| Register (or reuse) a memory region for size bytes at region, send its description to the client with sendMr() and finish the synchronization started by prepare(). | |
Public Member Functions inherited from Pds::Eb::EbLfLink | |
| EbLfLink (Fabrics::Endpoint *, const unsigned depth, const unsigned &verbose, volatile uint64_t &pending, volatile uint64_t &posting) | |
| Wrap the endpoint with depth receive credits, zero the shared pending and posting words and post depth zero-length receives. | |
| ~EbLfLink () | |
| Zero the pending and posting words and print a message if fewer than depth credits are posted. | |
| int | recvU32 (uint32_t *u32, const char *peer, const char *name) |
| Wait up to 7 s for one immediate data value and store its low 32 bits in u32. | |
| int | sendU32 (uint32_t u32, const char *peer, const char *name) |
| Send u32 as immediate data with post(); returns 0, or the error after printing a message. | |
| int | sendMr (Fabrics::MemoryRegion *, const char *peer) |
| Send a RemoteAddress built from the memory region (start address, length, key) to the peer as a series of 32-bit immediate data values; returns 0 or a negative error. | |
| int | recvMr (Fabrics::RemoteAddress &, const char *peer) |
| Receive a RemoteAddress into ra as a series of 32-bit immediate data values (as sent by sendMr()), waiting up to 7 s for each; returns 0 or the poll() error. | |
| void * | lclAdx (size_t offset) const |
| Return the local address that is offset bytes from the start of the local memory region. | |
| size_t | lclOfs (const void *buffer) const |
| Return the byte offset of buffer from the start of the local memory region. | |
| uintptr_t | rmtAdx (size_t offset) const |
| Return the remote address that is offset bytes from the start of the remote region. | |
| size_t | rmtOfs (uintptr_t buffer) const |
| Return the byte offset of the remote address buffer from the start of the remote region. | |
| Fabrics::Endpoint * | endpoint () const |
| Return the libfabric endpoint. | |
| unsigned | id () const |
| Return the peer ID received in exchangeId(); (unsigned)-1 before that. | |
| const uint64_t & | tmoCnt () const |
| Return the number of timeouts counted by post() and poll(). | |
| int | post (const void *buf, size_t len, uint64_t immData) |
| Send len bytes from buf with immediate data immData using Endpoint::injectdata(), retrying -FI_EAGAIN for up to 300 s. | |
| int | post (uint64_t immData) |
| Send only the immediate data immData; same as post(nullptr, 0, immData). | |
| int | poll (uint64_t *data) |
| Check the receive completion queue once without waiting and re-post the consumed receive. | |
| int | poll (uint64_t *data, int msTmo) |
| Like poll(uint64_t*), but waits up to msTmo milliseconds for a completion. | |
| ssize_t | postCompRecv (const unsigned count) |
| Consume count receive credits, then re-post zero-length receives until depth credits are posted again (on -FI_EAGAIN, retry up to 100000 times with 10 us sleeps). | |
Additional Inherited Members | |
Public Attributes inherited from Pds::Eb::EbLfLink | |
| const unsigned | _depth |
| Number of receive buffers (credits) to keep posted. | |
| unsigned | _credits |
| Number of receive buffers currently posted. | |
Protected Types inherited from Pds::Eb::EbLfLink | |
| enum | { _BegSync = 0x11111111 , _EndSync = 0x22222222 , _SvrSync = 0x33333333 , _CltSync = 0x44444444 } |
Protected Attributes inherited from Pds::Eb::EbLfLink | |
| unsigned | _id |
| Fabrics::Endpoint * | _ep |
| Fabrics::MemoryRegion * | _mr |
| Fabrics::RemoteAddress | _ra |
| const unsigned & | _verbose |
| uint64_t | _timedOut |
| volatile uint64_t & | _pending |
| volatile uint64_t & | _posting |
Server side of an EbLfLink; synchronizes with the client before and after each exchange.
| Pds::Eb::EbLfSvrLink::EbLfSvrLink | ( | Fabrics::Endpoint * | , |
| const unsigned | rxDepth, | ||
| const unsigned & | verbose, | ||
| volatile uint64_t & | pending, | ||
| volatile uint64_t & | posting | ||
| ) |
Construct the base EbLfLink with rxDepth receive credits.
| int Pds::Eb::EbLfSvrLink::exchangeId | ( | unsigned | id, |
| const char * | peer | ||
| ) |
Synchronize with the client, receive its ID (stored as id()), send id, then synchronize again.
Returns 0 or the first error.
| int Pds::Eb::EbLfSvrLink::prepare | ( | size_t * | size, |
| const char * | peer | ||
| ) |
Synchronize with the client and receive the size of the memory region it asks for, storing it in size if size is non-null.
setupMr() completes this exchange.
| int Pds::Eb::EbLfSvrLink::setupMr | ( | void * | region, |
| size_t | size, | ||
| const char * | peer | ||
| ) |