public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: Tom Herbert <tom@herbertland.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH RFC 2/3] kcm: Kernel Connection Multiplexor module
Date: Wed, 23 Sep 2015 11:36:56 +0200	[thread overview]
Message-ID: <20150923093656.GE29680@pox.localdomain> (raw)
In-Reply-To: <1442788161-2626305-3-git-send-email-tom@herbertland.com>

On 09/20/15 at 03:29pm, Tom Herbert wrote:
> This module implement the Kernel Connection Multiplexor.
> 
> Kernel Connection Multiplexor (KCM) is a facility that provides a
> message based interface over TCP for generic application protocols.
> With KCM an application can efficiently send and receive application
> protocol messages over TCP using datagram sockets.
> 
> For more information see the included Documentation/networking/kcm.txt
> 
> Signed-off-by: Tom Herbert <tom@herbertland.com>

This looks great!

> +Cloning KCM sockets
> +-------------------
> +
> +After the first KCM socket is created using the socket call as described
> +above, additional sockets for the multiplexor can be created by cloning
> +a KCM socket. This is accomplished by calling accept on the KCM socket:
> +
> +   newkcmfd = accept(kcmfd, NULL, 0)

This looks a bit ugly.

> +  ioctl(kcmfd, SIOCKCMATTACH, &info);

Use setsockopt() instead?

> +/* Process a new message. If there is no KCM socket waiting for a message
> + * hold it in the psock. Returns true if message is held this way, false
> + * otherwise.
> + */
> +static bool new_rx_msg(struct kcm_psock *psock, struct sk_buff *head)
> +{
> +	struct kcm_mux *mux = psock->mux;
> +	struct kcm_sock *kcm = NULL;
> +	struct sock *sk;
> +
> +	spin_lock_bh(&mux->lock);
> +
> +	if (WARN_ON(psock->ready_rx_msg)) {
> +		spin_unlock_bh(&mux->lock);
> +		kfree_skb(head);
> +		return false;
> +	}
> +
> +	if (list_empty(&mux->kcm_rx_waiters)) {
> +		psock->ready_rx_msg = head;
> +
> +		list_add_tail(&psock->psock_ready_list,
> +			      &mux->psocks_ready);
> +
> +		spin_unlock_bh(&mux->lock);
> +		return true;
> +	}
> +
> +	kcm = list_first_entry(&mux->kcm_rx_waiters,
> +			       struct kcm_sock, wait_rx_list);

Per CPU list of waiting sockets?

  parent reply	other threads:[~2015-09-23  9:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-20 22:29 [PATCH RFC 0/3] kcm: Kernel Connection Multiplexor (KCM) Tom Herbert
2015-09-20 22:29 ` [PATCH RFC 1/3] rcu: Add list_next_or_null_rcu Tom Herbert
2015-09-20 22:29 ` [PATCH RFC 2/3] kcm: Kernel Connection Multiplexor module Tom Herbert
2015-09-22 16:26   ` Alexei Starovoitov
2015-09-22 17:26     ` Tom Herbert
2015-09-22 18:41       ` Alexei Starovoitov
2015-09-23  9:36   ` Thomas Graf [this message]
2015-09-20 22:29 ` [PATCH RFC 3/3] kcm: Add statistics and proc interfaces Tom Herbert
2015-09-21 12:24 ` [PATCH RFC 0/3] kcm: Kernel Connection Multiplexor (KCM) Sowmini Varadhan
2015-09-21 17:33   ` Tom Herbert
2015-09-21 21:26     ` Sowmini Varadhan
2015-09-21 22:36       ` Tom Herbert
2015-09-21 22:53         ` Sowmini Varadhan
2015-09-22  9:14 ` Thomas Martitz
2015-09-22 16:46   ` Tom Herbert

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=20150923093656.GE29680@pox.localdomain \
    --to=tgraf@suug.ch \
    --cc=davem@davemloft.net \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=tom@herbertland.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox