#include <iba/ib_al.h>
#define KEY_MSG_SIZE (sizeof "0000:000000:000000:00000000:0000000000000000")
-#define KEY_PRINT_FMT "%04x:%06x:%06x:%08x:%x"
+#define KEY_PRINT_FMT "%04x:%06x:%06x:%08x:%016I64x"
#define KEY_SCAN_FMT "%x:%x:%x:%x:%x"
#define VERSION 2.0
{
char msg[KEY_MSG_SIZE];
PERF_ENTER;
- sprintf(msg, KEY_PRINT_FMT,my_dest->lid, my_dest->qpn,
- my_dest->psn, my_dest->rkey, my_dest->vaddr);
+ sprintf(msg, KEY_PRINT_FMT,cl_hton16(my_dest->lid), cl_hton32(my_dest->qpn),
+ cl_hton32(my_dest->psn), cl_hton32(my_dest->rkey), my_dest->vaddr);
if (send(sockfd, msg, sizeof msg,0) != sizeof msg) {
perror("pp_write_keys");
return -1;
}
- parsed = sscanf(msg, KEY_SCAN_FMT, &rem_dest->lid, &rem_dest->qpn,
+ parsed = sscanf(msg, KEY_PRINT_FMT, &rem_dest->lid, &rem_dest->qpn,
&rem_dest->psn,&rem_dest->rkey, &rem_dest->vaddr);
+ rem_dest->lid = cl_ntoh16(rem_dest->lid);
+ rem_dest->qpn = cl_ntoh32(rem_dest->qpn);
+ rem_dest->psn = cl_ntoh32(rem_dest->psn);
+ rem_dest->rkey = cl_ntoh32(rem_dest->rkey);
if (parsed != 5) {
fprintf(stderr, "Couldn't parse line <%.*s > parsed = %d %s\n",
* We do it by exchanging data over a TCP socket connection. */
my_dest[i].lid = ctx->ca_attr->p_port_attr[ib_port-1].lid;
- my_dest[i].psn = rand() & 0xffffff;
+ my_dest[i].psn = cl_hton32(rand() & 0xffffff);
if (!my_dest[i].lid) {
fprintf(stderr, "Local lid 0x0 detected. Is an SM running?\n");
return 1;
* We do it by exchanging data over a TCP socket connection. */
my_dest[i].lid = ctx->ca_attr->p_port_attr[ib_port-1].lid;
- my_dest[i].psn = rand() & 0xffffff;
+ my_dest[i].psn = cl_hton32(rand() & 0xffffff);
if (!my_dest[i].lid) {
fprintf(stderr, "Local lid 0x0 detected. Is an SM running?\n");
return 1;
* We do it by exchanging data over a TCP socket connection. */
my_dest[i].lid = ctx->ca_attr->p_port_attr[ib_port-1].lid;
- my_dest[i].psn = rand() & 0xffffff;
+ my_dest[i].psn = cl_hton32(rand() & 0xffffff);
if (!my_dest[i].lid) {
fprintf(stderr, "Local lid 0x0 detected. Is an SM running?\n");
return 1;
/*********************************************
* Important note :
* In case of UD/UC this is NOT the way to measure
- * BW sicen we are running with loop on the send side
- * while we should run on the recieve side or enable retry in SW
+ * BW since we are running with loop on the send side
+ * while we should run on the receive side or enable retry in SW
* Since the sender may be faster than the reciver than although
* we had posted recieve it is not enough and might end this will
* result in deadlock of test since both sides are stuck on poll cq
* In this test i do not solve this for the general test ,need to write
- * seperate test for UC/UD but in case the tx_depth is ~1/3 from the
+ * separate test for UC/UD but in case the tx_depth is ~1/3 from the
* number of iterations this should be ok .
* Also note that the sender is limited in the number of send, ans
- * i try to make the reciver full
+ * i try to make the receiver full
*********************************************/
/* send */
if (user_param->connection_type==UD) {
* We do it by exchanging data over a TCP socket connection. */
my_dest[i].lid = ctx->ca_attr->p_port_attr[ib_port-1].lid;
- my_dest[i].psn = rand() & 0xffffff;
+ my_dest[i].psn = cl_hton32(rand() & 0xffffff);
if (!my_dest[i].lid) {
fprintf(stderr, "Local lid 0x0 detected. Is an SM running?\n");
return 1;
* We do it by exchanging data over a TCP socket connection. */
my_dest[i].lid = ctx->ca_attr->p_port_attr[ib_port-1].lid;
- my_dest[i].psn = rand() & 0xffffff;
+ my_dest[i].psn = cl_hton32(rand() & 0xffffff);
if (!my_dest[i].lid) {
fprintf(stderr, "Local lid 0x0 detected. Is an SM running?\n");
return 1;
* We do it by exchanging data over a TCP socket connection. */
my_dest[i].lid = ctx->ca_attr->p_port_attr[ib_port-1].lid;
- my_dest[i].psn = rand() & 0xffffff;
+ my_dest[i].psn = cl_hton32(rand() & 0xffffff);
if (!my_dest[i].lid) {
fprintf(stderr, "Local lid 0x0 detected. Is an SM running?\n");
return 1;