[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+FuTSfdx-T5teraitmFuT-D+8O_LM03MEj6tXgTmr+EB0Zi+A@mail.gmail.com>
Date: Mon, 18 Nov 2019 10:45:09 -0500
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: John Fastabend <john.fastabend@...il.com>
Cc: Willem de Bruijn <willemdebruijn.kernel@...il.com>,
bpf <bpf@...r.kernel.org>,
Network Development <netdev@...r.kernel.org>,
Jakub Kicinski <jakub.kicinski@...ronome.com>,
Daniel Borkmann <daniel@...earbox.net>
Subject: Re: combining sockmap + ktls
> > > > @@ -859,6 +861,7 @@ static int __init tls_register(void)
> > > >
> > > > tls_sw_proto_ops = inet_stream_ops;
> > > > tls_sw_proto_ops.splice_read = tls_sw_splice_read;
> > > > + tls_sw_proto_ops.sendpage_locked = tls_sw_sendpage_locked,
> > > >
> > > > and additionally allowing MSG_NO_SHARED_FRAGS:
> > > >
> > > > int tls_sw_sendpage_locked(struct sock *sk, struct page *page,
> > > > int offset, size_t size, int flags)
> > > > {
> > > > if (flags & ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL |
> > > > - MSG_SENDPAGE_NOTLAST | MSG_SENDPAGE_NOPOLICY))
> > > > + MSG_SENDPAGE_NOTLAST |
> > > > MSG_SENDPAGE_NOPOLICY | MSG_NO_SHARED_FRAGS))
> > > > return -ENOTSUPP;
> > > >
> > >
> > > If you had added MSG_NO_SHARED_FRAGS to the existing tls_sw_sendpage
> > > would that have been sufficient?
> >
> > No, the stack trace I observed is
> >
> > tcp_bpf_sendmsg_redir
> > tcp_bpf_push_locked
> > tcp_bpf_push
> > kernel_sendpage_locked
> > sock->ops->sendpage_locked
> >
> > which never tries tls_sw_sendpage. Perhaps the relevant part is the
> > following in tcp_bpf_push?
> >
> > if (has_tx_ulp) {
> > flags |= MSG_SENDPAGE_NOPOLICY;
> > ret = kernel_sendpage_locked(sk,
> > page, off, size, flags);
> > } else {
> > ret = do_tcp_sendpages(sk, page, off, size, flags);
> > }
> >
>
> Got it, want to submit a fix? Or I can this is a bug.
>
> > Do let me know if there's anything I can help out with. Thanks for
> > your quick answer!
>
> Can you send out a fix for above sendpage_locked case?
Done:
net/tls: enable sk_msg redirect to tls socket egress
http://patchwork.ozlabs.org/patch/1196825/
It addresses both issues at the same time. This seemed preferable than
two separate patches. MSG_NO_SHARED_FRAGS precedes commit 0608c69c9a80
("bpf: sk_msg, sock{map|hash} redirect through ULP"), so no additional
Fixes tag for that.
Powered by blists - more mailing lists