From e8a366434180c1ae446d767c77fc972d9a8a9d8d Mon Sep 17 00:00:00 2001 From: John Ousterhout Date: Mon, 6 Mar 2023 08:53:53 -0800 Subject: [PATCH] Changes to compile on Linux 6.0; Resolves #21 --- homa_impl.h | 2 +- homa_plumbing.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/homa_impl.h b/homa_impl.h index c4017fc1..2c91f402 100644 --- a/homa_impl.h +++ b/homa_impl.h @@ -3084,7 +3084,7 @@ extern void homa_prios_changed(struct homa *homa); extern int homa_proc_read_metrics(char *buffer, char **start, off_t offset, int count, int *eof, void *data); extern int homa_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, - int noblock, int flags, int *addr_len); + int flags, int *addr_len); extern int homa_register_interests(struct homa_interest *interest, struct homa_sock *hsk, int flags, __u64 id); extern void homa_rehash(struct sock *sk); diff --git a/homa_plumbing.c b/homa_plumbing.c index 248ff6cb..a9f4aabb 100644 --- a/homa_plumbing.c +++ b/homa_plumbing.c @@ -32,6 +32,7 @@ long sysctl_homa_mem[3] __read_mostly; int sysctl_homa_rmem_min __read_mostly; int sysctl_homa_wmem_min __read_mostly; atomic_long_t homa_memory_allocated; +static DEFINE_PER_CPU(int, homa_memory_per_cpu_fw_alloc); /* Global data for Homa. Never reference homa_data directory. Always use * the homa variable instead; this allows overriding during unit tests. @@ -130,6 +131,7 @@ struct proto homa_prot = { .rehash = homa_rehash, .get_port = homa_get_port, .memory_allocated = &homa_memory_allocated, + .per_cpu_fw_alloc = &homa_memory_per_cpu_fw_alloc, .sysctl_mem = sysctl_homa_mem, .sysctl_wmem = &sysctl_homa_wmem_min, .sysctl_rmem = &sysctl_homa_rmem_min, @@ -159,6 +161,7 @@ struct proto homav6_prot = { .rehash = homa_rehash, .get_port = homa_get_port, .memory_allocated = &homa_memory_allocated, + .per_cpu_fw_alloc = &homa_memory_per_cpu_fw_alloc, .sysctl_mem = sysctl_homa_mem, .sysctl_wmem = &sysctl_homa_wmem_min, .sysctl_rmem = &sysctl_homa_rmem_min, @@ -958,14 +961,13 @@ int homa_sendmsg(struct sock *sk, struct msghdr *msg, size_t length) { * @sk: Socket on which the system call was invoked. * @msg: Controlling information for the receive. * @len: Total bytes of space available in msg->msg_iov; not used. - * @nonblocking: Non-zero means MSG_DONTWAIT was specified. * @flags: Flags from system call, not including MSG_DONTWAIT; ignored. * @addr_len: Store the length of the sender address here * Return: The length of the message on success, otherwise a negative * errno. */ int homa_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, - int nonblocking, int flags, int *addr_len) + int flags, int *addr_len) { struct homa_sock *hsk = homa_sk(sk); struct homa_recvmsg_args control; @@ -1007,9 +1009,7 @@ int homa_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, control.bpage_offsets); control.num_bpages = 0; - rpc = homa_wait_for_message(hsk, nonblocking - ? (control.flags | HOMA_RECVMSG_NONBLOCKING) - : control.flags, control.id); + rpc = homa_wait_for_message(hsk, control.flags, control.id); if (IS_ERR(rpc)) { /* If we get here, it means there was an error that prevented * us from finding an RPC to return. If there's an error in