add functions: fc_server_[close|destroy]_connection

support_rdma
YuQing 2023-09-23 11:06:56 +08:00
parent 7b0631e37a
commit e0b93756ab
2 changed files with 16 additions and 0 deletions

View File

@ -460,6 +460,11 @@ static inline ConnectionInfo *conn_pool_alloc_connection(
extra_data_size, extra_params, err_no);
}
static inline void conn_pool_free_connection(ConnectionInfo *conn)
{
free(conn);
}
int conn_pool_set_rdma_extra_params(ConnectionExtraParams *extra_params,
struct fc_server_config *server_cfg, const int server_group_index);

View File

@ -251,6 +251,17 @@ int fc_server_make_connection_ex(FCAddressPtrArray *addr_array,
fc_server_make_connection_ex(addr_array, conn, \
service_name, connect_timeout, NULL, true)
static inline void fc_server_close_connection(ConnectionInfo *conn)
{
G_COMMON_CONNECTION_CALLBACKS[conn->comm_type].close_connection(conn);
}
static inline void fc_server_destroy_connection(ConnectionInfo *conn)
{
fc_server_close_connection(conn);
conn_pool_free_connection(conn);
}
struct ibv_pd *fc_alloc_rdma_pd(fc_alloc_pd_callback alloc_pd,
FCAddressPtrArray *address_array, int *result);