netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Lemon <jonathan.lemon@gmail.com>
To: Eric Dumazet <edumazet@google.com>
Cc: netdev <netdev@vger.kernel.org>, kernel-team <kernel-team@fb.com>,
	Christoph Hellwig <hch@lst.de>,
	Robin Murphy <robin.murphy@arm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Miller <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Willem de Bruijn <willemb@google.com>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	Saeed Mahameed <saeedm@mellanox.com>,
	Maxim Mikityanskiy <maximmi@mellanox.com>,
	bjorn.topel@intel.com, magnus.karlsson@intel.com,
	borisp@mellanox.com, david@redhat.com
Subject: Re: [RFC PATCH v2 13/21] net/tcp: Pad TCP options out to a fixed size for netgpu
Date: Mon, 27 Jul 2020 10:20:14 -0700	[thread overview]
Message-ID: <20200727172014.ynvc5vty5bbg7wsp@bsd-mbp.dhcp.thefacebook.com> (raw)
In-Reply-To: <CANn89i+nXhXzxC3C+UY0xAMFeUxZSSD8R5MP2mmttjZa+5-Hxg@mail.gmail.com>

On Mon, Jul 27, 2020 at 08:19:24AM -0700, Eric Dumazet wrote:
> On Mon, Jul 27, 2020 at 12:51 AM Jonathan Lemon
> <jonathan.lemon@gmail.com> wrote:
> >
> > From: Jonathan Lemon <bsd@fb.com>
> >
> > The "header splitting" feature used by netgpu doesn't actually parse
> > the incoming packet header.  Instead, it splits the packet at a fixed
> > offset.  In order for this to work, the sender needs to send packets
> > with a fixed header size.
> >
> > Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
> > ---
> >  net/ipv4/tcp_output.c | 20 ++++++++++++++++++++
> >  1 file changed, 20 insertions(+)
> >
> > diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> > index d8f16f6a9b02..e8a74d0f7ad2 100644
> > --- a/net/ipv4/tcp_output.c
> > +++ b/net/ipv4/tcp_output.c
> > @@ -438,6 +438,7 @@ struct tcp_out_options {
> >         u8 ws;                  /* window scale, 0 to disable */
> >         u8 num_sack_blocks;     /* number of SACK blocks to include */
> >         u8 hash_size;           /* bytes in hash_location */
> > +       u8 pad_size;            /* additional nops for padding */
> >         __u8 *hash_location;    /* temporary pointer, overloaded */
> >         __u32 tsval, tsecr;     /* need to include OPTION_TS */
> >         struct tcp_fastopen_cookie *fastopen_cookie;    /* Fast open cookie */
> > @@ -562,6 +563,17 @@ static void tcp_options_write(__be32 *ptr, struct tcp_sock *tp,
> >         smc_options_write(ptr, &options);
> >
> >         mptcp_options_write(ptr, opts);
> > +
> > +#if IS_ENABLED(CONFIG_NETGPU)
> > +       /* pad out options */
> > +       if (opts->pad_size) {
> > +               int len = opts->pad_size;
> > +               u8 *p = (u8 *)ptr;
> > +
> > +               while (len--)
> > +                       *p++ = TCPOPT_NOP;
> > +       }
> > +#endif
> >  }
> >
> >  static void smc_set_option(const struct tcp_sock *tp,
> > @@ -826,6 +838,14 @@ static unsigned int tcp_established_options(struct sock *sk, struct sk_buff *skb
> >                         opts->num_sack_blocks * TCPOLEN_SACK_PERBLOCK;
> >         }
> >
> > +#if IS_ENABLED(CONFIG_NETGPU)
> > +       /* force padding */
> > +       if (size < 20) {
> > +               opts->pad_size = 20 - size;
> > +               size += opts->pad_size;
> > +       }
> > +#endif
> > +
> 
> This is obviously wrong, as any kernel compiled with CONFIG_NETGPU
> will fail all packetdrill tests suite.
> 
> Also the fixed 20 value is not pretty.

Would changing this into a sysctl be a suitable solution?  It really is
a temporary solution to handle hardware that doesn't support splitting,
and adding a sysctl seems so permanent.....  
-- 
Jonathan


  reply	other threads:[~2020-07-27 17:20 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200727052846.4070247-1-jonathan.lemon@gmail.com>
     [not found] ` <20200727052846.4070247-4-jonathan.lemon@gmail.com>
2020-07-27  5:58   ` [RFC PATCH v2 03/21] mm: Allow DMA mapping of pages which are not online Christoph Hellwig
2020-07-27 17:08     ` Jonathan Lemon
     [not found] ` <20200727052846.4070247-22-jonathan.lemon@gmail.com>
2020-07-27  7:35   ` [RFC PATCH v2 21/21] netgpu/nvidia: add Nvidia plugin for netgpu Christoph Hellwig
2020-07-27 17:00     ` Jonathan Lemon
2020-07-27 18:24       ` Christoph Hellwig
2020-07-28  1:48         ` Jonathan Lemon
2020-07-28  6:47           ` Christoph Hellwig
2020-07-28 16:05             ` Jonathan Lemon
2020-07-28 16:10               ` Christoph Hellwig
2020-07-28 18:19           ` Jason Gunthorpe
2020-07-28 21:01             ` Jonathan Lemon
2020-07-28 21:14               ` Christoph Hellwig
2020-07-28 23:38               ` Jason Gunthorpe
     [not found] ` <20200727052846.4070247-14-jonathan.lemon@gmail.com>
2020-07-27 15:19   ` [RFC PATCH v2 13/21] net/tcp: Pad TCP options out to a fixed size " Eric Dumazet
2020-07-27 17:20     ` Jonathan Lemon [this message]
     [not found] ` <20200727052846.4070247-16-jonathan.lemon@gmail.com>
2020-07-27 15:19   ` [RFC PATCH v2 15/21] net/tcp: add MSG_NETDMA flag for sendmsg() Eric Dumazet
2020-07-27 15:55     ` Jonathan Lemon
2020-07-27 16:09       ` Eric Dumazet
2020-07-27 17:35         ` Jonathan Lemon
2020-07-27 17:44           ` Eric Dumazet
2020-07-28  2:11             ` Jonathan Lemon
2020-07-28  2:17               ` Eric Dumazet
2020-07-28  3:08                 ` Jonathan Lemon
2020-07-28  6:50                 ` Christoph Hellwig
     [not found] ` <20200727052846.4070247-9-jonathan.lemon@gmail.com>
2020-07-27 15:24   ` [RFC PATCH v2 08/21] skbuff: add a zc_netgpu bitflag Eric Dumazet
2020-07-27 16:59     ` Jonathan Lemon
2020-07-27 17:08       ` Eric Dumazet
2020-07-27 17:16         ` Jonathan Lemon
2020-07-27 22:44 [RFC PATCH v2 00/21] netgpu: networking between NIC and GPU/CPU Jonathan Lemon
2020-07-27 22:44 ` [RFC PATCH v2 13/21] net/tcp: Pad TCP options out to a fixed size for netgpu Jonathan Lemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200727172014.ynvc5vty5bbg7wsp@bsd-mbp.dhcp.thefacebook.com \
    --to=jonathan.lemon@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bjorn.topel@intel.com \
    --cc=borisp@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=david@redhat.com \
    --cc=edumazet@google.com \
    --cc=hch@lst.de \
    --cc=kernel-team@fb.com \
    --cc=kuba@kernel.org \
    --cc=magnus.karlsson@intel.com \
    --cc=maximmi@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=saeedm@mellanox.com \
    --cc=steffen.klassert@secunet.com \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).