Skip to content

Commit

Permalink
Ran clang-format on include
Browse files Browse the repository at this point in the history
Signed-off-by: Seth Zegelstein <szegel@amazon.com>
  • Loading branch information
a-szegel committed Mar 2, 2023
1 parent 01486d4 commit 3441cad
Show file tree
Hide file tree
Showing 75 changed files with 5,953 additions and 5,792 deletions.
4 changes: 2 additions & 2 deletions include/fasthash.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ extern "C" {
* @len: data size
* @seed: the seed
*/
uint32_t fasthash32(const void *buf, size_t len, uint32_t seed);
uint32_t fasthash32(const void *buf, size_t len, uint32_t seed);

/**
* fasthash64 - 64-bit implementation of fasthash
* @buf: data buffer
* @len: data size
* @seed: the seed
*/
uint64_t fasthash64(const void *buf, size_t len, uint64_t seed);
uint64_t fasthash64(const void *buf, size_t len, uint64_t seed);

#ifdef __cplusplus
}
Expand Down
95 changes: 47 additions & 48 deletions include/freebsd/osd.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@
#define bswap_64 bswap64

#define ENODATA ENOMSG
#define HOST_NAME_MAX 128
#define HOST_NAME_MAX 128
#define SOL_TCP IPPROTO_TCP

typedef cpuset_t cpu_set_t;

static inline int ofi_shm_remap(struct util_shm *shm, size_t newsize, void **mapped)
static inline int ofi_shm_remap(struct util_shm *shm, size_t newsize,
void **mapped)
{
return -1;
}
Expand All @@ -71,22 +72,18 @@ static inline size_t ofi_ifaddr_get_speed(struct ifaddrs *ifa)
return 0;
}

static inline ssize_t ofi_process_vm_readv(pid_t pid,
const struct iovec *local_iov,
unsigned long liovcnt,
const struct iovec *remote_iov,
unsigned long riovcnt,
unsigned long flags)
static inline ssize_t
ofi_process_vm_readv(pid_t pid, const struct iovec *local_iov,
unsigned long liovcnt, const struct iovec *remote_iov,
unsigned long riovcnt, unsigned long flags)
{
return -FI_ENOSYS;
}

static inline size_t ofi_process_vm_writev(pid_t pid,
const struct iovec *local_iov,
unsigned long liovcnt,
const struct iovec *remote_iov,
unsigned long riovcnt,
unsigned long flags)
static inline size_t
ofi_process_vm_writev(pid_t pid, const struct iovec *local_iov,
unsigned long liovcnt, const struct iovec *remote_iov,
unsigned long riovcnt, unsigned long flags)
{
return -FI_ENOSYS;
}
Expand All @@ -107,8 +104,9 @@ static inline ssize_t ofi_recv_socket(SOCKET fd, void *buf, size_t count,
return recv(fd, buf, count, flags);
}

static inline ssize_t ofi_recvfrom_socket(SOCKET fd, void *buf, size_t count, int flags,
struct sockaddr *from, socklen_t *fromlen)
static inline ssize_t ofi_recvfrom_socket(SOCKET fd, void *buf, size_t count,
int flags, struct sockaddr *from,
socklen_t *fromlen)
{
return recvfrom(fd, buf, count, flags, from, fromlen);
}
Expand All @@ -119,66 +117,67 @@ static inline ssize_t ofi_send_socket(SOCKET fd, const void *buf, size_t count,
return send(fd, buf, count, flags);
}

static inline ssize_t ofi_sendto_socket(SOCKET fd, const void *buf, size_t count, int flags,
const struct sockaddr *to, socklen_t tolen)
static inline ssize_t ofi_sendto_socket(SOCKET fd, const void *buf,
size_t count, int flags,
const struct sockaddr *to,
socklen_t tolen)
{
return sendto(fd, buf, count, flags, to, tolen);
}

static inline ssize_t ofi_writev_socket(SOCKET fd, struct iovec *iov, size_t iov_cnt)
static inline ssize_t ofi_writev_socket(SOCKET fd, struct iovec *iov,
size_t iov_cnt)
{
return writev(fd, iov, iov_cnt);
}

static inline ssize_t ofi_readv_socket(SOCKET fd, struct iovec *iov, int iov_cnt)
static inline ssize_t ofi_readv_socket(SOCKET fd, struct iovec *iov,
int iov_cnt)
{
return readv(fd, iov, iov_cnt);
}

static inline ssize_t
ofi_sendmsg_tcp(SOCKET fd, const struct msghdr *msg, int flags)
static inline ssize_t ofi_sendmsg_tcp(SOCKET fd, const struct msghdr *msg,
int flags)
{
return sendmsg(fd, msg, flags);
}

static inline ssize_t
ofi_recvmsg_tcp(SOCKET fd, struct msghdr *msg, int flags)
static inline ssize_t ofi_recvmsg_tcp(SOCKET fd, struct msghdr *msg, int flags)
{
return recvmsg(fd, msg, flags);
}

static inline ssize_t
ofi_sendv_socket(SOCKET fd, const struct iovec *iov, size_t cnt, int flags)
static inline ssize_t ofi_sendv_socket(SOCKET fd, const struct iovec *iov,
size_t cnt, int flags)
{
struct msghdr msg;
struct msghdr msg;

msg.msg_control = NULL;
msg.msg_controllen = 0;
msg.msg_flags = 0;
msg.msg_name = NULL;
msg.msg_namelen = 0;
msg.msg_iov = (struct iovec *) iov;
msg.msg_iovlen = cnt;
msg.msg_control = NULL;
msg.msg_controllen = 0;
msg.msg_flags = 0;
msg.msg_name = NULL;
msg.msg_namelen = 0;
msg.msg_iov = (struct iovec *)iov;
msg.msg_iovlen = cnt;

return ofi_sendmsg_tcp(fd, &msg, flags);
return ofi_sendmsg_tcp(fd, &msg, flags);
}

static inline ssize_t
ofi_recvv_socket(SOCKET fd, const struct iovec *iov, size_t cnt, int flags)
static inline ssize_t ofi_recvv_socket(SOCKET fd, const struct iovec *iov,
size_t cnt, int flags)
{
struct msghdr msg;
struct msghdr msg;

msg.msg_control = NULL;
msg.msg_controllen = 0;
msg.msg_flags = 0;
msg.msg_name = NULL;
msg.msg_namelen = 0;
msg.msg_iov = (struct iovec *) iov;
msg.msg_iovlen = cnt;
msg.msg_control = NULL;
msg.msg_controllen = 0;
msg.msg_flags = 0;
msg.msg_name = NULL;
msg.msg_namelen = 0;
msg.msg_iov = (struct iovec *)iov;
msg.msg_iovlen = cnt;

return ofi_recvmsg_tcp(fd, &msg, flags);
return ofi_recvmsg_tcp(fd, &msg, flags);
}

#endif /* _FREEBSD_OSD_H_ */


97 changes: 48 additions & 49 deletions include/linux/osd.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@
#include "unix/osd.h"
#include "rdma/fi_errno.h"


static inline int ofi_shm_remap(struct util_shm *shm,
size_t newsize, void **mapped)
static inline int ofi_shm_remap(struct util_shm *shm, size_t newsize,
void **mapped)
{
shm->ptr = mremap(shm->ptr, shm->size, newsize, 0);
shm->size = newsize;
Expand Down Expand Up @@ -92,30 +91,26 @@ static inline int ofi_hugepage_enabled(void)
size_t ofi_ifaddr_get_speed(struct ifaddrs *ifa);

#ifndef __NR_process_vm_readv
# define __NR_process_vm_readv 310
#define __NR_process_vm_readv 310
#endif

#ifndef __NR_process_vm_writev
# define __NR_process_vm_writev 311
#define __NR_process_vm_writev 311
#endif

static inline ssize_t ofi_process_vm_readv(pid_t pid,
const struct iovec *local_iov,
unsigned long liovcnt,
const struct iovec *remote_iov,
unsigned long riovcnt,
unsigned long flags)
static inline ssize_t
ofi_process_vm_readv(pid_t pid, const struct iovec *local_iov,
unsigned long liovcnt, const struct iovec *remote_iov,
unsigned long riovcnt, unsigned long flags)
{
return syscall(__NR_process_vm_readv, pid, local_iov, liovcnt,
remote_iov, riovcnt, flags);
}

static inline size_t ofi_process_vm_writev(pid_t pid,
const struct iovec *local_iov,
unsigned long liovcnt,
const struct iovec *remote_iov,
unsigned long riovcnt,
unsigned long flags)
static inline size_t
ofi_process_vm_writev(pid_t pid, const struct iovec *local_iov,
unsigned long liovcnt, const struct iovec *remote_iov,
unsigned long riovcnt, unsigned long flags)
{
return syscall(__NR_process_vm_writev, pid, local_iov, liovcnt,
remote_iov, riovcnt, flags);
Expand All @@ -137,8 +132,9 @@ static inline ssize_t ofi_recv_socket(SOCKET fd, void *buf, size_t count,
return recv(fd, buf, count, flags);
}

static inline ssize_t ofi_recvfrom_socket(SOCKET fd, void *buf, size_t count, int flags,
struct sockaddr *from, socklen_t *fromlen)
static inline ssize_t ofi_recvfrom_socket(SOCKET fd, void *buf, size_t count,
int flags, struct sockaddr *from,
socklen_t *fromlen)
{
return recvfrom(fd, buf, count, flags, from, fromlen);
}
Expand All @@ -149,64 +145,67 @@ static inline ssize_t ofi_send_socket(SOCKET fd, const void *buf, size_t count,
return send(fd, buf, count, flags);
}

static inline ssize_t ofi_sendto_socket(SOCKET fd, const void *buf, size_t count, int flags,
const struct sockaddr *to, socklen_t tolen)
static inline ssize_t ofi_sendto_socket(SOCKET fd, const void *buf,
size_t count, int flags,
const struct sockaddr *to,
socklen_t tolen)
{
return sendto(fd, buf, count, flags, to, tolen);
}

static inline ssize_t ofi_writev_socket(SOCKET fd, struct iovec *iov, size_t iov_cnt)
static inline ssize_t ofi_writev_socket(SOCKET fd, struct iovec *iov,
size_t iov_cnt)
{
return writev(fd, iov, iov_cnt);
}

static inline ssize_t ofi_readv_socket(SOCKET fd, struct iovec *iov, int iov_cnt)
static inline ssize_t ofi_readv_socket(SOCKET fd, struct iovec *iov,
int iov_cnt)
{
return readv(fd, iov, iov_cnt);
}

static inline ssize_t
ofi_sendmsg_tcp(SOCKET fd, const struct msghdr *msg, int flags)
static inline ssize_t ofi_sendmsg_tcp(SOCKET fd, const struct msghdr *msg,
int flags)
{
return sendmsg(fd, msg, flags);
}

static inline ssize_t
ofi_recvmsg_tcp(SOCKET fd, struct msghdr *msg, int flags)
static inline ssize_t ofi_recvmsg_tcp(SOCKET fd, struct msghdr *msg, int flags)
{
return recvmsg(fd, msg, flags);
}

static inline ssize_t
ofi_sendv_socket(SOCKET fd, const struct iovec *iov, size_t cnt, int flags)
static inline ssize_t ofi_sendv_socket(SOCKET fd, const struct iovec *iov,
size_t cnt, int flags)
{
struct msghdr msg;
struct msghdr msg;

msg.msg_control = NULL;
msg.msg_controllen = 0;
msg.msg_flags = 0;
msg.msg_name = NULL;
msg.msg_namelen = 0;
msg.msg_iov = (struct iovec *) iov;
msg.msg_iovlen = cnt;
msg.msg_control = NULL;
msg.msg_controllen = 0;
msg.msg_flags = 0;
msg.msg_name = NULL;
msg.msg_namelen = 0;
msg.msg_iov = (struct iovec *)iov;
msg.msg_iovlen = cnt;

return ofi_sendmsg_tcp(fd, &msg, flags);
return ofi_sendmsg_tcp(fd, &msg, flags);
}

static inline ssize_t
ofi_recvv_socket(SOCKET fd, const struct iovec *iov, size_t cnt, int flags)
static inline ssize_t ofi_recvv_socket(SOCKET fd, const struct iovec *iov,
size_t cnt, int flags)
{
struct msghdr msg;
struct msghdr msg;

msg.msg_control = NULL;
msg.msg_controllen = 0;
msg.msg_flags = 0;
msg.msg_name = NULL;
msg.msg_namelen = 0;
msg.msg_iov = (struct iovec *) iov;
msg.msg_iovlen = cnt;
msg.msg_control = NULL;
msg.msg_controllen = 0;
msg.msg_flags = 0;
msg.msg_name = NULL;
msg.msg_namelen = 0;
msg.msg_iov = (struct iovec *)iov;
msg.msg_iovlen = cnt;

return ofi_recvmsg_tcp(fd, &msg, flags);
return ofi_recvmsg_tcp(fd, &msg, flags);
}

#endif /* _LINUX_OSD_H_ */
3 changes: 0 additions & 3 deletions include/linux/rdpmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <linux/perf_event.h>
#include <ofi_perf.h>


struct rdpmc_ctx {
int fd;
struct perf_event_mmap_page *buf;
Expand All @@ -34,12 +33,10 @@ int rdpmc_open_attr(struct perf_event_attr *attr, struct rdpmc_ctx *ctx,
void rdpmc_close(struct rdpmc_ctx *ctx);
unsigned long long rdpmc_read(struct rdpmc_ctx *ctx);


struct ofi_perf_ctx {
struct rdpmc_ctx ctx;
};


#endif /* HAVE_LINUX_PERF_RDPMC */

#endif

0 comments on commit 3441cad

Please sign in to comment.