From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10043.outbound.protection.outlook.com [40.107.1.43]) by dpdk.org (Postfix) with ESMTP id D7C311E317; Thu, 14 Jun 2018 14:39:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5daor+laIhH27zALkby405IIjL3hZQCjIGMbiDBJI+0=; b=ZBGpDMFR30VkrSZFYJOhoDmOMN1vpaV4EoIw2PN7/QnjBVeaS2DMfGsC1w6NFtFEuOtr39vVtEQGGmrW9C6yDE/TuvkDfGGfg3opALAqM2/d+C+3hni+k4l2MtDVUEeOFFVKFdo6Y02gpcUMI83StW+wPEYbEmOdz/uHCV7nMNk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; Received: from [10.232.134.49] (14.142.187.166) by DB5PR04MB1384.eurprd04.prod.outlook.com (2a01:111:e400:58da::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.16; Thu, 14 Jun 2018 12:39:05 +0000 To: Fan Zhang , dev@dpdk.org References: <20180614110257.10967-1-roy.fan.zhang@intel.com> Cc: pablo.de.lara.guarch@intel.com, jianjay.zhou@huawei.com, stable@dpdk.org From: Akhil Goyal Organization: NXP Message-ID: <2f19ef2d-d132-7162-d1ef-78871a4b7752@nxp.com> Date: Thu, 14 Jun 2018 18:08:51 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20180614110257.10967-1-roy.fan.zhang@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BM1PR0101CA0027.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::13) To DB5PR04MB1384.eurprd04.prod.outlook.com (2a01:111:e400:58da::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 0eefe93a-e127-4b58-ba69-08d5d1f3d148 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(711020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB5PR04MB1384; X-Microsoft-Exchange-Diagnostics: 1; DB5PR04MB1384; 3:L/T1m84PfqiL/0T4uytmlfbQlGiVPQUd9SjE/IEBtzXjubWWOb6jIHUSfVILALK/ai0gYuYsJDW+7xGB6Jgc+LkCQB+psA2NQrrvXPBVokX8Ku8jMrRlFsQGeLQ3qS/uEYqguFgijIWeY6vp+o7RZtf7SdNTufuvLXa+ZVgr2ldxox2RIryPxcqQJNPqtfJ760IGRXU9wmbAVVWLJizIS5bQCmEX33yGjrE3Yo4snEQ/kEqHvfHXMgnhqrBIaGeD; 25:66gG1tPTDAgdJ2wt++0jglwm9u7F1/ro9jfqAMs2YPuckswnV+7I5n2Lt5xP3x712fNJzLNKXJJxDhFtZAzWh0m+atQl0Ovo4OEGR/JZ8QgNq3DZ04nO9iw8/ScpKmhxaZjt1UceW7RiqSoYTiq9z3G7Yg6Z47vosS4BUZGWDCNr+tsOYFX6x8KDwTE407UUSgDNZrgXBX0AtR+fQOtyPQv+jJVp2rBPf2HdZ/rxR84eLJ6CMs+v4sMaLokGMsBx/Ei7zSGjt68LrrGuQy0NANMrkh50y9ex7SRaPXgE1Ctg65RGqsoy5AQh2xfHnNrgC8D91hajg7LjH+X3Wacus0Sr+h5IPAHYnqsjRNqu5nY=; 31:gJj/PWzi6M5pawFa37KUl+pdEtAkT077Fca1x8KZto+AiLyI39PAamf4eNdxjlbvjUrZIWX1BrKrcCEypO8++fvMfbODtIWfg/EAtyt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report-Test: UriScan:(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:DB5PR04MB1384; BCL:0; PCL:0; RULEID:; SRVR:DB5PR04MB1384; X-Forefront-PRVS: 0703B549E4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(376002)(366004)(396003)(346002)(39380400002)(39860400002)(189003)(199004)(58126008)(76176011)(6486002)(67846002)(50466002)(478600001)(97736004)(26005)(47776003)(66066001)(36916002)(52116002)(65956001)(65806001)(53936002)(68736007)(65826007)(4326008)(31696002)(64126003)(5660300001)(59450400001)(16576012)(25786009)(31686004)(3260700006)(2906002)(86362001)(105586002)(316002)(106356001)(23746002)(486006)(6246003)(7736002)(305945005)(5009440100003)(446003)(6666003)(53546011)(476003)(8676002)(55236004)(16526019)(386003)(229853002)(77096007)(36756003)(2616005)(956004)(230700001)(6116002)(186003)(81166006)(44832011)(81156014)(3846002)(8936002)(11346002)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR04MB1384; H:[10.232.134.49]; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; DB5PR04MB1384; 23:Uefi8kbhjDGok4AlJGtzKleWU2PUHSBQSrWRP?= =?Windows-1252?Q?L+GP+6LO1FKY/q1Lr/BC0f4JEHvGTepdPmIElVhbsAA+z5CNSfGAkqAM?= =?Windows-1252?Q?ZspFMsY5v1+0JFLncw0aVrPszk4Ux75zWXRwiNEn+OkWWLoBJhaZaUkw?= =?Windows-1252?Q?ycb3k0g4c6ueClQjlN1stLHhK3kiTxmbXfVQcsWfh9Jqm3SKrM5r446t?= =?Windows-1252?Q?mRDjcoYYsAHS/OReLqChIeE+A9+68bvZC3hAplkT0Z3kCKABtXDdwRtG?= =?Windows-1252?Q?ZzMiVh9X1rZnNLAyRQmBlz7/F0lBMJMtxO0rQQnJTAA69GSAqJ2iHIvg?= =?Windows-1252?Q?BfnwP8zttM+CKmaWavrPcwlE/1Stn3EdCrUoNi2CdsLMtqOqG72r7a+h?= =?Windows-1252?Q?jHxuiVQkzqrF8A3eK5JbceNWj9QMqaPauvDkrN3N5bGAOQng1wETLTH9?= =?Windows-1252?Q?EyrUa4E598BQRgnfHTzDLK/axOHi75/ExnCjRvQtoKcZpdPHaLiiHM1V?= =?Windows-1252?Q?cuJkM2b5Vnwtblpkgl2hW6sxA90+kE0ozIYAXiw9rv4lJ7ImVZENhfNh?= =?Windows-1252?Q?rYqW0OkDObaPLQsRs6jhmCv4dxdPDZpo1GuF8xwjb2vz3j0CpReESX+L?= =?Windows-1252?Q?O8HgN8cwxyD2Fy8noGtLh6qAswuxlbLOURZ2tSxqPA+JVU/csPDi51FM?= =?Windows-1252?Q?7sgvMsi8F4LolYtJcIQnMHvuaGDpznRERAD9D9dMwaDKVcnK+G0H5N62?= =?Windows-1252?Q?JA3eHAp+6FbNDZGlSluVirZzOsO/J/vFxhNlgv/a1KuXRMmefogJ+wgl?= =?Windows-1252?Q?XN3hyKqSZp8EYSuLnqOrLe2Le5UYnZUvBzV20a8DIjHRwvrm9CxzhvmB?= =?Windows-1252?Q?am9A81x9ytYY+6ZL3Nr9sEh3yb6pxJU+XTutYYsXQ8mdndzvGxiIl8XL?= =?Windows-1252?Q?pXDtzmnXrxM7mVLbIMBiSr1wMkc35SS19qdwnCzDC0vYg3UTk3ng8Mm1?= =?Windows-1252?Q?ItZFeudgyFtYw9ziUtxc3k2lj0soA8NL3lkE70C+lQyt24N5kBP/czFj?= =?Windows-1252?Q?WeiN7KxFCWjnogdcjtZGuGaf5oE+CGAqVczu71SBMSZOuoSw/1K84A6j?= =?Windows-1252?Q?4+5b1PVWRdkjzp0egvpyQTl6VJYwaTEz10hf0TPPiEiUq0p8ajE3O1JX?= =?Windows-1252?Q?G8iHq3ReG1gpX3j3Qndzf0bn06LwJC0p9JSUoD0hNeNRF1O11r5R+8/A?= =?Windows-1252?Q?ECZA4CnFA8tL5OhlD49w0SK9POTAdjEuwDiGrCZPS/pi8mGWi2FAGomJ?= =?Windows-1252?Q?Clhjj248NNMED6v7HRIQkMPU6MIkrtTQNKhB8LPnJVir6oHE3SZ8PCwC?= =?Windows-1252?Q?IS4YsUjWKdbCA7b1TcUqSunNBPvUHmsDiwoZ+ijurI9oDCwCzWDnSx/f?= =?Windows-1252?Q?5n02dw4SAKTdxE1r867VcLKZgI3gVaZwLlvvH6OO8Gs+LgiwNry4Xr6O?= =?Windows-1252?Q?z1iC8ZdZxuu9vCN197IN5+JUXPT9OjCu0dyWD4AxHtuU6JVjvWjZINpT?= =?Windows-1252?Q?8fbvaCcCxwMXWOU5g9HF+JM5jaE2FBkoxdnLMdJq0dbJPZg8Y9u25ifl?= =?Windows-1252?Q?Qjn8GfUcEpkGbVei+fvLIVHNurDELZEsxMCmidgsD1ppqqyB6hHS5Jd9?= =?Windows-1252?Q?Vu3/88PMg=3D=3D?= X-Microsoft-Antispam-Message-Info: e6XZxCHpEkSIs7LueKuaV/6IyZrhleDiZWp4FDCwdc/xXVeOhSgt5oaiWAdkVHVbJX85FNesidb3wOGt5BDiVrFn0/oGabMfrlxUMnOarWMt9CmRzx6hCi7XEVe0Yrq94/XWjocdmqF0nFDvyZ5FOltYGXsC7rsrBnd9LM/w42jE0W6kNpu89mBmCUkVowsB X-Microsoft-Exchange-Diagnostics: 1; DB5PR04MB1384; 6:3pu/Y/rWAGGmjlhtKGfrizKyIo6DRVhiNcXd18J1cW07fBdn32E1hsjHP9U5yM98Pg5TGlahrNr9HvQpY/CVrvlHrns9dh/nkGgu7TWTGzp3Nb4cj8Md7TQUuA6oKv6qZQNiuszx9MlGFKU+HyCGmROOEvofgRNMERyIn2qnBYjNM+3MwvAuSmYmuHN7JRwA8WZvRE824HPBQ7rxCPO8FDti+6bZv3eLaMEtNrZh0Co+OR2pG6OUwamKhwpMiQWKB7f+MJJNtO0ui4/ubU9U8Q6XiSLUUZgkp7ousTXRn9TIP4IrSPxKMEJuRLiojMi4mN+fJUu3Uk7s8ktj4pFhS6Nl9pGmLTavh18rIc33X3TVuei7BdRnjqeabhjapdnEa8J9CYxHm5UjFVH9Tvz06GLj4nf8ZYhYLnZndwqa270qEIpNi8KOBtctO+W+DXJ4Pt+jDH4pCVZtCOsa3JA3VA==; 5:A6tRSIwWVcvcvlv8+8oy3URQMu1VB1/p8DUjCZqmvCWQIs07oFWYPq3QYkFCmhHI9TdRCLb6+eSFjTJQV5quiwIfhSaEk65b1MKHc7M1uZEcgHf0gsdJKr9NXBz+bvpCD5lajQgRfdpS18LfXIAgF+ZHdwn9TANqml4Ya9LmHe4=; 24:NmcMhXL6pOIoUgp/SJWhGhvcyPK3kE1sBtdTLP2YI5K05bZqbiNo2oFuzuALGxlgW7YCI2+nd65ypCLMTv+++wWfGETpQc3EqUe6dxpz0lk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB5PR04MB1384; 7:yRZCJyEGOlAYNtyDGIbAupX93w9Mn9h1oQSErfaDyhujC1bk8jzd/ED7VBHVXhshafI+vTNgXreq6ONBPs/Ys2SXzIpAbbcG1XNCeZcbevXPswL1+osgf6KWfgJygawR9H3c0MfwL4gR6aXnuVxdn6Vw9O/PebKhXp+w0i0gWIS1YbbrQNs+1QAcEqi6SxLHz6iTofDQ/ZMDszZ3XvcUU3hSydcEXj0ZqwK9Csl8sJCVJd6TKGHSpl9qtqGEgjTS X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2018 12:39:05.0136 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0eefe93a-e127-4b58-ba69-08d5d1f3d148 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR04MB1384 Subject: Re: [dpdk-dev] [PATCH] crypto/virtio: fix iv physical address 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, 14 Jun 2018 12:39:08 -0000 On 6/14/2018 4:32 PM, Fan Zhang wrote: > The physical address of IV required by Virtio was computed using > crypto operations' physical address plus the offset. However not > all crypto ops will have physical address field initialized and > compute it runtimely is costly. This patch fixes this problem by > adding iv field in virtio_crypto_op_cookie and does a memcpy of > iv instead. > > Fixes: 82adb12a1fce ("crypto/virtio: support burst enqueue/dequeue") > Cc: stable@dpdk.org > > Signed-off-by: Fan Zhang > --- > drivers/crypto/virtio/virtio_cryptodev.c | 6 ++++++ > drivers/crypto/virtio/virtio_cryptodev.h | 3 +++ > drivers/crypto/virtio/virtio_rxtx.c | 8 +++++++- > 3 files changed, 16 insertions(+), 1 deletion(-) > > diff --git a/drivers/crypto/virtio/virtio_cryptodev.c b/drivers/crypto/virtio/virtio_cryptodev.c > index df88953f6..6ffa7619c 100644 > --- a/drivers/crypto/virtio/virtio_cryptodev.c > +++ b/drivers/crypto/virtio/virtio_cryptodev.c > @@ -1223,6 +1223,12 @@ virtio_crypto_sym_pad_op_ctrl_req( > /* Get cipher xform from crypto xform chain */ > cipher_xform = virtio_crypto_get_cipher_xform(xform); > if (cipher_xform) { > + if (cipher_xform->iv.length > VIRTIO_CRYPTO_MAX_IV_SIZE) { > + VIRTIO_CRYPTO_SESSION_LOG_ERR( > + "cipher IV cannot longer than %u", > + VIRTIO_CRYPTO_MAX_IV_SIZE); > + return -1; > + } > if (is_chainned) > ret = virtio_crypto_sym_pad_cipher_param( > &ctrl->u.sym_create_session.u.chain.para > diff --git a/drivers/crypto/virtio/virtio_cryptodev.h b/drivers/crypto/virtio/virtio_cryptodev.h > index e402c0309..676e008d9 100644 > --- a/drivers/crypto/virtio/virtio_cryptodev.h > +++ b/drivers/crypto/virtio/virtio_cryptodev.h > @@ -16,6 +16,8 @@ > > #define NUM_ENTRY_VIRTIO_CRYPTO_OP 7 > > +#define VIRTIO_CRYPTO_MAX_IV_SIZE 32 > + max iv size supported in capability is 16 and here it is 32.