From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Fan Zhang <roy.fan.zhang@intel.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] vhost/crypto: handle virtually non-contiguous buffers
Date: Wed, 16 May 2018 11:46:24 +0200 [thread overview]
Message-ID: <7a8e99e2-de29-2cd6-0df5-faf64aaff8fa@redhat.com> (raw)
In-Reply-To: <20180510154122.85407-1-roy.fan.zhang@intel.com>
On 05/10/2018 05:41 PM, Fan Zhang wrote:
> This patch enables the handling of buffers non-contiguous in
> virtual address space in the vhost_crypto. Instead of using
> rte_vhost_va_from_guest_pa(), the host virtual address is
> converted by vhost_iova_to_vva() for wider use cases.
>
> For copy mode, the copy length is limited to the chunck size,
> next chuncks VAs being fetched afterward.
>
> Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
> ---
> lib/librte_vhost/vhost_crypto.c | 201 ++++++++++++++++++++++++++--------------
> 1 file changed, 129 insertions(+), 72 deletions(-)
...
> + req = get_data_ptr(vc_req, &desc, sizeof(*req), VHOST_ACCESS_RO);
> + if (unlikely(req == NULL))
Adding braces around the switch would be less error prone IMHO.
> + switch (vcrypto->option) {
> + case RTE_VHOST_CRYPTO_ZERO_COPY_ENABLE:
> + err = VIRTIO_CRYPTO_BADMSG;
> + VC_LOG_ERR("Invalid descriptor");
> + goto error_exit;
> + case RTE_VHOST_CRYPTO_ZERO_COPY_DISABLE:
> + req = &tmp_req;
> + if (unlikely(copy_data(req, vc_req, &desc, sizeof(*req))
> + < 0)) {
> + err = VIRTIO_CRYPTO_BADMSG;
> + VC_LOG_ERR("Invalid descriptor");
> + goto error_exit;
> + }
> + break;
> + default:
> + err = VIRTIO_CRYPTO_ERR;
> + VC_LOG_ERR("Invalid option");
> + goto error_exit;
> + }
>
Other than than, it looks good to me.
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
I will add the braces when applying.
Thanks,
Maxime
next prev parent reply other threads:[~2018-05-16 9:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-10 15:41 Fan Zhang
2018-05-16 9:46 ` Maxime Coquelin [this message]
2018-05-16 10:54 ` Maxime Coquelin
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=7a8e99e2-de29-2cd6-0df5-faf64aaff8fa@redhat.com \
--to=maxime.coquelin@redhat.com \
--cc=dev@dpdk.org \
--cc=roy.fan.zhang@intel.com \
/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).