From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 6C0111B307 for ; Thu, 18 Jan 2018 15:39:00 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id F3A1020B22; Thu, 18 Jan 2018 09:38:59 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Thu, 18 Jan 2018 09:39:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=me/Al+FOt1HD+QjPo/Cup5UqgLqGxec0uNofrHbrqDQ=; b=NMqVK3lh zrO+KBRsDPZ072OrEyOU1dZVbzRaSR5o6JaSVkc2W+AdSubn37Sp536XjROW60Uw 0ZFmMB8C4fm5mz2O1G8zQm5LlskanSL3ltC2HQ6mzKiBDNRl2yB2kX73KZyZ8xN3 /lP4PXDW3c1SWZocCTEpCjLYTjGIZfkqqZUsjIJWi5zaSygL1qklhckqdrNRugqS HxU5kXOAD4N632bEcAEfu7taEqf/I7I/eV6C17dXYowE926qhfD8VObNSChUXMDv vrJ4ZtZX56H/zfXXUF/DNmEX+nzOl2RW5hUF8nnOYrgqGlNCkD3AWEfS7FLJbomN NX3N9DiQhxMPQw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=me/Al+FOt1HD+QjPo/Cup5UqgLqGx ec0uNofrHbrqDQ=; b=OEW47qIPYpaGWaa0Qzotrn4JPjeRGiFD6x/3KHknT7ecr u82gpZsNZQqssb7yolJ8yP15535Mb5Ka/imzu91akoq1u74lDpTHsQsoKjZLm1tb MQ4n8yOQ9zhxWm+DxKlm7Tn5JstapgSesWdATQ7MO1mEKKy05590Zsqs07I0OzFO YCr0FvfDhcFdhXAK8JQBJsbmE4eKIqR8OlISDOJmeto+pziyQTM48ZEKj8AApWXg r7MEwh9rnyLgmXs9EQ/B37lXjehKq/pNsdJKFEjJ1it4Ui8cSXrWMKzzPUt7vrGJ XaPanNU6CTxjhKZOzeLBD6AfTsZoDIvUOCEYpnhGg== X-ME-Sender: Received: from yliu-mob (unknown [115.148.90.22]) by mail.messagingengine.com (Postfix) with ESMTPA id 7CE057E3DF; Thu, 18 Jan 2018 09:38:58 -0500 (EST) Date: Thu, 18 Jan 2018 22:38:53 +0800 From: Yuanhan Liu To: Fan Zhang Cc: dev@dpdk.org, maxime.coquelin@redhat.com, tiwei.bie@intel.com Message-ID: <20180118143853.GM29540@yliu-mob> References: <20171127200115.31049-1-roy.fan.zhang@intel.com> <20171127200115.31049-4-roy.fan.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171127200115.31049-4-roy.fan.zhang@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Subject: Re: [dpdk-dev] [PATCH 03/12] lib/librte_vhost: add virtio crypto user message structure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 14:39:00 -0000 On Mon, Nov 27, 2017 at 08:01:06PM +0000, Fan Zhang wrote: > This patch adds virtio-crypto spec user message structure to > vhost_user. > > Signed-off-by: Fan Zhang > --- > lib/librte_vhost/vhost_user.h | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/lib/librte_vhost/vhost_user.h b/lib/librte_vhost/vhost_user.h > index 990b40a..793cdc2 100644 > --- a/lib/librte_vhost/vhost_user.h > +++ b/lib/librte_vhost/vhost_user.h > @@ -108,6 +108,30 @@ typedef struct VhostUserLog { > uint64_t mmap_offset; > } VhostUserLog; > > +/* Comply with Cryptodev-Linux */ > +#define VHOST_USER_CRYPTO_MAX_HMAC_KEY_LENGTH 512 > +#define VHOST_USER_CRYPTO_MAX_CIPHER_KEY_LENGTH 64 > + > +/* Same structure as vhost-user backend session info */ > +typedef struct VhostUserCryptoSessionParam { > + int64_t session_id; > + uint32_t op_code; > + uint32_t cipher_algo; > + uint32_t cipher_key_len; > + uint32_t hash_algo; > + uint32_t digest_len; > + uint32_t auth_key_len; > + uint32_t aad_len; > + uint8_t op_type; > + uint8_t dir; > + uint8_t hash_mode; > + uint8_t chaining_dir; > + uint8_t *ciphe_key; > + uint8_t *auth_key; > + uint8_t cipher_key_buf[VHOST_USER_CRYPTO_MAX_CIPHER_KEY_LENGTH]; > + uint8_t auth_key_buf[VHOST_USER_CRYPTO_MAX_HMAC_KEY_LENGTH]; > +} VhostUserCryptoSessionParam; I'd suggest to merge this patch (which defines the struct) and the next one (which uses it) into one patch. --yliu > + > typedef struct VhostUserMsg { > union { > VhostUserRequest master; > @@ -128,6 +152,7 @@ typedef struct VhostUserMsg { > VhostUserMemory memory; > VhostUserLog log; > struct vhost_iotlb_msg iotlb; > + VhostUserCryptoSessionParam crypto_session; > } payload; > int fds[VHOST_MEMORY_MAX_NREGIONS]; > } __attribute((packed)) VhostUserMsg; > -- > 2.9.5