From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: David Marchand <david.marchand@redhat.com>, dev@dpdk.org
Cc: Chenbo Xia <chenbo.xia@intel.com>
Subject: Re: [dpdk-dev] [PATCH] vhost: rework RARP packet injection
Date: Wed, 15 Sep 2021 21:51:45 +0200 [thread overview]
Message-ID: <1eb2a952-f8b3-2ebd-2784-127f954f24d4@redhat.com> (raw)
In-Reply-To: <20210915145447.28481-1-david.marchand@redhat.com>
On 9/15/21 4:54 PM, David Marchand wrote:
> Caught by code review, this copy is unnecessary.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> lib/vhost/virtio_net.c | 11 +++--------
> 1 file changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
> index 8549afbbe1..1d30ad0fd9 100644
> --- a/lib/vhost/virtio_net.c
> +++ b/lib/vhost/virtio_net.c
> @@ -3364,6 +3364,8 @@ rte_vhost_dequeue_burst(int vid, uint16_t queue_id,
> count = 0;
> goto out;
> }
> + pkts[0] = rarp_mbuf;
> + pkts++;
> count -= 1;
> }
>
> @@ -3386,15 +3388,8 @@ rte_vhost_dequeue_burst(int vid, uint16_t queue_id,
> out_access_unlock:
> rte_spinlock_unlock(&vq->access_lock);
>
> - if (unlikely(rarp_mbuf != NULL)) {
> - /*
> - * Inject it to the head of "pkts" array, so that switch's mac
> - * learning table will get updated first.
> - */
> - memmove(&pkts[1], pkts, count * sizeof(struct rte_mbuf *));
> - pkts[0] = rarp_mbuf;
> + if (unlikely(rarp_mbuf != NULL))
> count += 1;
> - }
>
> return count;
> }
>
That's indeed much better!
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
next prev parent reply other threads:[~2021-09-15 19:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-15 14:54 David Marchand
2021-09-15 19:51 ` Maxime Coquelin [this message]
2021-09-16 1:40 ` Xia, Chenbo
2021-09-28 15:32 ` Maxime Coquelin
2021-09-28 19:23 ` 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=1eb2a952-f8b3-2ebd-2784-127f954f24d4@redhat.com \
--to=maxime.coquelin@redhat.com \
--cc=chenbo.xia@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.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).