From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 6ECDE374F for ; Mon, 21 Sep 2015 11:40:42 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 21 Sep 2015 02:40:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,567,1437462000"; d="scan'208";a="648960497" Received: from pgsmsx108.gar.corp.intel.com ([10.221.44.103]) by orsmga003.jf.intel.com with ESMTP; 21 Sep 2015 02:40:39 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by PGSMSX108.gar.corp.intel.com (10.221.44.103) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 21 Sep 2015 17:40:37 +0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.110]) by shsmsx102.ccr.corp.intel.com ([169.254.2.179]) with mapi id 14.03.0248.002; Mon, 21 Sep 2015 17:40:36 +0800 From: "Tan, Jianfeng" To: "Xie, Huawei" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] vhost: vhost injects interrupts to guest for each packet Thread-Index: AQHQ9EXm+ymf93wJfkSNQltlYncpnZ5GunJQ Date: Mon, 21 Sep 2015 09:40:35 +0000 Message-ID: References: <1442823374-5233-1-git-send-email-huawei.xie@intel.com> In-Reply-To: <1442823374-5233-1-git-send-email-huawei.xie@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] vhost: vhost injects interrupts to guest for each packet X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2015 09:40:42 -0000 > -----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 >=20 > 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 pac= kets. >=20 > Signed-off-by: Huawei Xie > --- > lib/librte_vhost/vhost_rxtx.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) >=20 > 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, >=20 > *(volatile uint16_t *)&vq->used->idx +=3D entry_success; > vq->last_used_idx =3D res_cur_idx; > + } >=20 > +merge_rx_exit: > + if (likely(pkt_idx)) { > /* flush used->idx update before we read avail->flags. */ > rte_mb(); >=20 > @@ -532,7 +535,7 @@ virtio_dev_merge_rx(struct virtio_net *dev, uint16_t > queue_id, > eventfd_write((int)vq->callfd, 1); > } >=20 > - return count; > + return pkt_idx; > } >=20 > uint16_t > -- Acked-by: Jianfeng Tan > 1.9.3