From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Watson Subject: Re: [bpf PATCH 1/3] net: add a UID to use for ULP socket assignment Date: Fri, 26 Jan 2018 07:52:16 -0800 Message-ID: <20180126155216.GA10323@davejwatson-mba> References: <20180126002001.23004.45946.stgit@john-Precision-Tower-5810> <20180126002701.23004.70470.stgit@john-Precision-Tower-5810> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: , , , To: John Fastabend Return-path: Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:54090 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753268AbeAZPwn (ORCPT ); Fri, 26 Jan 2018 10:52:43 -0500 Content-Disposition: inline In-Reply-To: <20180126002701.23004.70470.stgit@john-Precision-Tower-5810> Sender: netdev-owner@vger.kernel.org List-ID: 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 > Signed-off-by: John Fastabend > --- > 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; > +}