2022-06-12 14:37:32

by Joe Damato

[permalink] [raw]
Subject: [RFC,net-next v2 6/8] net: ip: Support MSG_NTCOPY

Support nontemporal copies of IP data when applications set the
MSG_NTCOPY flag and checksumming is offloaded.

ip_generic_getfrag is used by UDP and raw sockets, so this change
effectively enables MSG_NTCOPY support for both.

Signed-off-by: Joe Damato <[email protected]>
---
net/ipv4/ip_output.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 00b4bf2..75c8627 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -933,6 +933,7 @@ ip_generic_getfrag(void *from, char *to, int offset, int len, int odd, struct sk
struct msghdr *msg = from;

if (skb->ip_summed == CHECKSUM_PARTIAL) {
+ msg_set_iter_copy_type(msg);
if (!copy_from_iter_full(to, len, &msg->msg_iter))
return -EFAULT;
} else {
--
2.7.4