netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Saeed Mahameed <saeedm@mellanox.com>,
	"David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Dave Watson <davejwatson@fb.com>,
	Boris Pismenny <borisp@mellanox.com>,
	Ilya Lesokhin <ilyal@mellanox.com>,
	Aviad Yehezkel <aviadye@mellanox.com>
Subject: Re: [PATCH V2 net-next 06/14] net/tls: Add generic NIC offload infrastructure
Date: Wed, 21 Mar 2018 14:10:25 -0700	[thread overview]
Message-ID: <4cfad193-27f5-6982-66cc-4e327c8b10a0@gmail.com> (raw)
In-Reply-To: <20180321210146.22537-7-saeedm@mellanox.com>



On 03/21/2018 02:01 PM, Saeed Mahameed wrote:
> From: Ilya Lesokhin <ilyal@mellanox.com>
> 
> This patch adds a generic infrastructure to offload TLS crypto to a

...

> +
> +static inline int tls_push_record(struct sock *sk,
> +				  struct tls_context *ctx,
> +				  struct tls_offload_context *offload_ctx,
> +				  struct tls_record_info *record,
> +				  struct page_frag *pfrag,
> +				  int flags,
> +				  unsigned char record_type)
> +{
> +	skb_frag_t *frag;
> +	struct tcp_sock *tp = tcp_sk(sk);
> +	struct page_frag fallback_frag;
> +	struct page_frag  *tag_pfrag = pfrag;
> +	int i;
> +
> +	/* fill prepand */
> +	frag = &record->frags[0];
> +	tls_fill_prepend(ctx,
> +			 skb_frag_address(frag),
> +			 record->len - ctx->prepend_size,
> +			 record_type);
> +
> +	if (unlikely(!skb_page_frag_refill(ctx->tag_size, pfrag, GFP_KERNEL))) {
> +		/* HW doesn't care about the data in the tag
> +		 * so in case pfrag has no room
> +		 * for a tag and we can't allocate a new pfrag
> +		 * just use the page in the first frag
> +		 * rather then write a complicated fall back code.
> +		 */
> +		tag_pfrag = &fallback_frag;
> +		tag_pfrag->page = skb_frag_page(frag);
> +		tag_pfrag->offset = 0;
> +	}
> +

If HW does not care, why even trying to call skb_page_frag_refill() ?

If you remove it, then we remove one seldom used path and might uncover bugs

This part looks very suspect to me, to be honest.

  reply	other threads:[~2018-03-21 21:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-21 21:01 [PATCH V2 net-next 00/14] TLS offload, netdev & MLX5 support Saeed Mahameed
2018-03-21 21:01 ` [PATCH V2 net-next 01/14] tcp: Add clean acked data hook Saeed Mahameed
2018-03-21 21:01 ` [PATCH V2 net-next 02/14] net: Rename and export copy_skb_header Saeed Mahameed
2018-03-21 21:01 ` [PATCH V2 net-next 03/14] net: Add Software fallback infrastructure for socket dependent offloads Saeed Mahameed
2018-03-21 21:01 ` [PATCH V2 net-next 04/14] net: Add TLS offload netdev ops Saeed Mahameed
2018-03-21 21:01 ` [PATCH V2 net-next 05/14] net: Add TLS TX offload features Saeed Mahameed
2018-03-21 21:01 ` [PATCH V2 net-next 06/14] net/tls: Add generic NIC offload infrastructure Saeed Mahameed
2018-03-21 21:10   ` Eric Dumazet [this message]
2018-03-22 12:45     ` Boris Pismenny
2018-03-21 22:27   ` Kirill Tkhai
2018-03-22 22:33     ` Saeed Mahameed
2018-03-21 21:01 ` [PATCH V2 net-next 07/14] net/tls: Support TLS device offload with IPv6 Saeed Mahameed
2018-03-22  9:36   ` Sergei Shtylyov
2018-03-22 22:18     ` Saeed Mahameed
2018-03-21 21:01 ` [PATCH V2 net-next 08/14] net/mlx5e: Move defines out of ipsec code Saeed Mahameed
2018-03-21 21:01 ` [PATCH V2 net-next 09/14] net/mlx5: Accel, Add TLS tx offload interface Saeed Mahameed
2018-03-21 21:01 ` [PATCH V2 net-next 10/14] net/mlx5e: TLS, Add Innova TLS TX support Saeed Mahameed
2018-03-21 21:01 ` [PATCH V2 net-next 11/14] net/mlx5e: TLS, Add Innova TLS TX offload data path Saeed Mahameed
2018-03-21 21:01 ` [PATCH V2 net-next 12/14] net/mlx5e: TLS, Add error statistics Saeed Mahameed
2018-03-21 21:01 ` [PATCH V2 net-next 13/14] MAINTAINERS: Update mlx5 innova driver maintainers Saeed Mahameed
2018-03-21 21:01 ` [PATCH V2 net-next 14/14] MAINTAINERS: Update TLS maintainers Saeed Mahameed

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=4cfad193-27f5-6982-66cc-4e327c8b10a0@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=aviadye@mellanox.com \
    --cc=borisp@mellanox.com \
    --cc=davejwatson@fb.com \
    --cc=davem@davemloft.net \
    --cc=ilyal@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@mellanox.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).