* [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
* Re: [dpdk-dev] [PATCH] vhost: rework RARP packet injection
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
2 siblings, 0 replies; 5+ messages in thread
From: Maxime Coquelin @ 2021-09-15 19:51 UTC (permalink / raw)
To: David Marchand, dev; +Cc: Chenbo Xia
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost: rework RARP packet injection
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
2 siblings, 0 replies; 5+ messages in thread
From: Xia, Chenbo @ 2021-09-16 1:40 UTC (permalink / raw)
To: David Marchand, dev; +Cc: Maxime Coquelin
> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Wednesday, September 15, 2021 10:55 PM
> To: dev@dpdk.org
> Cc: Maxime Coquelin <maxime.coquelin@redhat.com>; Xia, Chenbo
> <chenbo.xia@intel.com>
> Subject: [PATCH] vhost: rework RARP packet injection
>
> 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(-)
> --
> 2.23.0
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost: rework RARP packet injection
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
2 siblings, 1 reply; 5+ messages in thread
From: Maxime Coquelin @ 2021-09-28 15:32 UTC (permalink / raw)
To: David Marchand, dev; +Cc: Chenbo Xia
On 9/15/21 16:54, 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(-)
>
Applied to dpdk-next-virtio/main.
Thanks,
Maxime
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost: rework RARP packet injection
2021-09-28 15:32 ` Maxime Coquelin
@ 2021-09-28 19:23 ` Maxime Coquelin
0 siblings, 0 replies; 5+ messages in thread
From: Maxime Coquelin @ 2021-09-28 19:23 UTC (permalink / raw)
To: David Marchand, dev; +Cc: Chenbo Xia
On 9/28/21 17:32, Maxime Coquelin wrote:
>
>
> On 9/15/21 16:54, 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(-)
>>
>
> Applied to dpdk-next-virtio/main.
>
> Thanks,
> Maxime
>
As you suggested on IRC, I added back the comment that got removed:
@@ -3136,6 +3136,12 @@ rte_vhost_dequeue_burst(int vid, uint16_t queue_id,
count = 0;
goto out;
}
+ /*
+ * Inject it to the head of "pkts" array, so that
switch's mac
+ * learning table will get updated first.
+ */
+ pkts[0] = rarp_mbuf;
+ pkts++;
count -= 1;
}
Regards,
Maxime
^ 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).