netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Rohit Maheshwari <rohitm@chelsio.com>
Cc: herbert@gondor.apana.org.au, davem@davemloft.net,
	netdev@vger.kernel.org, borisp@mellanox.com, secdev@chelsio.com,
	Vinay Kumar Yadav <vinay.yadav@chelsio.com>
Subject: Re: [PATCH net-next] Crypto/chtls: add/delete TLS header in driver
Date: Wed, 18 Mar 2020 11:55:48 -0700	[thread overview]
Message-ID: <20200318115548.12ce1e37@kicinski-fedora-PC1C0HJN> (raw)
In-Reply-To: <20200318133304.16196-1-rohitm@chelsio.com>

On Wed, 18 Mar 2020 19:03:04 +0530 Rohit Maheshwari wrote:
> @@ -1022,15 +1014,20 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
>  			goto wait_for_sndbuf;
>  
>  		if (is_tls_tx(csk) && !csk->tlshws.txleft) {
> -			struct tls_hdr hdr;
> +			unsigned char record_type = TLS_RECORD_TYPE_DATA;
>  
> -			recordsz = tls_header_read(&hdr, &msg->msg_iter);
> -			size -= TLS_HEADER_LENGTH;
> -			copied += TLS_HEADER_LENGTH;
> +			if (unlikely(msg->msg_controllen)) {
> +				err = tls_proccess_cmsg(sk, msg, &record_type);

This is for the TOE TLS offload, right?

Could you open code this in your driver? This function calls
tls_handle_open_record(), which should be fine with the code as is,
but someone may make an assumption that it's no called for TOE and
break your offload.

Given it's impossible to test the offloads without HW today, I'd 
rather not mix the TOE with the other TLS types..

> +				if (err)
> +					goto out_err;
> +			}
> +
> +			recordsz = size;
>  			csk->tlshws.txleft = recordsz;
> -			csk->tlshws.type = hdr.type;
> +			csk->tlshws.type = record_type;
> +
>  			if (skb)
> -				ULP_SKB_CB(skb)->ulp.tls.type = hdr.type;
> +				ULP_SKB_CB(skb)->ulp.tls.type = record_type;
>  		}
>  
>  		if (!skb || (ULP_SKB_CB(skb)->flags & ULPCB_FLAG_NO_APPEND) ||

      reply	other threads:[~2020-03-18 18:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-18 13:33 [PATCH net-next] Crypto/chtls: add/delete TLS header in driver Rohit Maheshwari
2020-03-18 18:55 ` Jakub Kicinski [this message]

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=20200318115548.12ce1e37@kicinski-fedora-PC1C0HJN \
    --to=kuba@kernel.org \
    --cc=borisp@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    --cc=rohitm@chelsio.com \
    --cc=secdev@chelsio.com \
    --cc=vinay.yadav@chelsio.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;
as well as URLs for NNTP newsgroup(s).