[dpdk-dev] [PATCH v4 6/8] virtio-user: add new virtual pci driver for virtio

2016-05-16 Thread Yuanhan Liu
On Mon, May 16, 2016 at 01:48:01AM +, Tan, Jianfeng wrote: > > On Fri, May 13, 2016 at 09:54:33AM +0800, Tan, Jianfeng wrote: > > > > > > So, I'd suggest something like following: > > > > > > if (is_vdev(..)) { > > > > > > > > > The blocker issue of your suggestion is that we

[dpdk-dev] [PATCH v4 6/8] virtio-user: add new virtual pci driver for virtio

2016-05-16 Thread Tan, Jianfeng
Hi Yuanhan, > -Original Message- > From: Yuanhan Liu [mailto:yuanhan.liu at linux.intel.com] > Sent: Friday, May 13, 2016 12:45 PM > To: Tan, Jianfeng > Cc: dev at dpdk.org; Xie, Huawei; rich.lane at bigswitch.com; mst at > redhat.com; > nakajima.yoshihiro at lab.ntt.co.jp; p.fedin at

[dpdk-dev] [PATCH v4 6/8] virtio-user: add new virtual pci driver for virtio

2016-05-13 Thread Tan, Jianfeng
Hi Michael, On 5/13/2016 1:02 AM, Michael S. Tsirkin wrote: > On Thu, May 12, 2016 at 03:08:05PM +0800, Tan, Jianfeng wrote: >> (2) It's more aligned to previous logic to hide the detail to differentiate >> modern/legacy device. > Why is there a need to support legacy interfaces at all? It's a

[dpdk-dev] [PATCH v4 6/8] virtio-user: add new virtual pci driver for virtio

2016-05-13 Thread Tan, Jianfeng
On 5/13/2016 12:40 AM, Yuanhan Liu wrote: > On Thu, May 12, 2016 at 03:08:05PM +0800, Tan, Jianfeng wrote: +static int +vdev_setup_queue(struct virtio_hw *hw __rte_unused, struct virtqueue *vq) +{ + /* Changed to use virtual addr */ + vq->vq_ring_mem =

[dpdk-dev] [PATCH v4 6/8] virtio-user: add new virtual pci driver for virtio

2016-05-12 Thread Yuanhan Liu
On Fri, May 13, 2016 at 09:54:33AM +0800, Tan, Jianfeng wrote: > > So, I'd suggest something like following: > > if (is_vdev(..)) { > > > The blocker issue of your suggestion is that we have no such condition. > > Previously, I use dev_type, but as David's comment said:

[dpdk-dev] [PATCH v4 6/8] virtio-user: add new virtual pci driver for virtio

2016-05-12 Thread Michael S. Tsirkin
On Thu, May 12, 2016 at 03:08:05PM +0800, Tan, Jianfeng wrote: > (2) It's more aligned to previous logic to hide the detail to differentiate > modern/legacy device. Why is there a need to support legacy interfaces at all? It's a container so if it's in use one can be reasonably sure you have a

[dpdk-dev] [PATCH v4 6/8] virtio-user: add new virtual pci driver for virtio

2016-05-12 Thread Tan, Jianfeng
Hi yuanhan, On 5/12/2016 10:12 AM, Yuanhan Liu wrote: > On Fri, Apr 29, 2016 at 01:18:34AM +, Jianfeng Tan wrote: >> +static void >> +vdev_read_dev_config(struct virtio_hw *hw, uint64_t offset, >> + void *dst, int length) >> +{ >> +int i; >> +struct virtio_user_hw

[dpdk-dev] [PATCH v4 6/8] virtio-user: add new virtual pci driver for virtio

2016-05-12 Thread Yuanhan Liu
On Thu, May 12, 2016 at 03:08:05PM +0800, Tan, Jianfeng wrote: > >>+static int > >>+vdev_setup_queue(struct virtio_hw *hw __rte_unused, struct virtqueue *vq) > >>+{ > >>+ /* Changed to use virtual addr */ > >>+ vq->vq_ring_mem = (phys_addr_t)vq->mz->addr; > >>+ if (vq->virtio_net_hdr_mz) { >

[dpdk-dev] [PATCH v4 6/8] virtio-user: add new virtual pci driver for virtio

2016-05-11 Thread Yuanhan Liu
On Fri, Apr 29, 2016 at 01:18:34AM +, Jianfeng Tan wrote: > +static void > +vdev_read_dev_config(struct virtio_hw *hw, uint64_t offset, > + void *dst, int length) > +{ > + int i; > + struct virtio_user_hw *uhw = (struct virtio_user_hw *)hw->vdev_private; Unnecessary

[dpdk-dev] [PATCH v4 6/8] virtio-user: add new virtual pci driver for virtio

2016-04-29 Thread Jianfeng Tan
This patch implements another new instance of struct virtio_pci_ops to drive the virtio-user virtual device. Instead of rd/wr ioport or PCI configuration space, this virtual pci driver will rd/wr the virtual device struct virtio_user_hw, and when necessary, invokes APIs provided by device