From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C423EC433E3 for ; Tue, 28 Jul 2020 02:16:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A3C7920759 for ; Tue, 28 Jul 2020 02:16:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726878AbgG1CQm (ORCPT ); Mon, 27 Jul 2020 22:16:42 -0400 Received: from smtp7.emailarray.com ([65.39.216.66]:26159 "EHLO smtp7.emailarray.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726247AbgG1CQm (ORCPT ); Mon, 27 Jul 2020 22:16:42 -0400 Received: (qmail 42216 invoked by uid 89); 28 Jul 2020 02:16:38 -0000 Received: from unknown (HELO localhost) (amxlbW9uQGZsdWdzdmFtcC5jb21AMTYzLjExNC4xMzIuMw==) (POLARISLOCAL) by smtp7.emailarray.com with SMTP; 28 Jul 2020 02:16:38 -0000 Date: Mon, 27 Jul 2020 19:16:36 -0700 From: Jonathan Lemon To: netdev@vger.kernel.org Cc: kernel-team@fb.com Subject: Re: [RFC PATCH v2 14/21] net/tcp: add netgpu ioctl setting up zero copy RX queues Message-ID: <20200728021636.ifn3kuawc5gg6lv6@bsd-mbp.dhcp.thefacebook.com> References: <20200727224444.2987641-1-jonathan.lemon@gmail.com> <20200727224444.2987641-15-jonathan.lemon@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200727224444.2987641-15-jonathan.lemon@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, Jul 27, 2020 at 03:44:37PM -0700, Jonathan Lemon wrote: > From: Jonathan Lemon > > 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 > --- > 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 > #include > #include > +#include > > 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