From: Tiwei Bie <tiwei.bie@intel.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: dev@dpdk.org, jfreimann@redhat.com, zhihong.wang@intel.com,
bruce.richardson@intel.com, konstantin.ananyev@intel.com,
david.marchand@redhat.com
Subject: Re: [dpdk-dev] [PATCH v2 3/5] vhost: do not inline unlikely fragmented buffers code
Date: Mon, 20 May 2019 13:51:32 +0800 [thread overview]
Message-ID: <20190520055132.GA19612@___> (raw)
In-Reply-To: <20190517150613.13310-4-maxime.coquelin@redhat.com>
On Fri, May 17, 2019 at 05:06:11PM +0200, Maxime Coquelin wrote:
[...]
>
> +static void
> +copy_vnet_hdr_from_desc(struct virtio_net_hdr *hdr,
> + struct buf_vector *buf_vec)
> +{
> + uint64_t len;
> + uint64_t remain = sizeof(struct virtio_net_hdr);
> + uint64_t src;
> + uint64_t dst = (uint64_t)(uintptr_t)&hdr;
typo: s/&hdr/hdr/
> +
> + /*
> + * No luck, the virtio-net header doesn't fit
> + * in a contiguous virtual area.
> + */
> + while (remain) {
> + len = RTE_MIN(remain, buf_vec->buf_len);
> + src = buf_vec->buf_addr;
> + rte_memcpy((void *)(uintptr_t)dst,
> + (void *)(uintptr_t)src, len);
> +
> + remain -= len;
> + dst += len;
> + buf_vec++;
> + }
> +}
> +
> static __rte_always_inline int
> copy_desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq,
> struct buf_vector *buf_vec, uint16_t nr_vec,
> @@ -1094,28 +1126,7 @@ copy_desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq,
>
> if (virtio_net_with_host_offload(dev)) {
> if (unlikely(buf_len < sizeof(struct virtio_net_hdr))) {
> - uint64_t len;
> - uint64_t remain = sizeof(struct virtio_net_hdr);
> - uint64_t src;
> - uint64_t dst = (uint64_t)(uintptr_t)&tmp_hdr;
> - uint16_t hdr_vec_idx = 0;
> -
> - /*
> - * No luck, the virtio-net header doesn't fit
> - * in a contiguous virtual area.
> - */
It's better to not move above comments.
For the rest,
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
> - while (remain) {
> - len = RTE_MIN(remain,
> - buf_vec[hdr_vec_idx].buf_len);
> - src = buf_vec[hdr_vec_idx].buf_addr;
> - rte_memcpy((void *)(uintptr_t)dst,
> - (void *)(uintptr_t)src, len);
> -
> - remain -= len;
> - dst += len;
> - hdr_vec_idx++;
> - }
> -
> + copy_vnet_hdr_from_desc(&tmp_hdr, buf_vec);
> hdr = &tmp_hdr;
> } else {
> hdr = (struct virtio_net_hdr *)((uintptr_t)buf_addr);
> --
> 2.21.0
>
next prev parent reply other threads:[~2019-05-20 5:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-17 15:06 [dpdk-dev] [PATCH v2 0/5] vhost: I-cache pressure optimizations Maxime Coquelin
2019-05-17 15:06 ` [dpdk-dev] [PATCH v2 1/5] vhost: un-inline dirty pages logging functions Maxime Coquelin
2019-05-20 5:18 ` Tiwei Bie
2019-05-17 15:06 ` [dpdk-dev] [PATCH v2 2/5] vhost: do not inline packed and split functions Maxime Coquelin
2019-05-20 5:30 ` Tiwei Bie
2019-05-17 15:06 ` [dpdk-dev] [PATCH v2 3/5] vhost: do not inline unlikely fragmented buffers code Maxime Coquelin
2019-05-20 5:51 ` Tiwei Bie [this message]
2019-05-24 13:50 ` Maxime Coquelin
2019-05-17 15:06 ` [dpdk-dev] [PATCH v2 4/5] vhost: simplify descriptor's buffer prefetching Maxime Coquelin
2019-05-29 8:05 ` Tiwei Bie
2019-05-17 15:06 ` [dpdk-dev] [PATCH v2 5/5] eal/x86: force inlining of all memcpy and mov helpers Maxime Coquelin
2019-05-20 8:30 ` David Marchand
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=20190520055132.GA19612@___ \
--to=tiwei.bie@intel.com \
--cc=bruce.richardson@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=jfreimann@redhat.com \
--cc=konstantin.ananyev@intel.com \
--cc=maxime.coquelin@redhat.com \
--cc=zhihong.wang@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).