41#ifndef SOFTWARE_INCLUDE_ENSO_SOCKET_H_
42#define SOFTWARE_INCLUDE_ENSO_SOCKET_H_
46#include <linux/types.h>
50typedef unsigned short sa_family_t;
51typedef unsigned int socklen_t;
53#define MAX_NB_CORES 128
54#define MAX_NB_SOCKETS MAX_NB_FLOWS
56void set_bdf(uint16_t bdf_);
58int socket(
int domain,
int type,
int protocol,
bool fallback)
noexcept;
60int bind(
int sockfd,
const struct sockaddr *addr, socklen_t addrlen)
noexcept;
62uint64_t get_socket_phys_addr(
int sockfd);
64void *get_socket_virt_addr(
int sockfd);
66uint64_t convert_buf_addr_to_phys(
int sockfd,
void *addr);
68int shutdown(
int sockfd,
int how)
noexcept;
75ssize_t recv(
int sockfd,
void *buf,
size_t len,
int flags);
77ssize_t recv_zc(
int sockfd,
void **buf,
size_t len,
int flags);
79ssize_t recv_select(
int ref_sockfd,
int *sockfd,
void **buf,
size_t len,
92ssize_t send(
int sockfd, uint64_t phys_addr,
size_t len,
int flags);
103uint32_t get_completions(
int ref_sockfd);
108int enable_device_timestamp(
int ref_sockfd, uint8_t offset = kDefaultRttOffset);
113int disable_device_timestamp(
int ref_sockfd);
118int enable_device_rate_limit(
int ref_sockfd, uint16_t num, uint16_t den);
123int disable_device_rate_limit(
int ref_sockfd);
128int enable_device_round_robin(
int ref_sockfd);
133int disable_device_round_robin(
int ref_sockfd);
138void free_enso_pipe(
int sockfd,
size_t len);
140void print_sock_stats(
int sockfd);
Constants used throughout the codebase. Some of these constants need to be kept in sync with the hard...