All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Watson <davejwatson@fb.com>
To: Vakul Garg <vakul.garg@nxp.com>
Cc: David Miller <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"borisp@mellanox.com" <borisp@mellanox.com>,
	"aviadye@mellanox.com" <aviadye@mellanox.com>,
	Doron Roberts-Kedes <doronrk@fb.com>
Subject: Re: [net-next v5 3/3] net/tls: Remove redundant array allocation.
Date: Fri, 27 Jul 2018 08:38:46 -0700	[thread overview]
Message-ID: <20180727153846.GA25541@davejwatson-mba.local.dhcp.thefacebook.com> (raw)
In-Reply-To: <DB7PR04MB42527AC58D2D7F718520F3358B2A0@DB7PR04MB4252.eurprd04.prod.outlook.com>

On 07/27/18 09:34 AM, Vakul Garg wrote:
> 
> 
> > -----Original Message-----
> > From: Dave Watson [mailto:davejwatson@fb.com]
> > Sent: Thursday, July 26, 2018 2:31 AM
> > To: Vakul Garg <vakul.garg@nxp.com>
> > Cc: David Miller <davem@davemloft.net>; netdev@vger.kernel.org;
> > borisp@mellanox.com; aviadye@mellanox.com; Doron Roberts-Kedes
> > <doronrk@fb.com>
> > Subject: Re: [net-next v5 3/3] net/tls: Remove redundant array allocation.
> > 
> > On 07/24/18 08:22 AM, Vakul Garg wrote:
> > > Will it be a bad idea to get rid of array 'sgin' on stack and simply
> > > kmalloc 'sgin' for whatever the number the number of pages returned by
> > iov_iter_npages()?
> > > We can allocate for sgout too with the same kmalloc().
> > >
> > > (Using a local array based 'sgin' is coming in the way to achieve
> > > sending multiple async record decryption requests to the accelerator
> > > without waiting for previous one to complete.)
> > 
> > Yes we could do this, and yes we would need to heap allocate if you want to
> > support multiple outstanding decryption requests.  I think async crypto
> > prevents any sort of zerocopy-fastpath, however.
> 
> We already do a aead_request_alloc (which internally does kmalloc).
> To mitigate the cost of kmalloc/kfree for sg lists and aad, I am allocating a 
> combined memory chunk for all of these and then segmenting it into
> aead_req, aad, sgin, sgout. This way there should be no extra cost for
> memory allocations in non-async.

Makes sense, sounds good to me. 

  reply	other threads:[~2018-07-27 17:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-19 16:26 [net-next v5 0/3] net/tls: Minor code cleanup patches Vakul Garg
2018-07-19 16:26 ` [net-next v5 1/3] net/tls: Use socket data_ready callback on record availability Vakul Garg
2018-07-19 16:26 ` [net-next v5 2/3] net/tls: Remove redundant variable assignments and wakeup Vakul Garg
2018-07-19 16:26 ` [net-next v5 3/3] net/tls: Remove redundant array allocation Vakul Garg
2018-07-22  2:25   ` David Miller
2018-07-23 16:35     ` Dave Watson
2018-07-24  4:41       ` David Miller
2018-07-24  4:43         ` Vakul Garg
2018-07-24  4:49           ` David Miller
2018-07-24  8:22       ` Vakul Garg
2018-07-25 21:01         ` Dave Watson
2018-07-27  9:34           ` Vakul Garg
2018-07-27 15:38             ` Dave Watson [this message]
2018-08-01 13:49       ` Vakul Garg
2018-08-01 20:52         ` Dave Watson
  -- strict thread matches above, loose matches on Subject: below --
2018-07-19 16:23 [net-next v4 0/3] net/tls: Minor code cleanup patches Vakul Garg
2018-07-19 16:23 ` [net-next v5 3/3] net/tls: Remove redundant array allocation Vakul Garg

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=20180727153846.GA25541@davejwatson-mba.local.dhcp.thefacebook.com \
    --to=davejwatson@fb.com \
    --cc=aviadye@mellanox.com \
    --cc=borisp@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=doronrk@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=vakul.garg@nxp.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.