[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180126155216.GA10323@davejwatson-mba>
Date: Fri, 26 Jan 2018 07:52:16 -0800
From: Dave Watson <davejwatson@...com>
To: John Fastabend <john.fastabend@...il.com>
CC: <ast@...nel.org>, <daniel@...earbox.net>, <netdev@...r.kernel.org>,
<bhole_prashant_q7@....ntt.co.jp>
Subject: Re: [bpf PATCH 1/3] net: add a UID to use for ULP socket assignment
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 <davejwatson@...com>
> Signed-off-by: John Fastabend <john.fastabend@...il.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;
> +}
Powered by blists - more mailing lists