mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-09 00:00:03 +01:00
Added remote address conversion in benchmark, removed from kernel code.
This commit is contained in:
parent
92e22c28ac
commit
71ee6cbee6
7 changed files with 396 additions and 400 deletions
|
@ -40,6 +40,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
size_t guest_to_host(size_t address);
|
||||
|
||||
const char * ibv_wc_status_str(enum ibv_wc_status status);
|
||||
int ibv_rate_to_mult(enum ibv_rate rate);
|
||||
enum ibv_rate mult_to_ibv_rate(int mult);
|
||||
|
|
51
kernel/ibv.c
51
kernel/ibv.c
|
@ -38,9 +38,10 @@
|
|||
|
||||
#include <hermit/ibv.h>
|
||||
|
||||
|
||||
extern uint8_t * host_logical_addr;
|
||||
|
||||
inline size_t guest_to_host(size_t address) {
|
||||
size_t guest_to_host(size_t address) {
|
||||
return address ? virt_to_phys(address) + (size_t) host_logical_addr : address;
|
||||
}
|
||||
|
||||
|
@ -1955,29 +1956,29 @@ int ibv_post_send(struct ibv_qp * qp, struct ibv_send_wr * wr, struct ibv_send_w
|
|||
struct ibv_send_wr * wr__next[num_wrs];
|
||||
struct ibv_sge * wr__sg_list[num_wrs];
|
||||
uint64_t wr__sg_list__addr[num_wrs][num_sges_max];
|
||||
uint64_t wr__wr__rdma__remote_addr[num_wrs];
|
||||
uint64_t wr__wr__atomic__remote_addr[num_wrs];
|
||||
/* uint64_t wr__wr__rdma__remote_addr[num_wrs]; */
|
||||
/* uint64_t wr__wr__atomic__remote_addr[num_wrs]; */
|
||||
uint64_t wr__bind_mw__bind_info__addr[num_wrs];
|
||||
void * wr__tso__hdr[num_wrs];
|
||||
|
||||
curr_wr = wr;
|
||||
for (int i = 0; i < num_wrs; i++) {
|
||||
is_rdma = curr_wr->opcode == IBV_WR_RDMA_WRITE ||
|
||||
curr_wr->opcode == IBV_WR_RDMA_WRITE_WITH_IMM ||
|
||||
curr_wr->opcode == IBV_WR_RDMA_READ;
|
||||
is_atomic = curr_wr->opcode == IBV_WR_ATOMIC_CMP_AND_SWP ||
|
||||
curr_wr->opcode == IBV_WR_ATOMIC_FETCH_AND_ADD;
|
||||
/* is_rdma = curr_wr->opcode == IBV_WR_RDMA_WRITE || */
|
||||
/* curr_wr->opcode == IBV_WR_RDMA_WRITE_WITH_IMM || */
|
||||
/* curr_wr->opcode == IBV_WR_RDMA_READ; */
|
||||
/* is_atomic = curr_wr->opcode == IBV_WR_ATOMIC_CMP_AND_SWP || */
|
||||
/* curr_wr->opcode == IBV_WR_ATOMIC_FETCH_AND_ADD; */
|
||||
is_bind_mw = curr_wr->opcode == IBV_WR_BIND_MW;
|
||||
is_tso = curr_wr->opcode == IBV_WR_TSO;
|
||||
|
||||
// union wr: rdma and atomic
|
||||
if (is_rdma) {
|
||||
wr__wr__rdma__remote_addr[i] = curr_wr->wr.rdma.remote_addr;
|
||||
curr_wr->wr.rdma.remote_addr = (uint64_t) guest_to_host((size_t) curr_wr->wr.rdma.remote_addr);
|
||||
} else if (is_atomic) {
|
||||
wr__wr__atomic__remote_addr[i] = curr_wr->wr.atomic.remote_addr;
|
||||
curr_wr->wr.atomic.remote_addr = (uint64_t) guest_to_host((size_t) curr_wr->wr.atomic.remote_addr);
|
||||
}
|
||||
/* if (is_rdma) { */
|
||||
/* wr__wr__rdma__remote_addr[i] = curr_wr->wr.rdma.remote_addr; */
|
||||
/* curr_wr->wr.rdma.remote_addr = (uint64_t) guest_to_host((size_t) curr_wr->wr.rdma.remote_addr); */
|
||||
/* } else if (is_atomic) { */
|
||||
/* wr__wr__atomic__remote_addr[i] = curr_wr->wr.atomic.remote_addr; */
|
||||
/* curr_wr->wr.atomic.remote_addr = (uint64_t) guest_to_host((size_t) curr_wr->wr.atomic.remote_addr); */
|
||||
/* } */
|
||||
|
||||
// union: bind_mw and tso
|
||||
if (is_bind_mw) {
|
||||
|
@ -2014,20 +2015,20 @@ int ibv_post_send(struct ibv_qp * qp, struct ibv_send_wr * wr, struct ibv_send_w
|
|||
|
||||
curr_wr = wr;
|
||||
for (int i = 0; i < num_wrs; i++) {
|
||||
is_rdma = curr_wr->opcode == IBV_WR_RDMA_WRITE ||
|
||||
curr_wr->opcode == IBV_WR_RDMA_WRITE_WITH_IMM ||
|
||||
curr_wr->opcode == IBV_WR_RDMA_READ;
|
||||
is_atomic = curr_wr->opcode == IBV_WR_ATOMIC_CMP_AND_SWP ||
|
||||
curr_wr->opcode == IBV_WR_ATOMIC_FETCH_AND_ADD;
|
||||
/* is_rdma = curr_wr->opcode == IBV_WR_RDMA_WRITE || */
|
||||
/* curr_wr->opcode == IBV_WR_RDMA_WRITE_WITH_IMM || */
|
||||
/* curr_wr->opcode == IBV_WR_RDMA_READ; */
|
||||
/* is_atomic = curr_wr->opcode == IBV_WR_ATOMIC_CMP_AND_SWP || */
|
||||
/* curr_wr->opcode == IBV_WR_ATOMIC_FETCH_AND_ADD; */
|
||||
is_bind_mw = curr_wr->opcode == IBV_WR_BIND_MW;
|
||||
is_tso = curr_wr->opcode == IBV_WR_TSO;
|
||||
|
||||
// union wr: rdma and atomic
|
||||
if (is_rdma) {
|
||||
curr_wr->wr.rdma.remote_addr = wr__wr__rdma__remote_addr[i];
|
||||
} else if (is_atomic) {
|
||||
curr_wr->wr.atomic.remote_addr = wr__wr__atomic__remote_addr[i];
|
||||
}
|
||||
/* if (is_rdma) { */
|
||||
/* curr_wr->wr.rdma.remote_addr = wr__wr__rdma__remote_addr[i]; */
|
||||
/* } else if (is_atomic) { */
|
||||
/* curr_wr->wr.atomic.remote_addr = wr__wr__atomic__remote_addr[i]; */
|
||||
/* } */
|
||||
|
||||
// union: bind_mw and tso
|
||||
if (is_bind_mw) {
|
||||
|
|
|
@ -1235,7 +1235,7 @@ void call_ibv_post_send(struct kvm_run * run, uint8_t * guest_mem) {
|
|||
/* printf("\t ->sg_list[0].length: %lu\n", args->wr->sg_list[0].length); */
|
||||
/* printf("\t ->sg_list[0].lkey: %lu\n", args->wr->sg_list[0].lkey); */
|
||||
/* printf("\t ->sg_list[0].addr: %p\n", (char *) args->wr->sg_list[0].addr); */
|
||||
printf("\t ->sg_list[0].addr deref 1: %u\n", *((uint8_t *) args->wr->sg_list[0].addr));
|
||||
/* printf("\t ->sg_list[0].addr deref 1: %u\n", *((uint8_t *) args->wr->sg_list[0].addr)); */
|
||||
|
||||
use_ib_mem_pool = true;
|
||||
args->ret = ibv_post_send(args->qp, args->wr, args->bad_wr);
|
||||
|
|
|
@ -850,98 +850,98 @@ typedef struct {
|
|||
|
||||
|
||||
|
||||
void call_ibv_wc_status_str(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_rate_to_mult(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_mult_to_ibv_rate(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_rate_to_mbps(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_mbps_to_ibv_rate(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_cq_ex_to_cq(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_start_poll(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_next_poll(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_end_poll(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_opcode(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_vendor_err(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_byte_len(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_imm_data(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_invalidated_rkey(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_qp_num(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_src_qp(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_wc_flags(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_slid(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_sl(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_dlid_path_bits(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_completion_ts(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_cvlan(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_flow_tag(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_post_wq_recv(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_get_device_list(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_free_device_list(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_get_device_name(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_get_device_guid(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_open_device(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_close_device(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_get_async_event(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_ack_async_event(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_query_device(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_query_port(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_query_gid(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_query_pkey(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_alloc_pd(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_dealloc_pd(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_flow(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_destroy_flow(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_open_xrcd(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_close_xrcd(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_reg_mr(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_rereg_mr(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_dereg_mr(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_alloc_mw(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_dealloc_mw(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_inc_rkey(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_bind_mw(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_comp_channel(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_destroy_comp_channel(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_cq(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_cq_ex(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_resize_cq(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_destroy_cq(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_get_cq_event(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_ack_cq_events(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_poll_cq(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_req_notify_cq(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_srq(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_srq_ex(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_modify_srq(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_query_srq(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_get_srq_num(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_destroy_srq(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_post_srq_recv(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_qp(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_qp_ex(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_query_rt_values_ex(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_query_device_ex(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_open_qp(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_modify_qp(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_query_qp(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_destroy_qp(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_wq(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_modify_wq(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_destroy_wq(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_rwq_ind_table(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_destroy_rwq_ind_table(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_post_send(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_post_recv(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_ah(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_init_ah_from_wc(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_ah_from_wc(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_destroy_ah(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_attach_mcast(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_detach_mcast(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_fork_init(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_node_type_str(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_port_state_str(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_event_type_str(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_status_str (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_rate_to_mult (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_mult_to_ibv_rate (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_rate_to_mbps (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_mbps_to_ibv_rate (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_cq_ex_to_cq (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_start_poll (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_next_poll (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_end_poll (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_opcode (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_vendor_err (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_byte_len (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_imm_data (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_invalidated_rkey (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_qp_num (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_src_qp (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_wc_flags (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_slid (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_sl (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_dlid_path_bits (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_completion_ts (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_cvlan (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_wc_read_flow_tag (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_post_wq_recv (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_get_device_list (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_free_device_list (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_get_device_name (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_get_device_guid (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_open_device (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_close_device (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_get_async_event (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_ack_async_event (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_query_device (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_query_port (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_query_gid (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_query_pkey (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_alloc_pd (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_dealloc_pd (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_flow (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_destroy_flow (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_open_xrcd (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_close_xrcd (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_reg_mr (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_rereg_mr (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_dereg_mr (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_alloc_mw (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_dealloc_mw (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_inc_rkey (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_bind_mw (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_comp_channel (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_destroy_comp_channel (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_cq (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_cq_ex (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_resize_cq (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_destroy_cq (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_get_cq_event (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_ack_cq_events (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_poll_cq (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_req_notify_cq (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_srq (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_srq_ex (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_modify_srq (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_query_srq (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_get_srq_num (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_destroy_srq (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_post_srq_recv (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_qp (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_qp_ex (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_query_rt_values_ex (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_query_device_ex (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_open_qp (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_modify_qp (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_query_qp (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_destroy_qp (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_wq (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_modify_wq (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_destroy_wq (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_rwq_ind_table (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_destroy_rwq_ind_table (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_post_send (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_post_recv (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_ah (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_init_ah_from_wc (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_create_ah_from_wc (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_destroy_ah (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_attach_mcast (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_detach_mcast (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_fork_init (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_node_type_str (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_port_state_str (struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_event_type_str (struct kvm_run * run, uint8_t * guest_mem);
|
||||
// void call_ibv_resolve_eth_l2_from_gid(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_is_qpt_supported(struct kvm_run * run, uint8_t * guest_mem);
|
||||
void call_ibv_is_qpt_supported (struct kvm_run * run, uint8_t * guest_mem);
|
||||
|
||||
#endif // UHYVE_IBV_H
|
||||
|
|
|
@ -335,9 +335,7 @@ static int ethernet_write_keys(struct pingpong_dest *my_dest,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static int ethernet_read_keys(struct pingpong_dest *rem_dest,
|
||||
struct perftest_comm *comm)
|
||||
{
|
||||
|
@ -760,10 +758,22 @@ int set_up_connection(struct pingpong_context *ctx,
|
|||
|
||||
/* Each qp gives its receive buffer address.*/
|
||||
my_dest[i].out_reads = user_param->out_reads;
|
||||
if (user_param->mr_per_qp)
|
||||
my_dest[i].vaddr = (uintptr_t)ctx->buf[i] + BUFF_SIZE(ctx->size, ctx->cycle_buffer);
|
||||
else
|
||||
my_dest[i].vaddr = (uintptr_t)ctx->buf[0] + (user_param->num_of_qps + i)*BUFF_SIZE(ctx->size, ctx->cycle_buffer);
|
||||
uintptr_t guest_vaddr;
|
||||
if (user_param->mr_per_qp) {
|
||||
/* my_dest[i].vaddr = (uintptr_t)ctx->buf[i] + BUFF_SIZE(ctx->size, ctx->cycle_buffer); */
|
||||
guest_vaddr = (uintptr_t)ctx->buf[i] + BUFF_SIZE(ctx->size, ctx->cycle_buffer); // !!!
|
||||
my_dest[i].vaddr = (unsigned long long) guest_to_host((size_t) guest_vaddr);
|
||||
/* printf("if:\nctx->buf[i]:\t%p\nguest_vaddr:\t%p\nmydestvaddr:\t%llu\n", ctx->buf[i], guest_vaddr, my_dest[i].vaddr); */
|
||||
} else {
|
||||
/* my_dest[i].vaddr = (uintptr_t)ctx->buf[0] + */
|
||||
/* (user_param->num_of_qps + i)*BUFF_SIZE(ctx->size, ctx->cycle_buffer); */
|
||||
guest_vaddr = (uintptr_t)ctx->buf[0] +
|
||||
(user_param->num_of_qps + i)*BUFF_SIZE(ctx->size, ctx->cycle_buffer);
|
||||
my_dest[i].vaddr = (unsigned long long) guest_to_host((size_t) guest_vaddr);
|
||||
printf("\nelse:\nctx->buf[0]:\t%p\nguest_vaddr:\t%p\nmydestvaddr:\t%p\n",
|
||||
ctx->buf[0], guest_vaddr, (uintptr_t) my_dest[i].vaddr);
|
||||
}
|
||||
|
||||
if (user_param->dualport==ON) {
|
||||
if (i % num_of_qps < num_of_qps_per_port)
|
||||
memcpy(my_dest[i].gid.raw, temp_gid.raw , 16);
|
||||
|
@ -875,10 +885,9 @@ int ctx_hand_shake(struct perftest_comm *comm,
|
|||
fprintf(stderr, " Unable to read from socket/rdam_cm\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*Server side will wait for the client side to reach the write function.*/
|
||||
} else {
|
||||
|
||||
} else {
|
||||
if ((*read_func_ptr)(rem_dest, comm)) {
|
||||
fprintf(stderr, " Unable to read to socket/rdam_cm\n");
|
||||
return 1;
|
||||
|
|
|
@ -27,8 +27,7 @@ static enum ibv_wr_opcode opcode_atomic_array[] = {IBV_WR_ATOMIC_CMP_AND_SWP, IB
|
|||
struct perftest_parameters* duration_param;
|
||||
struct check_alive_data check_alive_data;
|
||||
|
||||
struct ibv_qp* ctx_qp_create(struct pingpong_context *ctx,
|
||||
struct perftest_parameters *user_param)
|
||||
struct ibv_qp* ctx_qp_create(struct pingpong_context *ctx, struct perftest_parameters *user_param)
|
||||
{
|
||||
struct ibv_qp_init_attr attr;
|
||||
struct ibv_qp* qp = NULL;
|
||||
|
@ -200,9 +199,8 @@ int create_single_mr(struct pingpong_context *ctx, struct perftest_parameters *u
|
|||
return SUCCESS;
|
||||
}
|
||||
|
||||
int create_reg_cqs(struct pingpong_context *ctx,
|
||||
struct perftest_parameters *user_param,
|
||||
int tx_buffer_depth, int need_recv_cq)
|
||||
int create_reg_cqs(struct pingpong_context *ctx, struct perftest_parameters *user_param,
|
||||
int tx_buffer_depth, int need_recv_cq)
|
||||
{
|
||||
ctx->send_cq = ibv_create_cq(ctx->context, tx_buffer_depth *
|
||||
user_param->num_of_qps, NULL, ctx->channel, user_param->eq_num);
|
||||
|
@ -223,9 +221,8 @@ int create_reg_cqs(struct pingpong_context *ctx,
|
|||
return SUCCESS;
|
||||
}
|
||||
|
||||
int create_reg_qp_main(struct pingpong_context *ctx,
|
||||
struct perftest_parameters *user_param,
|
||||
int i, int num_of_qps)
|
||||
int create_reg_qp_main(struct pingpong_context *ctx, struct perftest_parameters *user_param,
|
||||
int i, int num_of_qps)
|
||||
{
|
||||
if (user_param->use_xrc) {
|
||||
/* #ifdef HAVE_XRCD */
|
||||
|
@ -420,12 +417,10 @@ int check_packet_pacing_support(struct pingpong_context *ctx)
|
|||
}
|
||||
#endif
|
||||
|
||||
static int ctx_modify_qp_to_rtr(struct ibv_qp *qp,
|
||||
struct ibv_qp_attr *attr,
|
||||
struct perftest_parameters *user_param,
|
||||
struct pingpong_dest *dest,
|
||||
struct pingpong_dest *my_dest,
|
||||
int qpindex)
|
||||
static int ctx_modify_qp_to_rtr(struct ibv_qp *qp, struct ibv_qp_attr *attr,
|
||||
struct perftest_parameters *user_param,
|
||||
struct pingpong_dest *dest,
|
||||
struct pingpong_dest *my_dest, int qpindex)
|
||||
{
|
||||
int num_of_qps = user_param->num_of_qps;
|
||||
int num_of_qps_per_port = user_param->num_of_qps / 2;
|
||||
|
@ -504,9 +499,8 @@ static int ctx_modify_qp_to_rtr(struct ibv_qp *qp,
|
|||
return ibv_modify_qp(qp, attr, flags);
|
||||
}
|
||||
|
||||
void ctx_set_send_reg_wqes(struct pingpong_context *ctx,
|
||||
struct perftest_parameters *user_param,
|
||||
struct pingpong_dest *rem_dest)
|
||||
void ctx_set_send_reg_wqes(struct pingpong_context *ctx, struct perftest_parameters *user_param,
|
||||
struct pingpong_dest *rem_dest)
|
||||
{
|
||||
int i, j;
|
||||
int num_of_qps = user_param->num_of_qps;
|
||||
|
@ -530,14 +524,13 @@ void ctx_set_send_reg_wqes(struct pingpong_context *ctx,
|
|||
}
|
||||
}
|
||||
|
||||
if (user_param->verb == WRITE || user_param->verb == READ)
|
||||
if (user_param->verb == WRITE || user_param->verb == READ) {
|
||||
ctx->wr[i*user_param->post_list].wr.rdma.remote_addr = rem_dest[xrc_offset + i].vaddr;
|
||||
|
||||
else if (user_param->verb == ATOMIC)
|
||||
} else if (user_param->verb == ATOMIC) {
|
||||
ctx->wr[i*user_param->post_list].wr.atomic.remote_addr = rem_dest[xrc_offset + i].vaddr;
|
||||
}
|
||||
|
||||
if (user_param->tst == BW || user_param->tst == LAT_BY_BW) {
|
||||
|
||||
ctx->scnt[i] = 0;
|
||||
ctx->ccnt[i] = 0;
|
||||
ctx->my_addr[i] = (uintptr_t)ctx->buf[i];
|
||||
|
@ -639,11 +632,9 @@ void ctx_set_send_reg_wqes(struct pingpong_context *ctx,
|
|||
}
|
||||
}
|
||||
|
||||
static int ctx_modify_qp_to_rts(struct ibv_qp *qp,
|
||||
void *_attr,
|
||||
struct perftest_parameters *user_param,
|
||||
struct pingpong_dest *dest,
|
||||
struct pingpong_dest *my_dest)
|
||||
static int ctx_modify_qp_to_rts(struct ibv_qp *qp, void *_attr,
|
||||
struct perftest_parameters *user_param,
|
||||
struct pingpong_dest *dest, struct pingpong_dest *my_dest)
|
||||
{
|
||||
/* #ifdef HAVE_PACKET_PACING_EXP */
|
||||
/* uint64_t flags = IBV_QP_STATE; */
|
||||
|
@ -693,7 +684,7 @@ static int ctx_modify_qp_to_rts(struct ibv_qp *qp,
|
|||
}
|
||||
|
||||
int verify_params_with_device_context(struct ibv_context *context,
|
||||
struct perftest_parameters *user_param)
|
||||
struct perftest_parameters *user_param)
|
||||
{
|
||||
if(user_param->use_event) {
|
||||
if(user_param->eq_num > context->num_comp_vectors) {
|
||||
|
@ -711,10 +702,8 @@ int verify_params_with_device_context(struct ibv_context *context,
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
int check_add_port(char **service,int port,
|
||||
const char *servername,
|
||||
struct addrinfo *hints,
|
||||
struct addrinfo **res)
|
||||
int check_add_port(char **service,int port, const char *servername,
|
||||
struct addrinfo *hints, struct addrinfo **res)
|
||||
{
|
||||
int number;
|
||||
|
||||
|
@ -996,10 +985,8 @@ int ctx_init(struct pingpong_context *ctx, struct perftest_parameters *user_para
|
|||
return SUCCESS;
|
||||
}
|
||||
|
||||
int ctx_connect(struct pingpong_context *ctx,
|
||||
struct pingpong_dest *dest,
|
||||
struct perftest_parameters *user_param,
|
||||
struct pingpong_dest *my_dest)
|
||||
int ctx_connect(struct pingpong_context *ctx, struct pingpong_dest *dest,
|
||||
struct perftest_parameters *user_param, struct pingpong_dest *my_dest)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -1139,8 +1126,7 @@ int ctx_connect(struct pingpong_context *ctx,
|
|||
return SUCCESS;
|
||||
}
|
||||
|
||||
int destroy_ctx(struct pingpong_context *ctx,
|
||||
struct perftest_parameters *user_param)
|
||||
int destroy_ctx(struct pingpong_context *ctx, struct perftest_parameters *user_param)
|
||||
{
|
||||
int i, first, dereg_counter;
|
||||
int test_result = 0;
|
||||
|
@ -1329,12 +1315,10 @@ int destroy_ctx(struct pingpong_context *ctx,
|
|||
return test_result;
|
||||
}
|
||||
|
||||
void ctx_set_send_wqes(struct pingpong_context *ctx,
|
||||
struct perftest_parameters *user_param,
|
||||
struct pingpong_dest *rem_dest)
|
||||
void ctx_set_send_wqes(struct pingpong_context *ctx, struct perftest_parameters *user_param,
|
||||
struct pingpong_dest *rem_dest)
|
||||
{
|
||||
ctx_set_send_reg_wqes(ctx, user_param, rem_dest);
|
||||
|
||||
}
|
||||
|
||||
int perform_warm_up(struct pingpong_context *ctx, struct perftest_parameters *user_param)
|
||||
|
@ -1369,8 +1353,8 @@ int perform_warm_up(struct pingpong_context *ctx, struct perftest_parameters *us
|
|||
}
|
||||
|
||||
do {
|
||||
ne = ibv_poll_cq(ctx->send_cq, 1, &wc);
|
||||
if (ne > 0) {
|
||||
ne = ibv_poll_cq(ctx->send_cq, 1, &wc); // read 1 WC from CQ, wc on stack.
|
||||
if (ne > 0) { // num of WCs
|
||||
if (wc.status != IBV_WC_SUCCESS) {
|
||||
return_value = FAILURE;
|
||||
goto cleaning;
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
/*
|
||||
* Copyright (c) 2009 Mellanox Technologies Ltd. All rights reserved.
|
||||
* Copyright (c) 2009 Mellanox Technologies Ltd. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
|
@ -33,19 +33,19 @@
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* This API gathres the Socket interface methods for all perftest benchmarks
|
||||
* and can be used for any benchmark for IB.
|
||||
* It passes messages between 2 end points through sockets interface methods,
|
||||
* while passing the rellevant information for the IB entities.
|
||||
* This API gathres the Socket interface methods for all perftest benchmarks
|
||||
* and can be used for any benchmark for IB.
|
||||
* It passes messages between 2 end points through sockets interface methods,
|
||||
* while passing the rellevant information for the IB entities.
|
||||
*
|
||||
* Methods :
|
||||
*
|
||||
* ctx_get_local_lid - Receives the Local id from the subnet manager.
|
||||
* ctx_client_connect - Connects the client through sockets interface.
|
||||
* ctx_server_connect - Connects the Server to client through sockets.
|
||||
* ctx_hand_shake - Passes the data between 2 end points machines.
|
||||
* ctx_print_pingpong_data - Prints the data that was passed.
|
||||
* ctx_close_connection - Closing the sockets interface.
|
||||
* ctx_get_local_lid - Receives the Local id from the subnet manager.
|
||||
* ctx_client_connect - Connects the client through sockets interface.
|
||||
* ctx_server_connect - Connects the Server to client through sockets.
|
||||
* ctx_hand_shake - Passes the data between 2 end points machines.
|
||||
* ctx_print_pingpong_data - Prints the data that was passed.
|
||||
* ctx_close_connection - Closing the sockets interface.
|
||||
*/
|
||||
|
||||
#ifndef PERFTEST_RESOURCES_WRITE_BW_H
|
||||
|
@ -67,22 +67,22 @@
|
|||
|
||||
#include "perftest_parameters_write_bw.h"
|
||||
|
||||
#define NUM_OF_RETRIES (10)
|
||||
#define NUM_OF_RETRIES (10)
|
||||
|
||||
/* Outstanding reads for "read" verb only. */
|
||||
#define MAX_SEND_SGE (1)
|
||||
#define MAX_RECV_SGE (1)
|
||||
#define CTX_POLL_BATCH (16)
|
||||
#define PL (1)
|
||||
#define ATOMIC_ADD_VALUE (1)
|
||||
#define MAX_SEND_SGE (1)
|
||||
#define MAX_RECV_SGE (1)
|
||||
#define CTX_POLL_BATCH (16)
|
||||
#define PL (1)
|
||||
#define ATOMIC_ADD_VALUE (1)
|
||||
#define ATOMIC_SWAP_VALUE (0)
|
||||
|
||||
/* Space for GRH when we scatter the packet in UD. */
|
||||
#define PINGPONG_SEND_WRID (60)
|
||||
#define PINGPONG_RDMA_WRID (3)
|
||||
#define PINGPONG_READ_WRID (1)
|
||||
#define PINGPONG_SEND_WRID (60)
|
||||
#define PINGPONG_RDMA_WRID (3)
|
||||
#define PINGPONG_READ_WRID (1)
|
||||
#define PINGPONG_ATOMIC_WRID (22)
|
||||
#define DEFF_QKEY (0x11111111)
|
||||
#define DEFF_QKEY (0x11111111)
|
||||
|
||||
#ifdef HAVE_XRCD
|
||||
#define SERVER_FD "/tmp/xrc_domain_server"
|
||||
|
@ -90,14 +90,14 @@
|
|||
#endif
|
||||
|
||||
|
||||
#define NOTIFY_COMP_ERROR_SEND(wc,scnt,ccnt) \
|
||||
{ fprintf(stderr," Completion with error at client\n"); \
|
||||
fprintf(stderr," Failed status %d: wr_id %d syndrom 0x%x\n",wc.status,(int) wc.wr_id,wc.vendor_err); \
|
||||
#define NOTIFY_COMP_ERROR_SEND(wc,scnt,ccnt) \
|
||||
{ fprintf(stderr," Completion with error at client\n"); \
|
||||
fprintf(stderr," Failed status %d: wr_id %d syndrom 0x%x\n",wc.status,(int) wc.wr_id,wc.vendor_err); \
|
||||
fprintf(stderr, "scnt=%lu, ccnt=%lu\n",scnt, ccnt); }
|
||||
|
||||
#define NOTIFY_COMP_ERROR_RECV(wc,rcnt) \
|
||||
{ fprintf(stderr," Completion with error at server\n"); \
|
||||
fprintf(stderr," Failed status %d: wr_id %d syndrom 0x%x\n",wc.status,(int) wc.wr_id,wc.vendor_err); \
|
||||
#define NOTIFY_COMP_ERROR_RECV(wc,rcnt) \
|
||||
{ fprintf(stderr," Completion with error at server\n"); \
|
||||
fprintf(stderr," Failed status %d: wr_id %d syndrom 0x%x\n",wc.status,(int) wc.wr_id,wc.vendor_err); \
|
||||
fprintf(stderr," rcnt=%lu\n",rcnt); }
|
||||
|
||||
/* Macro to determine packet size in case of UD. The UD addition is for the GRH . */
|
||||
|
@ -115,85 +115,85 @@
|
|||
/* Macro that defines the address where we write in RDMA.
|
||||
* If message size is smaller then CACHE_LINE size then we write in CACHE_LINE jumps.
|
||||
*/
|
||||
#define INC(size,cache_line_size) ((size > cache_line_size) ? ((size%cache_line_size == 0) ? \
|
||||
#define INC(size,cache_line_size) ((size > cache_line_size) ? ((size%cache_line_size == 0) ? \
|
||||
(size) : (cache_line_size*(size/cache_line_size+1))) : (cache_line_size))
|
||||
|
||||
#define UD_MSG_2_EXP(size) ((log(size))/(log(2)))
|
||||
|
||||
#define MASK_IS_SET(mask, attr) (((mask)&(attr))!=0)
|
||||
#define MASK_IS_SET(mask, attr) (((mask)&(attr))!=0)
|
||||
|
||||
/******************************************************************************
|
||||
* Perftest resources Structures and data types.
|
||||
******************************************************************************/
|
||||
|
||||
struct pingpong_context {
|
||||
// struct rdma_event_channel *cm_channel;
|
||||
// struct rdma_cm_id *cm_id_control;
|
||||
// struct rdma_cm_id *cm_id;
|
||||
struct ibv_context *context;
|
||||
struct ibv_comp_channel *channel;
|
||||
struct ibv_pd *pd;
|
||||
struct ibv_mr **mr;
|
||||
struct ibv_cq *send_cq;
|
||||
struct ibv_cq *recv_cq;
|
||||
void **buf;
|
||||
struct ibv_ah **ah;
|
||||
struct ibv_qp **qp;
|
||||
struct ibv_srq *srq;
|
||||
struct ibv_sge *sge_list;
|
||||
struct ibv_sge *recv_sge_list;
|
||||
struct ibv_send_wr *wr;
|
||||
struct ibv_recv_wr *rwr;
|
||||
uint64_t size;
|
||||
uint64_t *my_addr;
|
||||
uint64_t *rx_buffer_addr;
|
||||
uint64_t *rem_addr;
|
||||
uint64_t buff_size;
|
||||
uint64_t send_qp_buff_size;
|
||||
uint64_t flow_buff_size;
|
||||
int tx_depth;
|
||||
int huge_shmid;
|
||||
uint64_t *scnt;
|
||||
uint64_t *ccnt;
|
||||
int is_contig_supported;
|
||||
uint32_t *ctrl_buf;
|
||||
uint32_t *credit_buf;
|
||||
struct ibv_mr *credit_mr;
|
||||
struct ibv_sge *ctrl_sge_list;
|
||||
struct ibv_send_wr *ctrl_wr;
|
||||
int send_rcredit;
|
||||
int credit_cnt;
|
||||
int cache_line_size;
|
||||
int cycle_buffer;
|
||||
// struct rdma_event_channel *cm_channel;
|
||||
// struct rdma_cm_id *cm_id_control;
|
||||
// struct rdma_cm_id *cm_id;
|
||||
struct ibv_context *context;
|
||||
struct ibv_comp_channel *channel;
|
||||
struct ibv_pd *pd;
|
||||
struct ibv_mr **mr;
|
||||
struct ibv_cq *send_cq;
|
||||
struct ibv_cq *recv_cq;
|
||||
void **buf;
|
||||
struct ibv_ah **ah;
|
||||
struct ibv_qp **qp;
|
||||
struct ibv_srq *srq;
|
||||
struct ibv_sge *sge_list;
|
||||
struct ibv_sge *recv_sge_list;
|
||||
struct ibv_send_wr *wr;
|
||||
struct ibv_recv_wr *rwr;
|
||||
uint64_t size;
|
||||
uint64_t *my_addr;
|
||||
uint64_t *rx_buffer_addr;
|
||||
uint64_t *rem_addr;
|
||||
uint64_t buff_size;
|
||||
uint64_t send_qp_buff_size;
|
||||
uint64_t flow_buff_size;
|
||||
int tx_depth;
|
||||
int huge_shmid;
|
||||
uint64_t *scnt;
|
||||
uint64_t *ccnt;
|
||||
int is_contig_supported;
|
||||
uint32_t *ctrl_buf;
|
||||
uint32_t *credit_buf;
|
||||
struct ibv_mr *credit_mr;
|
||||
struct ibv_sge *ctrl_sge_list;
|
||||
struct ibv_send_wr *ctrl_wr;
|
||||
int send_rcredit;
|
||||
int credit_cnt;
|
||||
int cache_line_size;
|
||||
int cycle_buffer;
|
||||
#ifdef HAVE_XRCD
|
||||
struct ibv_xrcd *xrc_domain;
|
||||
int fd;
|
||||
struct ibv_xrcd *xrc_domain;
|
||||
int fd;
|
||||
#endif
|
||||
#ifdef HAVE_ACCL_VERBS
|
||||
struct ibv_exp_res_domain *res_domain;
|
||||
struct ibv_exp_cq_family *send_cq_family;
|
||||
struct ibv_exp_cq_family *recv_cq_family;
|
||||
struct ibv_exp_qp_burst_family **qp_burst_family;
|
||||
struct ibv_exp_res_domain *res_domain;
|
||||
struct ibv_exp_cq_family *send_cq_family;
|
||||
struct ibv_exp_cq_family *recv_cq_family;
|
||||
struct ibv_exp_qp_burst_family **qp_burst_family;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct pingpong_dest {
|
||||
int lid;
|
||||
int out_reads;
|
||||
int qpn;
|
||||
int psn;
|
||||
unsigned rkey;
|
||||
int lid;
|
||||
int out_reads;
|
||||
int qpn;
|
||||
int psn;
|
||||
unsigned rkey;
|
||||
unsigned long long vaddr;
|
||||
union ibv_gid gid;
|
||||
unsigned srqn;
|
||||
int gid_index;
|
||||
union ibv_gid gid;
|
||||
unsigned srqn;
|
||||
int gid_index;
|
||||
};
|
||||
|
||||
struct raw_ethernet_info { // !
|
||||
uint8_t mac[6];
|
||||
uint8_t mac[6];
|
||||
uint32_t ip;
|
||||
uint8_t ip6[16];
|
||||
int port;
|
||||
uint8_t ip6[16];
|
||||
int port;
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -205,10 +205,10 @@ struct raw_ethernet_info { // !
|
|||
* Description : Creating a service struct from a given port and servername.
|
||||
*
|
||||
* Parameters :
|
||||
* service - an empty char** to contain the service name.
|
||||
* port - The selected port on which the server will listen.
|
||||
* hints - The requested ai_* params for the connection.
|
||||
* res - Holds the result.
|
||||
* service - an empty char** to contain the service name.
|
||||
* port - The selected port on which the server will listen.
|
||||
* hints - The requested ai_* params for the connection.
|
||||
* res - Holds the result.
|
||||
*
|
||||
* Return Value : SUCCESS, FAILURE.
|
||||
*/
|
||||
|
@ -220,11 +220,11 @@ int check_add_port(char **service,int port,
|
|||
/* ctx_find_dev
|
||||
*
|
||||
* Description : Returns the device corresponding to ib_devname
|
||||
* or the first one found , in case ib_devname == NULL
|
||||
* or the first one found , in case ib_devname == NULL
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* ib_devname - The name of the device requested or NULL for the first one.
|
||||
* ib_devname - The name of the device requested or NULL for the first one.
|
||||
*
|
||||
* Return Value : the device or NULL in case of failure.
|
||||
*/
|
||||
|
@ -235,8 +235,8 @@ struct ibv_device* ctx_find_dev(const char *ib_devname);
|
|||
* Description : allocate all perftest resources.
|
||||
*
|
||||
* Parameters :
|
||||
* ctx - Resources sructure.
|
||||
* user_param - the perftest parameters.
|
||||
* ctx - Resources sructure.
|
||||
* user_param - the perftest parameters.
|
||||
*/
|
||||
void alloc_ctx(struct pingpong_context *ctx,struct perftest_parameters *user_param);
|
||||
|
||||
|
@ -245,8 +245,8 @@ void alloc_ctx(struct pingpong_context *ctx,struct perftest_parameters *user_par
|
|||
* Description : Deallocate all perftest resources.
|
||||
*
|
||||
* Parameters :
|
||||
* ctx - Resources sructure.
|
||||
* user_param - the perftest parameters.
|
||||
* ctx - Resources sructure.
|
||||
* user_param - the perftest parameters.
|
||||
*
|
||||
* Return Value : SUCCESS, FAILURE.
|
||||
*/
|
||||
|
@ -256,11 +256,11 @@ int destroy_ctx(struct pingpong_context *ctx,
|
|||
/* verify_params_with_device_context
|
||||
*
|
||||
* Description :
|
||||
* Verify user params that require information from the ibv_context
|
||||
* Verify user params that require information from the ibv_context
|
||||
*
|
||||
* Parameters :
|
||||
* context - ibv_context
|
||||
* user_param - the perftest parameters.
|
||||
* context - ibv_context
|
||||
* user_param - the perftest parameters.
|
||||
*
|
||||
* Return Value : SUCCESS, FAILURE.
|
||||
*/
|
||||
|
@ -271,12 +271,12 @@ int verify_params_with_device_context(struct ibv_context *ctx,
|
|||
/* ctx_init
|
||||
*
|
||||
* Description :
|
||||
* Creates all the test resources.
|
||||
* It creates Buffer, PD, MR, CQ QPs and moves the QPs to INIT.
|
||||
* Creates all the test resources.
|
||||
* It creates Buffer, PD, MR, CQ QPs and moves the QPs to INIT.
|
||||
*
|
||||
* Parameters :
|
||||
* ctx - An empty resources sructure to fill inside the resources.
|
||||
* user_param - the perftest parameters.
|
||||
* ctx - An empty resources sructure to fill inside the resources.
|
||||
* user_param - the perftest parameters.
|
||||
*
|
||||
* Return Value : SUCCESS, FAILURE.
|
||||
*/
|
||||
|
@ -286,15 +286,15 @@ int ctx_init(struct pingpong_context *ctx,struct perftest_parameters *user_param
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* Creates a QP , according to the attributes given in param.
|
||||
* The relevent attributes are tx_depth,rx_depth,inline_size and connection_type.
|
||||
* Creates a QP , according to the attributes given in param.
|
||||
* The relevent attributes are tx_depth,rx_depth,inline_size and connection_type.
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* pd - The Protection domain , each the qp will be assigned to.
|
||||
* send_cq - The CQ that will produce send CQE.
|
||||
* recv_qp - The CQ that will produce recv CQE.
|
||||
* param - The parameters for the QP.
|
||||
* pd - The Protection domain , each the qp will be assigned to.
|
||||
* send_cq - The CQ that will produce send CQE.
|
||||
* recv_qp - The CQ that will produce recv CQE.
|
||||
* param - The parameters for the QP.
|
||||
*
|
||||
* Return Value : Adress of the new QP.
|
||||
*/
|
||||
|
@ -305,13 +305,13 @@ struct ibv_qp* ctx_qp_create(struct pingpong_context *ctx,
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* Modifies the given QP to INIT state , according to attributes in param.
|
||||
* The relevent attributes are ib_port, connection_type and verb.
|
||||
* Modifies the given QP to INIT state , according to attributes in param.
|
||||
* The relevent attributes are ib_port, connection_type and verb.
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* qp - The QP that will be moved to INIT.
|
||||
* param - The parameters for the QP.
|
||||
* qp - The QP that will be moved to INIT.
|
||||
* param - The parameters for the QP.
|
||||
*
|
||||
* Return Value : SUCCESS, FAILURE.
|
||||
*
|
||||
|
@ -322,14 +322,14 @@ int ctx_modify_qp_to_init(struct ibv_qp *qp,struct perftest_parameters *user_par
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* Modifies the given QP to RTR and then RTS states, given it's transport type and feature.
|
||||
* Modifies the given QP to RTR and then RTS states, given it's transport type and feature.
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* ctx - Test Context.
|
||||
* dest - pingpong_dest struct of the remote side.
|
||||
* user_param - user_parameters struct for this test.
|
||||
* my_dest - pingpong_dest struct of this side.
|
||||
* ctx - Test Context.
|
||||
* dest - pingpong_dest struct of the remote side.
|
||||
* user_param - user_parameters struct for this test.
|
||||
* my_dest - pingpong_dest struct of this side.
|
||||
*
|
||||
* Return Value : SUCCESS, FAILURE.
|
||||
*
|
||||
|
@ -343,13 +343,13 @@ int ctx_connect(struct pingpong_context *ctx,
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* Prepare the exp send work request templates for all QPs
|
||||
* Prepare the exp send work request templates for all QPs
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
* rem_dest - pingpong_dest struct of the remote side.
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
* rem_dest - pingpong_dest struct of the remote side.
|
||||
*
|
||||
*/
|
||||
void ctx_set_send_exp_wqes(struct pingpong_context *ctx,
|
||||
|
@ -361,13 +361,13 @@ void ctx_set_send_exp_wqes(struct pingpong_context *ctx,
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* Prepare the regular send work request templates for all QPs
|
||||
* Prepare the regular send work request templates for all QPs
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
* rem_dest - pingpong_dest struct of the remote side.
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
* rem_dest - pingpong_dest struct of the remote side.
|
||||
*
|
||||
*/
|
||||
void ctx_set_send_reg_wqes(struct pingpong_context *ctx,
|
||||
|
@ -378,13 +378,13 @@ void ctx_set_send_reg_wqes(struct pingpong_context *ctx,
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* Prepare the send work request templates for all QPs
|
||||
* Prepare the send work request templates for all QPs
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
* rem_dest - pingpong_dest struct of the remote side.
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
* rem_dest - pingpong_dest struct of the remote side.
|
||||
*
|
||||
*/
|
||||
void ctx_set_send_wqes(struct pingpong_context *ctx,
|
||||
|
@ -396,12 +396,12 @@ void ctx_set_send_wqes(struct pingpong_context *ctx,
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* Prepare the receives work request templates for all QPs in SEND receive test.
|
||||
* Prepare the receives work request templates for all QPs in SEND receive test.
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
*
|
||||
*/
|
||||
int ctx_set_recv_wqes(struct pingpong_context *ctx,struct perftest_parameters *user_param);
|
||||
|
@ -410,18 +410,18 @@ int ctx_set_recv_wqes(struct pingpong_context *ctx,struct perftest_parameters *u
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* Allocate resources to support the credit exchange mechanism,
|
||||
* which allows ib_send_bw to work with iWARP
|
||||
* Allocate resources to support the credit exchange mechanism,
|
||||
* which allows ib_send_bw to work with iWARP
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* ctx - test context
|
||||
* user_param - user parameters struct for this test
|
||||
* my_dest - pingpong_dest struct of the this side
|
||||
* ctx - test context
|
||||
* user_param - user parameters struct for this test
|
||||
* my_dest - pingpong_dest struct of the this side
|
||||
*
|
||||
* my_dest is updated to store the credit buf vaddr and rkey
|
||||
* which need to be exchanged with the remote side
|
||||
* to enable RDMA WRITE op
|
||||
* my_dest is updated to store the credit buf vaddr and rkey
|
||||
* which need to be exchanged with the remote side
|
||||
* to enable RDMA WRITE op
|
||||
*/
|
||||
int ctx_alloc_credit(struct pingpong_context *ctx,
|
||||
struct perftest_parameters *user_param,
|
||||
|
@ -430,15 +430,15 @@ int ctx_alloc_credit(struct pingpong_context *ctx,
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* Prepare the send credit work request templates for all QPs
|
||||
* RDMA WRITE op is used for sending credit
|
||||
* Credit exchange is necessary for ib_send_bw to work with iWARP
|
||||
* Prepare the send credit work request templates for all QPs
|
||||
* RDMA WRITE op is used for sending credit
|
||||
* Credit exchange is necessary for ib_send_bw to work with iWARP
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* ctx - test context
|
||||
* user_param - user parameters struct for this test
|
||||
* rem_dest - pingpong_dest struct of the remote side.
|
||||
* ctx - test context
|
||||
* user_param - user parameters struct for this test
|
||||
* rem_dest - pingpong_dest struct of the remote side.
|
||||
*/
|
||||
int ctx_set_credit_wqes(struct pingpong_context *ctx,
|
||||
struct perftest_parameters *user_param,
|
||||
|
@ -447,12 +447,12 @@ int ctx_set_credit_wqes(struct pingpong_context *ctx,
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* The main testing method in BW tests.
|
||||
* The main testing method in BW tests.
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
*
|
||||
*/
|
||||
int run_iter_bw(struct pingpong_context *ctx,struct perftest_parameters *user_param);
|
||||
|
@ -461,12 +461,12 @@ int run_iter_bw(struct pingpong_context *ctx,struct perftest_parameters *user_pa
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* Infinite BW method, that prints BW every 5 seconds and never stops.
|
||||
* Infinite BW method, that prints BW every 5 seconds and never stops.
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
*
|
||||
*/
|
||||
// int run_iter_bw_infinitely(struct pingpong_context *ctx,struct perftest_parameters *user_param);
|
||||
|
@ -475,12 +475,12 @@ int run_iter_bw(struct pingpong_context *ctx,struct perftest_parameters *user_pa
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* Infinite on SEND server BW method, will not print anything and will post receive wqes for each incoming packet.
|
||||
* Infinite on SEND server BW method, will not print anything and will post receive wqes for each incoming packet.
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
*
|
||||
*/
|
||||
int run_iter_bw_infinitely_server(struct pingpong_context *ctx, struct perftest_parameters *user_param);
|
||||
|
@ -489,12 +489,12 @@ int run_iter_bw_infinitely_server(struct pingpong_context *ctx, struct perftest_
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* The main testing method for Receiver in SEND test.
|
||||
* The main testing method for Receiver in SEND test.
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
*
|
||||
*/
|
||||
int run_iter_bw_server(struct pingpong_context *ctx, struct perftest_parameters *user_param);
|
||||
|
@ -503,12 +503,12 @@ int run_iter_bw_server(struct pingpong_context *ctx, struct perftest_parameters
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* The main testing method for bidirrectional.
|
||||
* The main testing method for bidirrectional.
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
*
|
||||
*/
|
||||
int run_iter_bi(struct pingpong_context *ctx,struct perftest_parameters *user_param);
|
||||
|
@ -517,12 +517,12 @@ int run_iter_bi(struct pingpong_context *ctx,struct perftest_parameters *user_pa
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* This is the latency test function for WRITE verb.
|
||||
* This is the latency test function for WRITE verb.
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
*/
|
||||
int run_iter_lat_write(struct pingpong_context *ctx,struct perftest_parameters *user_param);
|
||||
|
||||
|
@ -530,12 +530,12 @@ int run_iter_lat_write(struct pingpong_context *ctx,struct perftest_parameters *
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* This is the latency test function for READ or ATOMIC verb latency tests.
|
||||
* This is the latency test function for READ or ATOMIC verb latency tests.
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
*/
|
||||
int run_iter_lat(struct pingpong_context *ctx,struct perftest_parameters *user_param);
|
||||
|
||||
|
@ -543,12 +543,12 @@ int run_iter_lat(struct pingpong_context *ctx,struct perftest_parameters *user_p
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* This is the latency test function for SEND verb latency test.
|
||||
* This is the latency test function for SEND verb latency test.
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
*/
|
||||
int run_iter_lat_send(struct pingpong_context *ctx, struct perftest_parameters *user_param);
|
||||
|
||||
|
@ -556,12 +556,12 @@ int run_iter_lat_send(struct pingpong_context *ctx, struct perftest_parameters *
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* This is the latency test function for SEND verb latency test in burst mode
|
||||
* This is the latency test function for SEND verb latency test in burst mode
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
*/
|
||||
|
||||
int run_iter_lat_burst(struct pingpong_context *ctx, struct perftest_parameters *user_param);
|
||||
|
@ -570,12 +570,12 @@ int run_iter_lat_burst(struct pingpong_context *ctx, struct perftest_parameters
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* This is the latency test function for server side latency test in burst mode
|
||||
* This is the latency test function for server side latency test in burst mode
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
*/
|
||||
|
||||
int run_iter_lat_burst_server(struct pingpong_context *ctx, struct perftest_parameters *user_param);
|
||||
|
@ -584,13 +584,13 @@ int run_iter_lat_burst_server(struct pingpong_context *ctx, struct perftest_para
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* This method find and returns the local Id in IB subnet manager of
|
||||
* the selected port and HCA given.The lid identifies the port.
|
||||
* This method find and returns the local Id in IB subnet manager of
|
||||
* the selected port and HCA given.The lid identifies the port.
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* context - the context of the HCA device.
|
||||
* ib_port - The port of the HCA (1 or 2).
|
||||
* context - the context of the HCA device.
|
||||
* ib_port - The port of the HCA (1 or 2).
|
||||
*
|
||||
* Return Value : The Lid itself. (No error values).
|
||||
*/
|
||||
|
@ -599,18 +599,18 @@ uint16_t ctx_get_local_lid(struct ibv_context *context, int ib_port);
|
|||
/* ctx_notify_events
|
||||
*
|
||||
* Description : Prepare the test to work with events instead of polling the CQ.
|
||||
* This is the way to work in un interipted mode.
|
||||
* This is the way to work in un interipted mode.
|
||||
*
|
||||
* Parameters :
|
||||
* channel - (Mandotory) the created event channel.
|
||||
* channel - (Mandotory) the created event channel.
|
||||
*
|
||||
* Return Value : SUCCESS, FAILURE.
|
||||
*/
|
||||
static __inline int ctx_notify_events(struct ibv_comp_channel *channel)
|
||||
{
|
||||
|
||||
struct ibv_cq *ev_cq;
|
||||
void *ev_ctx;
|
||||
struct ibv_cq *ev_cq;
|
||||
void *ev_ctx;
|
||||
|
||||
if (ibv_get_cq_event(channel,&ev_cq,&ev_ctx)) {
|
||||
fprintf(stderr, "Failed to get cq_event\n");
|
||||
|
@ -666,20 +666,20 @@ static __inline void increase_rem_addr(struct ibv_send_wr *wr,int size,uint64_t
|
|||
/* increase_loc_addr.
|
||||
*
|
||||
* Description :
|
||||
* Increases the local address in all verbs ,
|
||||
* (at least 64 CACHE_LINE size) , so that the system will be a able to cahce the data
|
||||
* in an orginzed way.
|
||||
* Increases the local address in all verbs ,
|
||||
* (at least 64 CACHE_LINE size) , so that the system will be a able to cahce the data
|
||||
* in an orginzed way.
|
||||
*
|
||||
* Parameters :
|
||||
* sg - The scatter element of the wqe.
|
||||
* size - size of the message to send.
|
||||
* rcnt - The ammount of post_send or post_receive we called.
|
||||
* prim_addr - The address of the original buffer.
|
||||
* server_is_ud - Indication to weather we are in UD mode.
|
||||
* sg - The scatter element of the wqe.
|
||||
* size - size of the message to send.
|
||||
* rcnt - The ammount of post_send or post_receive we called.
|
||||
* prim_addr - The address of the original buffer.
|
||||
* server_is_ud - Indication to weather we are in UD mode.
|
||||
*/
|
||||
static __inline void increase_loc_addr(struct ibv_sge *sg,int size,uint64_t rcnt,uint64_t prim_addr,int server_is_ud, int cache_line_size, int cycle_buffer)
|
||||
{
|
||||
sg->addr += INC(size,cache_line_size);
|
||||
sg->addr += INC(size,cache_line_size);
|
||||
|
||||
if ( ((rcnt+1) % (cycle_buffer/ INC(size,cache_line_size))) == 0 )
|
||||
sg->addr = prim_addr;
|
||||
|
@ -689,10 +689,10 @@ static __inline void increase_loc_addr(struct ibv_sge *sg,int size,uint64_t rcnt
|
|||
/* catch_alarm.
|
||||
*
|
||||
* Description :
|
||||
* Signal catcher for duration feature.
|
||||
* run_iter_bw in start will set it to triger at MARGIN (parameter), it will then start counting packets
|
||||
* and triger it back to SAMPLE TIME, in that time the test will count packets and completion and
|
||||
* will calculate BW accordingley.
|
||||
* Signal catcher for duration feature.
|
||||
* run_iter_bw in start will set it to triger at MARGIN (parameter), it will then start counting packets
|
||||
* and triger it back to SAMPLE TIME, in that time the test will count packets and completion and
|
||||
* will calculate BW accordingley.
|
||||
*
|
||||
*/
|
||||
void catch_alarm(int sig);
|
||||
|
@ -702,8 +702,8 @@ void check_alive(int sig);
|
|||
/* catch_alarm.
|
||||
*
|
||||
* Description :
|
||||
* Signal catcher for run_infinitely feature.
|
||||
* Will be triggered every 5 sec and measure BW in this time frame.
|
||||
* Signal catcher for run_infinitely feature.
|
||||
* Will be triggered every 5 sec and measure BW in this time frame.
|
||||
*
|
||||
*/
|
||||
void catch_alarm_infintely();
|
||||
|
@ -711,7 +711,7 @@ void catch_alarm_infintely();
|
|||
/* handle_signal_print_thread
|
||||
*
|
||||
* Description :
|
||||
* Handle thread creation for signal catching in run_infinitely mode
|
||||
* Handle thread creation for signal catching in run_infinitely mode
|
||||
*
|
||||
*/
|
||||
void *handle_signal_print_thread(void *sig_mask);
|
||||
|
@ -720,13 +720,13 @@ void *handle_signal_print_thread(void *sig_mask);
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* Modifies the given QP to INIT state , according to attributes in param.
|
||||
* The relevent attributes are ib_port, connection_type and verb.
|
||||
* Modifies the given QP to INIT state , according to attributes in param.
|
||||
* The relevent attributes are ib_port, connection_type and verb.
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* qp - The QP that will be moved to INIT.
|
||||
* param - The parameters for the QP.
|
||||
* qp - The QP that will be moved to INIT.
|
||||
* param - The parameters for the QP.
|
||||
*
|
||||
* Return Value : SUCCESS, FAILURE.
|
||||
*
|
||||
|
@ -774,12 +774,12 @@ int modify_qp_to_init(struct pingpong_context *ctx,
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* Creates a single MR for a specific QP index.
|
||||
* Creates a single MR for a specific QP index.
|
||||
*
|
||||
* Parameters :
|
||||
* ctx - Resources sructure.
|
||||
* user_param - the perftest parameters.
|
||||
* qp_index - QP index to register a MR
|
||||
* Parameters :
|
||||
* ctx - Resources sructure.
|
||||
* user_param - the perftest parameters.
|
||||
* qp_index - QP index to register a MR
|
||||
*
|
||||
* Return Value : SUCCESS, FAILURE.
|
||||
*
|
||||
|
@ -791,12 +791,12 @@ int create_single_mr(struct pingpong_context *ctx,
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* Creates Memory Regions for the test.
|
||||
* Takes into consideration all user parameters and test type.
|
||||
* Creates Memory Regions for the test.
|
||||
* Takes into consideration all user parameters and test type.
|
||||
*
|
||||
* Parameters :
|
||||
* ctx - Resources sructure.
|
||||
* user_param - the perftest parameters.
|
||||
* Parameters :
|
||||
* ctx - Resources sructure.
|
||||
* user_param - the perftest parameters.
|
||||
*
|
||||
* Return Value : SUCCESS, FAILURE.
|
||||
*
|
||||
|
@ -808,10 +808,10 @@ int create_mr(struct pingpong_context *ctx,
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* Creates hugepage memory Regions for the test.
|
||||
* Creates hugepage memory Regions for the test.
|
||||
*
|
||||
* Parameters :
|
||||
* ctx - Resources sructure.
|
||||
* Parameters :
|
||||
* ctx - Resources sructure.
|
||||
*
|
||||
* Return Value : SUCCESS, FAILURE.
|
||||
*
|
||||
|
@ -822,12 +822,12 @@ int alloc_hugepage_region (struct pingpong_context *ctx);
|
|||
*
|
||||
* Description :
|
||||
*
|
||||
* The main testing method for Flow steering creation
|
||||
* The main testing method for Flow steering creation
|
||||
*
|
||||
* Parameters :
|
||||
*
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
* ctx - Test Context.
|
||||
* user_param - user_parameters struct for this test.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue