[dpdk-dev] [PATCH] virtio: add new driver for crypto devices

Zhang, Roy Fan roy.fan.zhang at intel.com
Mon Nov 27 17:47:19 CET 2017


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

Regards,
Fan

> -----Original Message-----
> From: Jay Zhou [mailto:jianjay.zhou at huawei.com]
> Sent: Friday, November 17, 2017 5:10 PM
> To: dev at dpdk.org
> Cc: yliu at fridaylinux.org; maxime.coquelin at redhat.com;
> arei.gonglei at huawei.com; Zhang, Roy Fan <roy.fan.zhang at intel.com>; Zeng,
> Xin <xin.zeng at intel.com>; weidong.huang at huawei.com;
> wangxinxin.wang at huawei.com; longpeng2 at huawei.com;
> jianjay.zhou at 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.

> +	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);


More information about the dev mailing list