From: Jonathan Lemon <b...@fb.com>

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 <jonathan.le...@gmail.com>
---
 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;
        }
-- 
2.24.1

Reply via email to