diff --git a/homa_impl.h b/homa_impl.h index 273ee9d4..f4ae8137 100644 --- a/homa_impl.h +++ b/homa_impl.h @@ -3091,7 +3091,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 8f3f668c..4cdb7973 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, @@ -965,14 +968,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; @@ -1014,9 +1016,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