From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from huawei.com (unknown [45.249.212.35]) by dpdk.org (Postfix) with ESMTP id 72F741B360 for ; Tue, 30 Jan 2018 02:58:42 +0100 (CET) Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 664C4735A8AAC; Tue, 30 Jan 2018 09:58:37 +0800 (CST) Received: from [127.0.0.1] (10.177.19.14) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.361.1; Tue, 30 Jan 2018 09:58:28 +0800 To: "Zhang, Roy Fan" , "dev@dpdk.org" References: <1510938620-15268-1-git-send-email-jianjay.zhou@huawei.com> <9F7182E3F746AB4EA17801C148F3C604330ABC27@IRSMSX101.ger.corp.intel.com> CC: "yliu@fridaylinux.org" , "maxime.coquelin@redhat.com" , "arei.gonglei@huawei.com" , "Zeng, Xin" , "weidong.huang@huawei.com" , "wangxinxin.wang@huawei.com" , "longpeng2@huawei.com" From: Jay Zhou Message-ID: <5A6FD0EA.9070303@huawei.com> Date: Tue, 30 Jan 2018 09:56:58 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <9F7182E3F746AB4EA17801C148F3C604330ABC27@IRSMSX101.ger.corp.intel.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.19.14] X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH] virtio: add new driver for crypto devices 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: Tue, 30 Jan 2018 01:58:42 -0000 Hi Fan, On 2018/1/30 1:19, Zhang, Roy Fan wrote: > Hi Jay, > > A few more comments inline. > >> -----Original Message----- >> From: Jay Zhou [mailto:jianjay.zhou@huawei.com] >> Sent: Friday, November 17, 2017 5:10 PM >> To: dev@dpdk.org >> Cc: yliu@fridaylinux.org; maxime.coquelin@redhat.com; >> arei.gonglei@huawei.com; Zhang, Roy Fan ; Zeng, >> Xin ; weidong.huang@huawei.com; >> wangxinxin.wang@huawei.com; longpeng2@huawei.com; >> jianjay.zhou@huawei.com >> Subject: [PATCH] virtio: add new driver for crypto devices >> >> +++ b/drivers/crypto/virtio/virtio_crypto.h >> @@ -0,0 +1,452 @@ > > The file "virtio_crypto.h" is identical to the one in the linux kernel header, right? Yes. > Could you use " #include " instead of creating a copy of the file? Okay. > >> diff --git a/drivers/crypto/virtio/virtio_cryptodev.c >> b/drivers/crypto/virtio/virtio_cryptodev.c >> new file mode 100644 >> index 0000000..9e6cd20 >> --- /dev/null >> +++ b/drivers/crypto/virtio/virtio_cryptodev.c >> @@ -0,0 +1,1542 @@ > > ... > >> + switch (cmd_id) { >> + case VIRTIO_CRYPTO_CMD_CIPHER_HASH: >> + case VIRTIO_CRYPTO_CMD_HASH_CIPHER: >> + ctrl->u.sym_create_session.op_type >> + = VIRTIO_CRYPTO_SYM_OP_ALGORITHM_CHAINING; > > The above line is clearly a bug. > >> + ret = virtio_crypto_sym_pad_op_ctrl_req(ctrl, >> + xform, true, &cipher_key_data, &auth_key_data, >> session); >> + if (ret < 0) { >> + PMD_SESSION_LOG(ERR, >> + "padding sym op ctrl req failed"); >> + goto error_out; >> + } >> + ret = virtio_crypto_send_command(vq, ctrl, >> + cipher_key_data, auth_key_data, session); >> + if (ret < 0) { >> + PMD_SESSION_LOG(ERR, >> + "create session failed: %d", ret); >> + goto error_out; >> + } >> + break; >> + case VIRTIO_CRYPTO_CMD_CIPHER: > > Again, please try to replace the mallocs into rte_mempool_get() or rte_mempool_get_bulk() for performance reason. Okay, will do. Thanks again for reviewing! Regards, Jay > > Best regards, > Fan > > > > > . >