From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from huawei.com (unknown [45.249.212.32]) by dpdk.org (Postfix) with ESMTP id DA78E271 for ; Tue, 28 Nov 2017 02:28:28 +0100 (CET) Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 60C983AB8A8A5; Tue, 28 Nov 2017 09:28:15 +0800 (CST) Received: from [127.0.0.1] (10.177.19.14) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.361.1; Tue, 28 Nov 2017 09:28:09 +0800 To: "Zhang, Roy Fan" , "dev@dpdk.org" References: <1510938620-15268-1-git-send-email-jianjay.zhou@huawei.com> <9F7182E3F746AB4EA17801C148F3C6043305A340@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: <5A1CBB72.4050104@huawei.com> Date: Tue, 28 Nov 2017 09:27:14 +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: <9F7182E3F746AB4EA17801C148F3C6043305A340@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, 28 Nov 2017 01:28:29 -0000 Hi Fan, On 2017/11/28 0:47, Zhang, Roy Fan wrote: > Hi Jay, > > Thanks for contributing to DPDK. > > The code has been tested and works fine. > > A few comments: > > 1. Could you split the patch into a patchset, as suggested in contribution guide in http://dpdk.org/doc/guides/contributing/patches.html, section 5.4? > 2. Please update doc/guides/cryptodevs for describing your virtio crypto PMD. > 3. Please update doc/guides/rel_notes/release_18.02. > 4. One more comment inline > For DPDK, I'm a newbie. Thanks for testing and pointing these steps out, will fix them in V2. > >> -----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 >> + /* >> + * malloc memory to store indirect vring_desc entries, including >> + * ctrl request, cipher key, auth key, session input and desc vring >> + */ >> + desc_offset = ctrl_req_length + cipher_keylen + auth_keylen >> + + input_length; > > Instead of using rte_malloc() as below, you could pre-allocate a mempool and use > rte_mempool_get() or rte_mempool_get_bulk() to get these memory to store descriptors. > You can use rte_mempool_virt2iova() to obtain the physical address of this memory. This shall > have better performance. I will have a try. Regards, Jay > >> + virt_addr_started = rte_malloc(NULL, >> + desc_offset + >> NUM_ENTRY_VIRTIO_CRYPTO_SYM_CREATE_SESSION >> + * sizeof(struct vring_desc), RTE_CACHE_LINE_SIZE); >> + if (virt_addr_started == NULL) { >> + PMD_SESSION_LOG(ERR, "not enough heap memory"); >> + return -ENOSPC; >> + } >> + phys_addr_started = rte_malloc_virt2phy(virt_addr_started); > > . >