On 01/25/18 04:27 PM, John Fastabend wrote: > I did not however retest TLS with the small change to ULP layer. > Mostly because I don't have a TLS setup. I plan/hope to get around > to writing either a sample or preferably a selftest for this case > as well (assuming I didn't miss one).
> @Dave Watson can you take a quick look to verify the changes are > good on TLS ULP side. Looks reasonable, and passes my test suite. One comment below Tested-by: Dave Watson <davejwat...@fb.com> > Signed-off-by: John Fastabend <john.fastab...@gmail.com> > --- > include/net/tcp.h | 6 ++++++ > net/ipv4/tcp_ulp.c | 53 > +++++++++++++++++++++++++++++++++++++++++++++++----- > net/tls/tls_main.c | 2 ++ > 3 files changed, 56 insertions(+), 5 deletions(-) > > diff --git a/net/ipv4/tcp_ulp.c b/net/ipv4/tcp_ulp.c > index 6bb9e14..8ef437d 100644 > --- a/net/ipv4/tcp_ulp.c > +++ b/net/ipv4/tcp_ulp.c > @@ -133,3 +157,22 @@ int tcp_set_ulp(struct sock *sk, const char *name) > icsk->icsk_ulp_ops = ulp_ops; > return 0; > } > + > +int tcp_set_ulp_id(struct sock *sk, int ulp) > +{ > + struct inet_connection_sock *icsk = inet_csk(sk); > + const struct tcp_ulp_ops *ulp_ops; > + int err; > + > + if (icsk->icsk_ulp_ops) > + return -EEXIST; > + > + ulp_ops = __tcp_ulp_lookup(ulp); > + if (!ulp_ops) > + return -ENOENT; > + > + err = ulp_ops->init(sk); > + if (!err) > + icsk->icsk_ulp_ops = ulp_ops; Does this need module_put on error, similar to tcp_set_ulp? > + return err; > +}