* [dpdk-dev] [PATCH] vhost: vhost injects interrupts to guest for each packet
@ 2015-09-21 8:16 Huawei Xie
2015-09-21 9:40 ` Tan, Jianfeng
2015-09-24 19:58 ` Thomas Monjalon
0 siblings, 2 replies; 5+ messages in thread
From: Huawei Xie @ 2015-09-21 8:16 UTC (permalink / raw)
To: dev
In merge-able RX path, vhost injects interrupts to guest for each packet.
This should degrade performance a lot.
This patch fixes this issue by injecting one interrupt for a batch of packets.
Signed-off-by: Huawei Xie <huawei.xie@intel.com>
---
lib/librte_vhost/vhost_rxtx.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c
index 0d07338..9d3165a 100644
--- a/lib/librte_vhost/vhost_rxtx.c
+++ b/lib/librte_vhost/vhost_rxtx.c
@@ -496,7 +496,7 @@ virtio_dev_merge_rx(struct virtio_net *dev, uint16_t queue_id,
"to get enough desc from "
"vring\n",
dev->device_fh);
- return pkt_idx;
+ goto merge_rx_exit;
} else {
update_secure_len(vq, res_cur_idx, &secure_len, &vec_idx);
res_cur_idx++;
@@ -523,7 +523,10 @@ virtio_dev_merge_rx(struct virtio_net *dev, uint16_t queue_id,
*(volatile uint16_t *)&vq->used->idx += entry_success;
vq->last_used_idx = res_cur_idx;
+ }
+merge_rx_exit:
+ if (likely(pkt_idx)) {
/* flush used->idx update before we read avail->flags. */
rte_mb();
@@ -532,7 +535,7 @@ virtio_dev_merge_rx(struct virtio_net *dev, uint16_t queue_id,
eventfd_write((int)vq->callfd, 1);
}
- return count;
+ return pkt_idx;
}
uint16_t
--
1.9.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost: vhost injects interrupts to guest for each packet
2015-09-21 8:16 [dpdk-dev] [PATCH] vhost: vhost injects interrupts to guest for each packet Huawei Xie
@ 2015-09-21 9:40 ` Tan, Jianfeng
2015-09-24 19:58 ` Thomas Monjalon
1 sibling, 0 replies; 5+ messages in thread
From: Tan, Jianfeng @ 2015-09-21 9:40 UTC (permalink / raw)
To: Xie, Huawei, dev
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Huawei Xie
> Sent: Monday, September 21, 2015 4:16 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] vhost: vhost injects interrupts to guest for each
> packet
>
> In merge-able RX path, vhost injects interrupts to guest for each packet.
> This should degrade performance a lot.
> This patch fixes this issue by injecting one interrupt for a batch of packets.
>
> Signed-off-by: Huawei Xie <huawei.xie@intel.com>
> ---
> lib/librte_vhost/vhost_rxtx.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c
> index 0d07338..9d3165a 100644
> --- a/lib/librte_vhost/vhost_rxtx.c
> +++ b/lib/librte_vhost/vhost_rxtx.c
> @@ -496,7 +496,7 @@ virtio_dev_merge_rx(struct virtio_net *dev, uint16_t
> queue_id,
> "to get enough desc from "
> "vring\n",
> dev->device_fh);
> - return pkt_idx;
> + goto merge_rx_exit;
> } else {
> update_secure_len(vq, res_cur_idx,
> &secure_len, &vec_idx);
> res_cur_idx++;
> @@ -523,7 +523,10 @@ virtio_dev_merge_rx(struct virtio_net *dev,
> uint16_t queue_id,
>
> *(volatile uint16_t *)&vq->used->idx += entry_success;
> vq->last_used_idx = res_cur_idx;
> + }
>
> +merge_rx_exit:
> + if (likely(pkt_idx)) {
> /* flush used->idx update before we read avail->flags. */
> rte_mb();
>
> @@ -532,7 +535,7 @@ virtio_dev_merge_rx(struct virtio_net *dev, uint16_t
> queue_id,
> eventfd_write((int)vq->callfd, 1);
> }
>
> - return count;
> + return pkt_idx;
> }
>
> uint16_t
> --
Acked-by: Jianfeng Tan <Jianfeng.tan@intel.com>
> 1.9.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost: vhost injects interrupts to guest for each packet
2015-09-21 8:16 [dpdk-dev] [PATCH] vhost: vhost injects interrupts to guest for each packet Huawei Xie
2015-09-21 9:40 ` Tan, Jianfeng
@ 2015-09-24 19:58 ` Thomas Monjalon
2015-09-29 15:31 ` Xie, Huawei
1 sibling, 1 reply; 5+ messages in thread
From: Thomas Monjalon @ 2015-09-24 19:58 UTC (permalink / raw)
To: Huawei Xie; +Cc: dev
Please reword the title (no need to re-send the patch),
so that you describe what the patch do (batch interrupt).
2015-09-21 16:16, Huawei Xie:
> In merge-able RX path, vhost injects interrupts to guest for each packet.
> This should degrade performance a lot.
> This patch fixes this issue by injecting one interrupt for a batch of packets.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost: vhost injects interrupts to guest for each packet
2015-09-24 19:58 ` Thomas Monjalon
@ 2015-09-29 15:31 ` Xie, Huawei
2015-09-29 19:21 ` Thomas Monjalon
0 siblings, 1 reply; 5+ messages in thread
From: Xie, Huawei @ 2015-09-29 15:31 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On 9/25/2015 4:00 AM, Thomas Monjalon wrote:
> Please reword the title (no need to re-send the patch),
> so that you describe what the patch do (batch interrupt).
>
> 2015-09-21 16:16, Huawei Xie:
>> In merge-able RX path, vhost injects interrupts to guest for each packet.
>> This should degrade performance a lot.
>> This patch fixes this issue by injecting one interrupt for a batch of packets.
>
Hi Thomas:
title:
vhost: inject one interrupt only for a batch of packets
Do you mean this?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost: vhost injects interrupts to guest for each packet
2015-09-29 15:31 ` Xie, Huawei
@ 2015-09-29 19:21 ` Thomas Monjalon
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2015-09-29 19:21 UTC (permalink / raw)
To: Xie, Huawei; +Cc: dev
2015-09-29 15:31, Xie, Huawei:
> On 9/25/2015 4:00 AM, Thomas Monjalon wrote:
> > Please reword the title (no need to re-send the patch),
> > so that you describe what the patch do (batch interrupt).
> >
> > 2015-09-21 16:16, Huawei Xie:
> >> In merge-able RX path, vhost injects interrupts to guest for each packet.
> >> This should degrade performance a lot.
> >> This patch fixes this issue by injecting one interrupt for a batch of packets.
> >
> Hi Thomas:
> title:
> vhost: inject one interrupt only for a batch of packets
> Do you mean this?
Yes, or
"vhost: inject only one interrupt for a batch of packets"
Applied, thanks
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-09-29 23:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-21 8:16 [dpdk-dev] [PATCH] vhost: vhost injects interrupts to guest for each packet Huawei Xie
2015-09-21 9:40 ` Tan, Jianfeng
2015-09-24 19:58 ` Thomas Monjalon
2015-09-29 15:31 ` Xie, Huawei
2015-09-29 19:21 ` Thomas Monjalon
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).