psp-ibv.c
Go to the documentation of this file.
99static padico_psp_connection_t psp_ibv_new_message(void*_instance, padico_topo_node_t node, void**_sbuf);
135};
318 conn->of_cq = ibv_create_cq(padico_ibv.psp_ibv_port->context, PADICO_IBV_TX_DEPTH, NULL, NULL, 0);
320 conn->if_cq = ibv_create_cq(padico_ibv.psp_ibv_port->context, PADICO_IBV_RX_DEPTH, NULL, NULL, 0);
362 padico_warning("RLIMIT_MEMLOCK is %d kB. Memory region registration is likely to fail (we need %d kB)\n", (int)lim.rlim_cur, (int)sizeof(conn->lz.zones)/1024);
459static void padico_ibv_request_connect(struct padico_ibv_connection_s*conn, padico_topo_node_t remote_node)
463 padico_string_printf(msg, "<InfinibandVerbs:Connect from=\"%s\" lid=\"%hx\" qpn=\"%x\" psn=\"%x\" raddr=\"%lx\" rkey=\"%x\"/>",
483 struct padico_ibv_connection_s*conn = padico_ibv_connection_hashtable_lookup(&padico_ibv.connections, c->node);
531 .send_flags = (size < conn->max_inline)? (IBV_SEND_INLINE | IBV_SEND_SIGNALED) : IBV_SEND_SIGNALED,
557 padico_assert(ne == 1 && wc.status == IBV_WC_SUCCESS, "WC send failed (status=%d)\n", wc.status);
571static inline void padico_ibv_do_recv(struct padico_ibv_connection_s*conn, uint32_t lkey, void*buf, int size)
632static inline void padico_ibv_lz_send(struct padico_ibv_connection_s*conn, struct iovec*buffers, int num)
647 const size_t packet_size = remaining_size > PADICO_IBV_LZ_BUFSIZE ? PADICO_IBV_LZ_BUFSIZE : remaining_size;
696 padico_ibv_do_zone_send(conn, &cell->buffer[offset], sizeof(struct padico_ibv_lz_cell_s) - offset,
736 const int chunk_payload = padico_ibv_min(conn->lz.send.size - conn->lz.send.done, chunk_max_payload);
737 if((conn->lz.send.sbuf + chunk_size) > (((void*)conn->lz.zones.sbuf) + (conn->lz.send.nbuffer + 1) * PADICO_IBV_LR2_BUFSIZE))
750 conn->lz.send.sbuf = ((void*)conn->lz.zones.sbuf) + conn->lz.send.nbuffer * PADICO_IBV_LR2_BUFSIZE;
751 conn->lz.send.rbuf = ((void*)conn->lz.zones.rbuf) + conn->lz.send.nbuffer * PADICO_IBV_LR2_BUFSIZE;
828 padico_assert(conn->lz.credits > 0, "Infiniband: remote buffer overrun while sending credits.\n");
851 padico_assert(conn->lz.zones.cells[(conn->lz.next_in+PADICO_IBV_LZ_BUFNUM-1) % PADICO_IBV_LZ_BUFNUM].header.status == 0,
861 padico_out(50, "LZ recv waiting on cell #%d (%p; base=%p)\n", conn->lz.next_in, cell, &conn->lz.zones);
909 const int chunk_payload = padico_ibv_min(conn->lz.recv.size - conn->lz.recv.done, chunk_max_payload);
915 conn->lz.recv.rbuf = ((void*)conn->lz.zones.rbuf) + conn->lz.recv.nbuffer * PADICO_IBV_LR2_BUFSIZE;
1155static padico_psp_connection_t psp_ibv_new_message(void*_instance, padico_topo_node_t node, void**_sbuf)
1160 struct padico_ibv_connection_s*const conn = padico_ibv_connection_hashtable_lookup(&padico_ibv.connections, node);
Infiniband Verbs topology detection and description.
assert(slab_size > 0)
puk_allocator_cell_clear & cell(struct ns_rulebucket_hash_entry_s)
static const struct padico_psp_driver_s psp_ibv_driver
'PadicoSimplePackets' facet for PSP-IBV
Definition psp-ibv.c:116
static const struct puk_component_driver_s psp_ibv_component_driver
instanciation facet for PSP-IBV
Definition psp-ibv.c:107
padico_psp_slot_t padico_psp_slot_insert(struct padico_psp_directory_s *d, padico_psp_handler_t handler, void *key, uint32_t tag, size_t h_size)
Definition psp.c:63
void padico_psp_directory_init(struct padico_psp_directory_s *d)
Definition psp.c:56
void * padico_psp_connection_t
An outgoing connection object, supposed to be opaque for the user.
Definition PSP.h:108
padico_psp_slot_t padico_psp_slot_lookup(struct padico_psp_directory_s *d, uint32_t tag)
Definition psp.c:93
void padico_psp_slot_remove(struct padico_psp_directory_s *d, padico_psp_slot_t slot)
Definition psp.c:84
void(* padico_psp_handler_t)(const void *header, padico_topo_node_t from, void *key, padico_psp_pump_t pump, void *token)
A callback for PSP.
Definition PSP.h:103
static void padico_control_send_oneway(padico_topo_node_t node, const char *msg)
Send a "one way" message on the control channel.
Definition PadicoControl.h:102
void padico_tm_bgthread_start(padico_tm_bgthread_pool_t pool, padico_thread_fun_t f, void *arg, const char *name)
Definition tm-rttask.c:126
void padico_tm_bgthread_pool_wait(padico_tm_bgthread_pool_t pool)
finalize a pool of threads: waits for all thread to complete
Definition tm-rttask.c:78
padico_tm_bgthread_pool_t padico_tm_bgthread_pool_create(const char *name)
create a new thread pool
Definition tm-rttask.c:56
void padico_tm_rttask_start(padico_thread_fun_t f, void *arg, const char *name)
const char * padico_topo_node_getname(padico_topo_node_t node)
Get the canonical name of a node.
Definition topology.c:1917
padico_topo_node_t padico_topo_getnodebyname(const char *nodename)
node lookup, by node name
Definition topology.c:2389
const struct padico_ibv_port_vect_s * padico_ibv_get_ports(void)
Definition infiniband-verbs.c:210
struct padico_ibv_connection_hash_entry_block_lfstack_s __attribute__
static void padico_ibv_connect_start_handler(puk_parse_entity_t e)
Definition psp-ibv.c:499
static struct padico_ibv_s padico_ibv
static void padico_ibv_lz_send(struct padico_ibv_connection_s *conn, struct iovec *buffers, int num)
Definition psp-ibv.c:632
static void padico_ibv_send(struct padico_ibv_connection_s *conn, const void *buf, int size)
Definition psp-ibv.c:782
struct @25::@27 recv
static void padico_ibv_wait_one(struct padico_ibv_connection_s *conn)
wait for an event in a given rdma connection
Definition psp-ibv.c:1030
static padico_psp_connection_t psp_ibv_new_message(void *_instance, padico_topo_node_t node, void **_sbuf)
Definition psp-ibv.c:1155
static void padico_ibv_sp_send(struct padico_ibv_connection_s *conn, const void *buf, int size)
Definition psp-ibv.c:717
static void psp_ibv_end_message(void *_instance, padico_psp_connection_t _conn)
Definition psp-ibv.c:1205
static void padico_ibv_sp_recv(struct padico_ibv_connection_s *conn, void *buf, int size)
Definition psp-ibv.c:893
static void * padico_ibv_connector(void *_arg)
asynchronous worker for connection establishment
Definition psp-ibv.c:478
struct @25 lz
static void padico_ibv_lz_cell_completed(struct padico_ibv_connection_s *conn, struct padico_ibv_lz_header_s *h)
acknowledges the processing completion of an incoming LZ cell.
Definition psp-ibv.c:839
static int padico_ibv_lz_recover_credits(struct padico_ibv_connection_s *conn)
Definition psp-ibv.c:607
struct padico_ibv_lz_header_s header
static void psp_ibv_init(void *_instance, uint32_t tag, const char *label, size_t *h_size, padico_psp_handler_t handler, void *key)
Definition psp-ibv.c:1121
static void padico_ibv_idle(struct padico_ibv_connection_s *conn)
Definition psp-ibv.c:625
static void padico_ibv_lz_recv(struct padico_ibv_connection_s *conn, void *buf, int size)
Definition psp-ibv.c:848
static void padico_ibv_connection_connect(struct padico_ibv_connection_s *conn, struct padico_ibv_addr_s *dest)
Connect an (already created) connection to peer.
Definition psp-ibv.c:404
static void padico_ibv_do_zone_send(struct padico_ibv_connection_s *conn, void *buf, int size, void *raddr, uint64_t wrid)
Definition psp-ibv.c:561
static void padico_ibv_do_recv(struct padico_ibv_connection_s *conn, uint32_t lkey, void *buf, int size)
Definition psp-ibv.c:571
static void psp_ibv_pack(void *_instance, padico_psp_connection_t _conn, const char *bytes, size_t size)
Definition psp-ibv.c:1171
static void padico_ibv_do_recv_wait(struct padico_ibv_connection_s *conn)
Definition psp-ibv.c:588
static void * psp_ibv_instantiate(puk_instance_t ai, puk_context_t context)
Definition psp-ibv.c:1106
struct @25::@28 zones
static void padico_ibv_do_send_wait(struct padico_ibv_connection_s *conn, uint64_t wrid)
Definition psp-ibv.c:544
static struct padico_ibv_connection_s * padico_ibv_connection_init(padico_topo_node_t remote_node)
Create a (not-connected-yet) connection structure.
Definition psp-ibv.c:315
static void padico_ibv_recv(struct padico_ibv_connection_s *conn, void *buf, int size)
Definition psp-ibv.c:947
static void padico_ibv_do_rdma_send(struct padico_ibv_connection_s *conn, uint32_t lkey, void *buf, int size, uint32_t rkey, uintptr_t _raddr, uint64_t wrid)
Definition psp-ibv.c:516
struct @25::@26 send
static void psp_ibv_pump(void *token, void *bytes, size_t size)
Definition psp-ibv.c:1060
static void padico_ibv_request_connect(struct padico_ibv_connection_s *conn, padico_topo_node_t remote_node)
Definition psp-ibv.c:459
static void padico_ibv_wait_any(void)
wait for any event in the rdma landing zone
Definition psp-ibv.c:1011
static void psp_ibv_connect(void *_instance, padico_topo_node_t remote_node)
Definition psp-ibv.c:1130
static void padico_ibv_lz_process_incoming(struct padico_ibv_connection_s *conn, struct padico_ibv_lz_header_s *h)
Definition psp-ibv.c:799
Definition psp-ibv.c:172
Definition psp-ibv.c:138
Definition psp-ibv.c:472
volatile uint32_t offset
Definition psp-ibv.c:183
Definition psp-ibv.c:179
struct padico_ibv_lz_cell_s::padico_ibv_lz_header_s header
Definition psp-ibv.c:2
Definition infiniband-verbs.c:52
struct padico_ibv_connection_hashtable_s connections
index for the above list [hash: node -> ibv_connection]
Definition psp-ibv.c:250
void(* init)(void *_instance, uint32_t tag, const char *label, size_t *h_size, padico_psp_handler_t handler, void *key)
init a new PSP instance
Definition PSP.h:122
a thread pool, to control and wait running threads
Definition PadicoTM.h:174
Definition psp-ibv.c:1053