From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f51.google.com (mail-pg0-f51.google.com [74.125.83.51]) by dpdk.org (Postfix) with ESMTP id 3EE6C2C28 for ; Sun, 24 Sep 2017 16:02:27 +0200 (CEST) Received: by mail-pg0-f51.google.com with SMTP id c137so2694225pga.11 for ; Sun, 24 Sep 2017 07:02:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=DQM14veIyLy6BNis6ntsrR5Lk7uWtA/rgNuz/fT2L1c=; b=tq1xFLvJ+qZsvT1XB9oqcN+2RHcrcHuCOgv2kn+C9liPga7tgcXOWF0Xb9HCZndj8u sFTmVR/sacoE7mUdsWZ37tn+t7FLyEFEQX6UyFpgIb6tsQoHyO1It+FWQ5I/543lbHYu fB+bzJKwN/LykxLI7yL3d0ZBpZhnzMvCadnY5BC5Q+bUhAPPZp80htzxb4wcBLTCXJm8 vcwSjlI//3jR01GymbXjpa/easTNztxw2cBX2mIC6ab0FH4NDiYisBGuWHznSwM6xbx3 ZMRshGmCwC3fyts5yi+DHy25aUO/9AOl2apvX9zSEWoJ6CQGtusqU+Tl4AHdya0PfrAL 6s6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=DQM14veIyLy6BNis6ntsrR5Lk7uWtA/rgNuz/fT2L1c=; b=WPMPDrtCKcJnnhzWk0WV9iAYzNBfeJGKJuZriV0Q90HtoLqBAe2+zp1OeOq9FbGUJE cTP55ACDa/ccLlg7mZdd1bX0p+p0tsw+wGKZEw20VYqvch9sFgk7y+xXJnR1Adt1nrCs kLi1sQg6hqkk+F2SxbCxf90JuYteNFprxRO7bD9WVFYWE8s0UUMy7amUM+k/E3AWqDt2 0VugmoK0cL650SvLcpGD0vVAMeL2UmxZ+ijPoPmgTyC+hL11isEEKUj5Je/+pDovm85d x8A4fzGGeob550mXbklt7R/w//kZZp0hte71RyvWI4j7QAAgLty05pTlkjhsjt+gDVe2 +rxQ== X-Gm-Message-State: AHPjjUhnXSJIv6taO19t0PZflDcW+ce92RvSjtIrwB3zOeiwMEThahEY fJ++dd9CyEaKshlzXjpL875bif/XSpeZ6jkycu1lnQ== X-Google-Smtp-Source: AOwi7QCd5eymXTuHyXBbf04glDcvDqOGGA8XDm7eo9+PqA4Z28f6hiFZksGtFCqvfTX+Kfzj+MmLOytRoxS1zP8xGaE= X-Received: by 10.99.127.91 with SMTP id p27mr4584351pgn.405.1506261746295; Sun, 24 Sep 2017 07:02:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.178.77 with HTTP; Sun, 24 Sep 2017 07:02:25 -0700 (PDT) Received: by 10.100.178.77 with HTTP; Sun, 24 Sep 2017 07:02:25 -0700 (PDT) In-Reply-To: References: From: Stephen Hemminger Date: Sun, 24 Sep 2017 07:02:25 -0700 Message-ID: To: Jan Scheurich Cc: dev@dpdk.org, dev@openvswitch.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] vhost: Expose virtio interrupt requirement on rte_vhos API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Sep 2017 14:02:27 -0000 I heard Fd.io has a faster vhost driver. Has anyone investigated? On Sep 23, 2017 8:16 PM, "Jan Scheurich" wrote: > Performance tests with the OVS DPDK datapath have shown that the tx > throughput over a vhostuser port into a VM with an interrupt-based virtio > driver is limited by the overhead incurred by virtio interrupts. The OVS > PMD spends up to 30% of its cycles in system calls kicking the eventfd. > Also the core running the vCPU is heavily loaded with generating the virtio > interrupts in KVM on the host and handling these interrupts in the > virtio-net driver in the guest. This limits the throughput to about 500-700 > Kpps with a single vCPU. > > OVS is trying to address this issue by batching packets to a vhostuser > port for some time to limit the virtio interrupt frequency. With a 50 us > batching period we have measured an iperf3 throughput increase by 15% and > a PMD utilization decrease from 45% to 30%. > > On the other hand, guests using virtio PMDs do not profit from time-based > tx batching. Instead they experience a 2-3% performance penalty and an > average latency increase of 30-40 us. OVS therefore intends to apply > time-based tx batching only for vhostuser tx queues that need to trigger > virtio interrupts. > > Today this information is hidden inside the rte_vhost library and not > accessible to users of the API. This patch adds a function to the API to > query it. > > Signed-off-by: Jan Scheurich > > --- > > lib/librte_vhost/rte_vhost.h | 12 ++++++++++++ > lib/librte_vhost/vhost.c | 19 +++++++++++++++++++ > 2 files changed, 31 insertions(+) > > diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h > index 8c974eb..d62338b 100644 > --- a/lib/librte_vhost/rte_vhost.h > +++ b/lib/librte_vhost/rte_vhost.h > @@ -444,6 +444,18 @@ int rte_vhost_get_vhost_vring(int vid, uint16_t > vring_idx, > */ > uint32_t rte_vhost_rx_queue_count(int vid, uint16_t qid); > > +/** > + * Does the virtio driver request interrupts for a vhost tx queue? > + * > + * @param vid > + * vhost device ID > + * @param qid > + * virtio queue index in mq case > + * @return > + * 1 if true, 0 if false > + */ > +int rte_vhost_tx_interrupt_requested(int vid, uint16_t qid); > + > #ifdef __cplusplus > } > #endif > diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c > index 0b6aa1c..bd1ebf9 100644 > --- a/lib/librte_vhost/vhost.c > +++ b/lib/librte_vhost/vhost.c > @@ -503,3 +503,22 @@ struct virtio_net * > > return *((volatile uint16_t *)&vq->avail->idx) - > vq->last_avail_idx; > } > + > +int rte_vhost_tx_interrupt_requested(int vid, uint16_t qid) > +{ > + struct virtio_net *dev; > + struct vhost_virtqueue *vq; > + > + dev = get_device(vid); > + if (dev == NULL) > + return 0; > + > + vq = dev->virtqueue[qid]; > + if (vq == NULL) > + return 0; > + > + if (unlikely(vq->enabled == 0 || vq->avail == NULL)) > + return 0; > + > + return !(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT); > +} > >