From: "Loc Ho" Subject: RE: IPSec ESP Authenc Offload Date: Thu, 29 May 2008 10:44:47 -0700 Message-ID: <0CA0A16855646F4FA96D25A158E299D604815318@SDCEXCHANGE01.ad.amcc.com> References: <20080526112058.GA16525@gondor.apana.org.au> <0CA0A16855646F4FA96D25A158E299D604814C4A@SDCEXCHANGE01.ad.amcc.com> <20080528063434.GA1173@gondor.apana.org.au> <0CA0A16855646F4FA96D25A158E299D604814F16@SDCEXCHANGE01.ad.amcc.com> <20080528222246.GA7798@gondor.apana.org.au> <0CA0A16855646F4FA96D25A158E299D604815113@SDCEXCHANGE01.ad.amcc.com> <20080529070130.GC18007@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT Cc: To: "Herbert Xu" Return-path: Received: from sdcmail02-ext1.amcc.com ([198.137.200.73]:46988 "EHLO sdcmail02.amcc.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752442AbYE2Rot convert rfc822-to-8bit (ORCPT ); Thu, 29 May 2008 13:44:49 -0400 Content-class: urn:content-classes:message In-Reply-To: <20080529070130.GC18007@gondor.apana.org.au> Sender: linux-crypto-owner@vger.kernel.org List-ID: Hi, See inline... -----Original Message----- From: Herbert Xu [mailto:herbert@gondor.apana.org.au] Sent: Thursday, May 29, 2008 12:02 AM To: Loc Ho Cc: linux-crypto@vger.kernel.org Subject: Re: IPSec ESP Authenc Offload On Wed, May 28, 2008 at 04:02:11PM -0700, Loc Ho wrote: >> >> It doesn't help if it is generated by software. The driver still needs >> a context SA for each operation. In addition, the driver will have to >> increment seq (or load from request) and load SEQ and IV into each >> context SA. It is much cleaner if our driver knows the whole header >> length. Even if the hardware rewrites the SPI and SEQ again, it is all >> handled by hardware offload and will not be a problem for IPSEC ESP. > >I'm happy to add support for ESP offload. However, I don't think we should add it onto the >AEAD interface. We should instead create an ESP interface that specifically does this. > [Loc Ho] I agree if we are doing complete ESP offload. Right now, we just want to handle 'authenc' offload and not hanving to deal with complete offload. >I still think that you can use the existing interface though and just throw away the ESP >work since that's trivial anyway. Having a context SA is not a problem since each tfm >corresponds to a single SA and you can just store the context in its context area. > [Loc Ho] I would like to use the existent interface and it does work. Except, it will require extra works such as 1) another context SA per an operation (this is in addition to the context SA with the tfm), 2) as there are now multiple context SA's, they need to be in sync, and 3) copy fields from one context SA to another. We can not use the same context SA for per operation for following reasons: 1. For hardware generated IV, we need to store the IV in per context SA per operation so that we can write back into the packet by software. 2. For software generated IV, we need to store the IV in per context SA per operation for the hardware to access for crypto algorithm. Alternative, we can parse the IP header if this information is not available from the request 'struct skcipher_givcrypt_request'. This would avoid per context SA per operation. But this is extra work as it is already available in IPSec ESP. -Loc