public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Watson <davejwatson@fb.com>
To: Atul Gupta <atul.gupta@chelsio.com>
Cc: <herbert@gondor.apana.org.au>, <linux-crypto@vger.kernel.org>,
	<ganeshgr@chelsio.co>, <netdev@vger.kernel.org>,
	<davem@davemloft.net>, Boris Pismenny <borisp@mellanox.com>,
	Ilya Lesokhin <ilyal@mellanox.com>
Subject: Re: [RFC crypto v3 8/9] chtls: Register the ULP
Date: Thu, 25 Jan 2018 13:08:50 -0800	[thread overview]
Message-ID: <20180125210850.GA69117@davejwatson-mba> (raw)

<1513769897-26945-1-git-send-email-atul.gupta@chelsio.com>

On 12/20/17 05:08 PM, Atul Gupta wrote:
> +static void __init chtls_init_ulp_ops(void)
> +{
> +	chtls_base_prot			= tcp_prot;
> +	chtls_base_prot.hash		= chtls_hash;
> +	chtls_base_prot.unhash		= chtls_unhash;
> +	chtls_base_prot.close		= chtls_lsk_close;
> +
> +	chtls_cpl_prot			= chtls_base_prot;
> +	chtls_init_rsk_ops(&chtls_cpl_prot, &chtls_rsk_ops,
> +			   &tcp_prot, PF_INET);
> +	chtls_cpl_prot.close		= chtls_close;
> +	chtls_cpl_prot.disconnect	= chtls_disconnect;
> +	chtls_cpl_prot.destroy		= chtls_destroy_sock;
> +	chtls_cpl_prot.shutdown		= chtls_shutdown;
> +	chtls_cpl_prot.sendmsg		= chtls_sendmsg;
> +	chtls_cpl_prot.recvmsg		= chtls_recvmsg;
> +	chtls_cpl_prot.sendpage		= chtls_sendpage;
> +	chtls_cpl_prot.setsockopt	= chtls_setsockopt;
> +	chtls_cpl_prot.getsockopt	= chtls_getsockopt;
> +}

Much of this file should go in tls_main.c, reusing as much as
possible. For example it doesn't look like the get/set sockopts have
changed at all for chtls.

> +
> +static int __init chtls_register(void)
> +{
> +	chtls_init_ulp_ops();
> +	register_listen_notifier(&listen_notifier);
> +	cxgb4_register_uld(CXGB4_ULD_TLS, &chtls_uld_info);
> +	tcp_register_ulp(&tcp_chtls_ulp_ops);
> +	return 0;
> +}
> +
> +static void __exit chtls_unregister(void)
> +{
> +	unregister_listen_notifier(&listen_notifier);
> +	tcp_unregister_ulp(&tcp_chtls_ulp_ops);
> +	chtls_free_all_uld();
> +	cxgb4_unregister_uld(CXGB4_ULD_TLS);
> +}

The idea with ULP is that there is one ULP hook per protocol, 
not per driver.  

             reply	other threads:[~2018-01-25 21:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-25 21:08 Dave Watson [this message]
2018-01-28  5:55 ` [RFC crypto v3 8/9] chtls: Register the ULP Atul Gupta
2018-01-30  6:51   ` Atul Gupta
2018-01-30 17:11     ` Dave Watson
2018-01-31 10:44       ` Atul Gupta
2018-01-31 16:43         ` Dave Watson
2018-01-31 18:28           ` Atul Gupta
2018-02-08 10:26             ` Atul Gupta
2018-02-08 10:34               ` Vakul Garg
  -- strict thread matches above, loose matches on Subject: below --
2017-12-20 11:38 Atul Gupta

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=20180125210850.GA69117@davejwatson-mba \
    --to=davejwatson@fb.com \
    --cc=atul.gupta@chelsio.com \
    --cc=borisp@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=ganeshgr@chelsio.co \
    --cc=herbert@gondor.apana.org.au \
    --cc=ilyal@mellanox.com \
    --cc=linux-crypto@vger.kernel.org \
    --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