All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Chuck Lever <cel@kernel.org>
Cc: pabeni@redhat.com, edumazet@google.com, borisp@nvidia.com,
	netdev@vger.kernel.org, kernel-tls-handshake@lists.linux.dev,
	john.haxby@oracle.com
Subject: Re: [PATCH v8 1/4] net/handshake: Create a NETLINK service for handling handshake requests
Date: Tue, 4 Apr 2023 17:23:18 -0700	[thread overview]
Message-ID: <20230404172318.58e4d0dd@kernel.org> (raw)
In-Reply-To: <168054756211.2138.1880630504843421368.stgit@klimt.1015granger.net>

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

  parent reply	other threads:[~2023-04-05  0:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-03 18:45 [PATCH v8 0/4] Another crack at a handshake upcall mechanism Chuck Lever
2023-04-03 18:46 ` [PATCH v8 1/4] net/handshake: Create a NETLINK service for handling handshake requests Chuck Lever
2023-04-04 15:36   ` Chuck Lever III
2023-04-04 15:44     ` Hannes Reinecke
2023-04-05  0:00       ` Jakub Kicinski
2023-04-05  6:32         ` Hannes Reinecke
2023-04-05 14:10           ` Chuck Lever III
2023-04-05  0:23   ` Jakub Kicinski [this message]
2023-04-05  0:44     ` Chuck Lever III
     [not found]       ` <20230404183233.78895cf2@kernel.org>
2023-04-05 14:25         ` Chuck Lever III
2023-04-03 18:46 ` [PATCH v8 2/4] net/handshake: Add a kernel API for requesting a TLSv1.3 handshake Chuck Lever
2023-04-03 18:46 ` [PATCH v8 3/4] net/handshake: Add Kunit tests for the handshake consumer API Chuck Lever
2023-04-05  0:24   ` Jakub Kicinski
2023-04-05  0:45     ` Chuck Lever III
2023-04-03 18:46 ` [PATCH v8 4/4] SUNRPC: Recognize control messages in server-side TCP socket code Chuck Lever
2023-04-04 14:41   ` Chuck Lever

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=20230404172318.58e4d0dd@kernel.org \
    --to=kuba@kernel.org \
    --cc=borisp@nvidia.com \
    --cc=cel@kernel.org \
    --cc=edumazet@google.com \
    --cc=john.haxby@oracle.com \
    --cc=kernel-tls-handshake@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.