From: Dave Watson <davejwatson@fb.com>
To: John Fastabend <john.fastabend@gmail.com>
Cc: <ast@kernel.org>, <daniel@iogearbox.net>,
<netdev@vger.kernel.org>, <bhole_prashant_q7@lab.ntt.co.jp>
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 [thread overview]
Message-ID: <20180126155216.GA10323@davejwatson-mba> (raw)
In-Reply-To: <20180126002701.23004.70470.stgit@john-Precision-Tower-5810>
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@fb.com>
> Signed-off-by: John Fastabend <john.fastabend@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;
> +}
next prev parent reply other threads:[~2018-01-26 15:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-26 0:26 [bpf PATCH 0/3] bpf sockmap fixes John Fastabend
2018-01-26 0:27 ` [bpf PATCH 1/3] net: add a UID to use for ULP socket assignment John Fastabend
2018-01-26 15:52 ` Dave Watson [this message]
2018-01-26 16:21 ` John Fastabend
2018-01-26 0:27 ` [bpf PATCH 2/3] bpf: sockmap, add sock close() hook to remove socks John Fastabend
2018-01-26 0:27 ` [bpf PATCH 3/3] bpf: sockmap, fix leaking maps with attached but not detached progs John Fastabend
2018-01-26 1:06 ` [bpf PATCH 0/3] bpf sockmap fixes John Fastabend
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=20180126155216.GA10323@davejwatson-mba \
--to=davejwatson@fb.com \
--cc=ast@kernel.org \
--cc=bhole_prashant_q7@lab.ntt.co.jp \
--cc=daniel@iogearbox.net \
--cc=john.fastabend@gmail.com \
--cc=netdev@vger.kernel.org \
/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).