Skip to content

Commit

Permalink
Fixed freebsd compilation warnings
Browse files Browse the repository at this point in the history
Description: fixing some redefines and using deprecated functions.

Signed-off-by: Dmitry Akhmedzhanov <[email protected]>
  • Loading branch information
Dmitry Akhmedzhanov authored and Simon Raviv committed Sep 6, 2018
1 parent 577055a commit 6afe3b9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/multicast_resources.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

/******************************************************************************
Expand Down
8 changes: 0 additions & 8 deletions src/multicast_resources.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)) )

Expand Down
4 changes: 3 additions & 1 deletion src/perftest_resources.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@

#include "perftest_resources.h"
#include "raw_ethernet_resources.h"
#include "config.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#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};
Expand Down
7 changes: 4 additions & 3 deletions src/raw_ethernet_resources.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#if defined(__FreeBSD__)
#include <sys/types.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#endif

#include <stdio.h>
Expand All @@ -45,14 +44,16 @@
#include <signal.h>
#include <getopt.h>
#include <unistd.h>
#include </usr/include/netinet/ip.h>
#include <netinet/ip.h>
#include <poll.h>
#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 <config.h>
#endif

struct perftest_parameters* duration_param;

Expand Down
5 changes: 3 additions & 2 deletions src/raw_ethernet_resources.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@
#if defined(__FreeBSD__)
#include <sys/types.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#endif

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <getopt.h>
#include </usr/include/netinet/ip.h>
#include <netinet/ip.h>
#include <poll.h>
#include "perftest_parameters.h"
#include "perftest_resources.h"
#include "multicast_resources.h"
#include "perftest_communication.h"

#undef __LITTLE_ENDIAN
#if defined(__FreeBSD__)
#include <infiniband/byteorder.h>
#else
Expand Down

0 comments on commit 6afe3b9

Please sign in to comment.