From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <jianfeng.tan@intel.com>
Received: from mga06.intel.com (mga06.intel.com [134.134.136.31])
 by dpdk.org (Postfix) with ESMTP id 1F3A22B95
 for <dev@dpdk.org>; Thu, 29 Dec 2016 08:42:55 +0100 (CET)
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
 by orsmga104.jf.intel.com with ESMTP; 28 Dec 2016 23:42:54 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.33,425,1477983600"; d="scan'208";a="1105526690"
Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204])
 by fmsmga002.fm.intel.com with ESMTP; 28 Dec 2016 23:42:54 -0800
Received: from fmsmsx151.amr.corp.intel.com (10.18.125.4) by
 FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS)
 id 14.3.248.2; Wed, 28 Dec 2016 23:42:54 -0800
Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by
 FMSMSX151.amr.corp.intel.com (10.18.125.4) with Microsoft SMTP Server (TLS)
 id 14.3.248.2; Wed, 28 Dec 2016 23:42:54 -0800
Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.20]) by
 SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0248.002;
 Thu, 29 Dec 2016 15:42:52 +0800
From: "Tan, Jianfeng" <jianfeng.tan@intel.com>
To: "dev@dpdk.org" <dev@dpdk.org>
CC: "yuanhan.liu@linux.intel.com" <yuanhan.liu@linux.intel.com>,
 "stephen@networkplumber.org" <stephen@networkplumber.org>
Thread-Topic: [PATCH v2 0/9] rxq interrupt mode for virtio PMD
Thread-Index: AQHSYaVnderG0DQjH0i3KRz5XGtIBKEeiiFQ
Date: Thu, 29 Dec 2016 07:42:51 +0000
Message-ID: <ED26CBA2FAD1BF48A8719AEF02201E3651101160@SHSMSX103.ccr.corp.intel.com>
References: <1480810702-114815-1-git-send-email-jianfeng.tan@intel.com>
 <1482996643-113253-1-git-send-email-jianfeng.tan@intel.com>
In-Reply-To: <1482996643-113253-1-git-send-email-jianfeng.tan@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 v2 0/9] rxq interrupt mode for virtio PMD
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 29 Dec 2016 07:42:56 -0000

Forget to mention a key part, when we bind virtio to vfio-pci driver in the=
 VM, we need to insert vfio kernel module like this:

$ modprobe vfio enable_unsafe_noiommu_mode=3D1
$ modprobe vfio-pci

Thanks,
Jianfeng

> -----Original Message-----
> From: Tan, Jianfeng
> Sent: Thursday, December 29, 2016 3:31 PM
> To: dev@dpdk.org
> Cc: yuanhan.liu@linux.intel.com; stephen@networkplumber.org; Tan,
> Jianfeng
> Subject: [PATCH v2 0/9] rxq interrupt mode for virtio PMD
>=20
> v2:
>   - Add PCI queue/irq config ops.
>   - Move rxq interrupt settings before sending DRIVER OK.
>=20
> Historically, virtio PMD can only be binded to igb_uio or
> uio_pci_generic, and not for vfio-pci. Besides, quote from
> http://dpdk.org/doc/guides-16.11/rel_notes/release_2_1.html:
>   "Per queue RX interrupt events are only allowed in VFIO
>    which supports multiple MSI-X vectors."
>=20
> As Linux starts to support vfio noiommu mode since 4.8.0, it's
> a good chance to enable rxq interrupt for virtio PMD.
>=20
> How to test:
>=20
> Step 1, prepare a VM image with kernel version >=3D 4.8.0.
>=20
> Step 2, on the host, start a testpmd with a vhost port:
> $ testpmd -c 0x7 -m 1024 --vdev 'eth_vhost0,iface=3D/tmp/sock0,queues=3D2=
' \
> 	--no-pci -- -i --rxq=3D2 --txq=3D2 --nb-cores=3D2
>=20
> Step 3, boot the VM:
> $ qemu ... -chardev socket,id=3Dchr1,path=3D/tmp/sock0 \
> 	-netdev vhost-user,id=3Dnet1,chardev=3Dchr1,vhostforce,queues=3D2 \
> 	-device virtio-net-pci,netdev=3Dnet1,mq=3Don,vectors=3D5 ...
>=20
> Step 4, start l3fwd-power in VM:
> $ l3fwd-power -c 0x3 -n 4 -- -p 1 -P --config=3D"(0,0,1),(0,1,1)" --no-nu=
ma
>=20
> Step 5, send packets from testpmd on the host:
> $ start tx_first
>=20
> Then l3fwd-power outputs:
> L3FWD_POWER: lcore 1 is waked up from rx interrupt on port 0 queue 0
> L3FWD_POWER: lcore 1 is waked up from rx interrupt on port 0 queue 1
>=20
> Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
> Jianfeng Tan (9):
>   net/virtio: fix rewriting LSC flag
>   net/virtio: add Rx descriptor check
>   net/virtio: add PCI ops for queue/irq binding
>   net/virtio: add Rx queue intr enable/disable functions
>   net/virtio: setup rxq interrupts
>   net/virtio: unbind intr/eventfd when stop device
>   net/virtio: unmapping queue/irq when close device
>   examples/l3fwd: add parse-ptype option
>   examples/l3fwd-power: fix not stop and close device
>=20
>  drivers/net/virtio/virtio_ethdev.c | 149
> +++++++++++++++++++++++++++++++++++--
>  drivers/net/virtio/virtio_ethdev.h |   3 +
>  drivers/net/virtio/virtio_pci.c    |  29 ++++++++
>  drivers/net/virtio/virtio_pci.h    |   5 ++
>  drivers/net/virtio/virtio_rxtx.c   |   9 +++
>  drivers/net/virtio/virtqueue.c     |  11 ---
>  drivers/net/virtio/virtqueue.h     |  24 +++++-
>  examples/l3fwd-power/main.c        |  70 ++++++++++++++++-
>  8 files changed, 282 insertions(+), 18 deletions(-)
>=20
> --
> 2.7.4