DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Tan, Jianfeng" <jianfeng.tan@intel.com>
To: "Xie, Huawei" <huawei.xie@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] vhost: vhost injects interrupts to guest for	each packet
Date: Mon, 21 Sep 2015 09:40:35 +0000	[thread overview]
Message-ID: <ED26CBA2FAD1BF48A8719AEF02201E365C8088@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1442823374-5233-1-git-send-email-huawei.xie@intel.com>



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

  reply	other threads:[~2015-09-21  9:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-21  8:16 Huawei Xie
2015-09-21  9:40 ` Tan, Jianfeng [this message]
2015-09-24 19:58 ` Thomas Monjalon
2015-09-29 15:31   ` Xie, Huawei
2015-09-29 19:21     ` Thomas Monjalon

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=ED26CBA2FAD1BF48A8719AEF02201E365C8088@SHSMSX103.ccr.corp.intel.com \
    --to=jianfeng.tan@intel.com \
    --cc=dev@dpdk.org \
    --cc=huawei.xie@intel.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).