[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230404172318.58e4d0dd@kernel.org>
Date: Tue, 4 Apr 2023 17:23:18 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Chuck Lever <cel@...nel.org>
Cc: pabeni@...hat.com, edumazet@...gle.com, borisp@...dia.com,
netdev@...r.kernel.org, kernel-tls-handshake@...ts.linux.dev,
john.haxby@...cle.com
Subject: Re: [PATCH v8 1/4] net/handshake: Create a NETLINK service for
handling handshake requests
On Mon, 03 Apr 2023 14:46:02 -0400 Chuck Lever wrote:
> +int handshake_nl_done_doit(struct sk_buff *skb, struct genl_info *info)
> +{
> + struct net *net = sock_net(skb->sk);
> + struct socket *sock = NULL;
> + struct handshake_req *req;
> + int fd, status, err;
> +
> + if (GENL_REQ_ATTR_CHECK(info, HANDSHAKE_A_DONE_SOCKFD))
> + return -EINVAL;
> + fd = nla_get_u32(info->attrs[HANDSHAKE_A_DONE_SOCKFD]);
> +
> + err = 0;
> + sock = sockfd_lookup(fd, &err);
> + if (err) {
> + err = -EBADF;
> + goto out_status;
> + }
> +
> + req = handshake_req_hash_lookup(sock->sk);
> + if (!req) {
fput() missing on this path?
> + err = -EBUSY;
> + goto out_status;
> + }
> +
> + trace_handshake_cmd_done(net, req, sock->sk, fd);
> +
> + status = -EIO;
> + if (info->attrs[HANDSHAKE_A_DONE_STATUS])
> + status = nla_get_u32(info->attrs[HANDSHAKE_A_DONE_STATUS]);
> +
> + handshake_complete(req, status, info);
> + fput(sock->file);
> + return 0;
> +
> +out_status:
> + trace_handshake_cmd_done_err(net, req, sock->sk, err);
> + return err;
> +}
> + /*
> + * Arbitrary limit to prevent handshakes that do not make
> + * progress from clogging up the system.
> + */
> + si_meminfo(&si);
> + tmp = si.totalram / (25 * si.mem_unit);
> + hn->hn_pending_max = clamp(tmp, 3UL, 25UL);
No idea what this does (what's mem_unit?), we'll have to trust you :)
And there are some kdoc issues here:
include/trace/events/handshake.h:112: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
** Request lifetime events
include/trace/events/handshake.h:149: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
Powered by blists - more mailing lists