From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>,
Chenbo Xia <chenbo.xia@intel.com>
Subject: [dpdk-dev] [PATCH] vhost: rework RARP packet injection
Date: Wed, 15 Sep 2021 16:54:47 +0200 [thread overview]
Message-ID: <20210915145447.28481-1-david.marchand@redhat.com> (raw)
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;
}
--
2.23.0
next reply other threads:[~2021-09-15 14:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-15 14:54 David Marchand [this message]
2021-09-15 19:51 ` Maxime Coquelin
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=20210915145447.28481-1-david.marchand@redhat.com \
--to=david.marchand@redhat.com \
--cc=chenbo.xia@intel.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.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).