DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vhost: rework RARP packet injection
@ 2021-09-15 14:54 David Marchand
  2021-09-15 19:51 ` Maxime Coquelin
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: David Marchand @ 2021-09-15 14:54 UTC (permalink / raw)
  To: dev; +Cc: Maxime Coquelin, Chenbo Xia

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-28 19:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15 14:54 [dpdk-dev] [PATCH] vhost: rework RARP packet injection David Marchand
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

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