Re: [RFC PATCH v2 14/21] net/tcp: add netgpu ioctl setting up zero copy RX queues
From: Jonathan Lemon <hidden>
Date: 2020-07-28 02:16:43
On Mon, Jul 27, 2020 at 03:44:37PM -0700, Jonathan Lemon wrote:
quoted hunk ↗ jump to hunk
From: Jonathan Lemon <redacted> Netgpu delivers iovecs to userspace for incoming data, but the destination queue must be attached to the socket. Do this via and ioctl call on the socket itself. Signed-off-by: Jonathan Lemon <redacted> --- net/ipv4/tcp.c | 5 +++++ 1 file changed, 5 insertions(+)diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 27de9380ed14..261c28ccc8f6 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c@@ -279,6 +279,7 @@ #include <linux/uaccess.h> #include <asm/ioctls.h> #include <net/busy_poll.h> +#include <net/netgpu.h> struct percpu_counter tcp_orphan_count; EXPORT_SYMBOL_GPL(tcp_orphan_count);@@ -636,6 +637,10 @@ int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg) answ = READ_ONCE(tp->write_seq) - READ_ONCE(tp->snd_nxt); break; +#if IS_ENABLED(CONFIG_NETGPU) + case NETGPU_SOCK_IOCTL_ATTACH_QUEUES: /* SIOCPROTOPRIVATE */ + return netgpu_attach_socket(sk, (void __user *)arg); +#endif default: return -ENOIOCTLCMD; }
Actually, this is just ugly, so I'm going to rip it out and have it done the other way around: (ctx -> sk) instead of (sk -> ctx), so ignore this. -- Jonathan