diff --git a/src/multicast_resources.c b/src/multicast_resources.c index 3a8edbab..37ca6d7a 100755 --- a/src/multicast_resources.c +++ b/src/multicast_resources.c @@ -63,7 +63,7 @@ static void prepare_mcast_mad(uint8_t method, ptr[1] = MANAGMENT_CLASS_SUBN_ADM; /* MgmtClass */ ptr[2] = 0x02; /* ClassVersion */ ptr[3] = INSERTF(ptr[3], 0, method, 0, 7); /* Method */ - (*(uint64_t *)(ptr + 8)) = htonll((uint64_t)DEF_TRANS_ID); /* TransactionID */ + (*(uint64_t *)(ptr + 8)) = htobe64((uint64_t)DEF_TRANS_ID); /* TransactionID */ (*(uint16_t *)(ptr + 16)) = htons(SUBN_ADM_ATTR_MC_MEMBER_RECORD); /* AttributeID */ ptr = samad_packet->SubnetAdminData; @@ -84,7 +84,7 @@ static void prepare_mcast_mad(uint8_t method, SUBN_ADM_COMPMASK_P_KEY | SUBN_ADM_COMPMASK_TCLASS | SUBN_ADM_COMPMASK_SL | SUBN_ADM_COMPMASK_FLOW_LABEL | SUBN_ADM_COMPMASK_JOIN_STATE; - samad_packet->ComponentMask = htonll(comp_mask); + samad_packet->ComponentMask = htobe64(comp_mask); } /****************************************************************************** diff --git a/src/multicast_resources.h b/src/multicast_resources.h index 1e879b97..657709ca 100644 --- a/src/multicast_resources.h +++ b/src/multicast_resources.h @@ -79,14 +79,6 @@ #define DEF_TCLASS 0 #define DEF_FLOW_LABLE 0 -/* Macro for 64 bit variables to switch to from net */ -#ifndef ntohll -#define ntohll(x) (((uint64_t)(ntohl((int)((x << 32) >> 32))) << 32) | (unsigned int)ntohl(((int)(x >> 32)))) -#endif -#ifndef htonll -#define htonll(x) ntohll(x) -#endif - /* generate a bit mask S bits width */ #define MASK32(S) ( ((uint32_t) ~0L) >> (32-(S)) ) diff --git a/src/perftest_resources.c b/src/perftest_resources.c index f3a16059..7043ab67 100755 --- a/src/perftest_resources.c +++ b/src/perftest_resources.c @@ -21,7 +21,9 @@ #include "perftest_resources.h" #include "raw_ethernet_resources.h" -#include "config.h" +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef HAVE_VERBS_EXP static enum ibv_exp_wr_opcode exp_opcode_verbs_array[] = {IBV_EXP_WR_SEND,IBV_EXP_WR_RDMA_WRITE,IBV_EXP_WR_RDMA_READ}; diff --git a/src/raw_ethernet_resources.c b/src/raw_ethernet_resources.c index 764be48b..9b54bee8 100755 --- a/src/raw_ethernet_resources.c +++ b/src/raw_ethernet_resources.c @@ -36,7 +36,6 @@ #if defined(__FreeBSD__) #include #include -#include #endif #include @@ -45,14 +44,16 @@ #include #include #include -#include +#include #include #include "perftest_parameters.h" #include "perftest_resources.h" #include "multicast_resources.h" #include "perftest_communication.h" #include "raw_ethernet_resources.h" -#include "config.h" +#ifdef HAVE_CONFIG_H +#include +#endif struct perftest_parameters* duration_param; diff --git a/src/raw_ethernet_resources.h b/src/raw_ethernet_resources.h index 1afd076b..eeb7acc4 100755 --- a/src/raw_ethernet_resources.h +++ b/src/raw_ethernet_resources.h @@ -5,7 +5,6 @@ #if defined(__FreeBSD__) #include #include -#include #endif #include @@ -13,12 +12,14 @@ #include #include #include -#include +#include #include #include "perftest_parameters.h" #include "perftest_resources.h" #include "multicast_resources.h" #include "perftest_communication.h" + +#undef __LITTLE_ENDIAN #if defined(__FreeBSD__) #include #else