DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Roy Fan" <roy.fan.zhang@intel.com>
To: Jay Zhou <jianjay.zhou@huawei.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "yliu@fridaylinux.org" <yliu@fridaylinux.org>,
	"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>,
	"arei.gonglei@huawei.com" <arei.gonglei@huawei.com>,
	"Zeng, Xin" <xin.zeng@intel.com>,
	"weidong.huang@huawei.com" <weidong.huang@huawei.com>,
	"wangxinxin.wang@huawei.com" <wangxinxin.wang@huawei.com>,
	"longpeng2@huawei.com" <longpeng2@huawei.com>
Subject: Re: [dpdk-dev] [PATCH] virtio: add new driver for crypto devices
Date: Mon, 29 Jan 2018 17:19:16 +0000	[thread overview]
Message-ID: <9F7182E3F746AB4EA17801C148F3C604330ABC27@IRSMSX101.ger.corp.intel.com> (raw)
In-Reply-To: <1510938620-15268-1-git-send-email-jianjay.zhou@huawei.com>

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 <roy.fan.zhang@intel.com>; Zeng,
> Xin <xin.zeng@intel.com>; 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? 
Could you use " #include <linux/virtio_crypto.h>" instead of creating a copy of the file?

> 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.

Best regards,
Fan

 

  parent reply	other threads:[~2018-01-29 17:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-17 17:10 Jay Zhou
2017-11-27 16:47 ` Zhang, Roy Fan
2017-11-28  1:27   ` Jay Zhou
2017-11-29 10:14     ` Zhang, Roy Fan
2018-01-20 15:50     ` Thomas Monjalon
2018-01-20 15:54       ` Thomas Monjalon
2018-01-22 17:25         ` Zhang, Roy Fan
2018-01-22 21:01           ` Thomas Monjalon
2018-01-22  7:37       ` Zhoujian (jay)
2018-01-29 17:19 ` Zhang, Roy Fan [this message]
2018-01-29 17:21   ` Zhang, Roy Fan
2018-01-30  1:56   ` Jay Zhou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9F7182E3F746AB4EA17801C148F3C604330ABC27@IRSMSX101.ger.corp.intel.com \
    --to=roy.fan.zhang@intel.com \
    --cc=arei.gonglei@huawei.com \
    --cc=dev@dpdk.org \
    --cc=jianjay.zhou@huawei.com \
    --cc=longpeng2@huawei.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=wangxinxin.wang@huawei.com \
    --cc=weidong.huang@huawei.com \
    --cc=xin.zeng@intel.com \
    --cc=yliu@fridaylinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).